linux-stable/drivers/iio
Gwendal Grignou 80346b2b55 iio: cros: unify hw fifo attributes without API changes
Commit 2e2366c2d1 ("iio: cros_ec: unify hw fifo attributes into the core file")
should be reverted as it set buffer extended attributes at
the wrong place. However, to revert it will requires to revert more
commits:
commit 165aea80e2 ("iio: cros_ec: use devm_iio_triggered_buffer_setup_ext()")
commit 21232b4456 ("iio: buffer: remove iio_buffer_set_attrs() helper")).
and we would still have conflict with more recent development.
commit ee708e6baa ("iio: buffer: introduce support for attaching more IIO buffers")

Instead, this commit reverts the first 2 commits without re-adding
iio_buffer_set_attrs() and set the buffer extended attributes at the
right place:

1. Instead of adding has_fw_fifo, deduct it from the configuration:
- EC must support FIFO (EC_FEATURE_MOTION_SENSE_FIFO) set.
- sensors send data a regular interval (accelerometer, gyro,
  magnetomer, barometer, light sensor).
- "Legacy accelerometer" is only present on EC without FIFO, so we don't
need to set buffer attributes.

2. devm_iio_triggered_buffer_setup_ext() does not need to be called when
EC does not support FIFO, as there is no FIFO to manage.

3. Use devm_iio_triggered_buffer_setup_ext() when EC has a FIFO to
specify the buffer extended attributes.

Fixes: 2e2366c2d1 ("iio: cros_ec: unify hw fifo attributes into the core file")
Fixes: 165aea80e2 ("iio: cros_ec: use devm_iio_triggered_buffer_setup_ext()")
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210318184857.2679181-1-gwendal@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-25 19:13:52 +00:00
..
accel iio: cros: unify hw fifo attributes without API changes 2021-03-25 19:13:52 +00:00
adc iio: adc: adi-axi-adc: Drop false marking for kernel-doc 2021-03-25 19:13:51 +00:00
afe iio: afe: iio-rescale: Simplify with dev_err_probe() 2020-09-03 19:40:50 +01:00
amplifiers iio: amplifiers: hmc425a: Simplify with dev_err_probe() 2020-09-03 19:40:50 +01:00
buffer iio: kfifo: add devm_iio_triggered_buffer_setup_ext variant 2021-03-25 19:13:52 +00:00
chemical iio: chemical: atlas: Remove code to set trigger parent 2021-03-25 19:13:50 +00:00
common iio: cros: unify hw fifo attributes without API changes 2021-03-25 19:13:52 +00:00
dac iio:dac:max517.c: Use devm_iio_device_register() 2021-03-25 19:13:52 +00:00
dummy iio: dummy: iio_simple_dummy_buffer: use triggered buffer core calls 2021-03-11 20:47:05 +00:00
frequency iio: frequency: adf4350: Remove redundant null check before clk_disable_unprepare 2021-01-09 21:52:46 +00:00
gyro iio: fix devm_iio_trigger_alloc with parent.cocci 2021-03-25 19:13:50 +00:00
health iio: fix devm_iio_trigger_alloc with parent.cocci 2021-03-25 19:13:50 +00:00
humidity iio: fix devm_iio_trigger_alloc with parent.cocci 2021-03-25 19:13:50 +00:00
imu iio: adis_trigger: Remove code to set trigger parent 2021-03-25 19:13:50 +00:00
light iio: cros: unify hw fifo attributes without API changes 2021-03-25 19:13:52 +00:00
magnetometer iio:magnetometer: Add Support for ST IIS2MDC 2021-03-25 19:13:52 +00:00
multiplexer iio: multiplexer: iio-mux: Simplify with dev_err_probe() 2020-09-03 19:40:51 +01:00
orientation hid-sensors: Add more data fields for sensitivity checking 2021-03-11 20:47:09 +00:00
position iio: hid-sensors: Move get sensitivity attribute to hid-sensor-common 2021-03-11 20:47:09 +00:00
potentiometer iio: use getter/setter functions 2021-03-11 20:47:07 +00:00
potentiostat iio: lmp91000: Remove code to set trigger parent 2021-03-25 19:13:50 +00:00
pressure iio: cros: unify hw fifo attributes without API changes 2021-03-25 19:13:52 +00:00
proximity iio: as3935: Remove code to set trigger parent 2021-03-25 19:13:50 +00:00
resolver iio:resolver:ad2s1200: Drop of_match_ptr protection 2020-09-21 18:41:31 +01:00
temperature iio: temperature: tmp007: use device-managed functions in probe 2021-03-25 19:13:51 +00:00
test iio: Add basic unit test for iio_format_value() 2021-03-11 20:47:00 +00:00
trigger iio: set default trig->dev.parent 2021-03-25 19:13:50 +00:00
iio_core.h iio: buffer: fix use-after-free for attached_buffers array 2021-03-25 19:13:51 +00:00
iio_core_trigger.h iio: core-trigger: make iio_device_register_trigger_consumer() an int return 2021-03-11 20:47:02 +00:00
industrialio-buffer.c iio: buffer: fix use-after-free for attached_buffers array 2021-03-25 19:13:51 +00:00
industrialio-configfs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
industrialio-core.c iio: buffer: fix use-after-free for attached_buffers array 2021-03-25 19:13:51 +00:00
industrialio-event.c iio: add reference to iio buffer on iio_dev_attr 2021-03-11 20:47:04 +00:00
industrialio-sw-device.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
industrialio-sw-trigger.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
industrialio-trigger.c iio: set default trig->dev.parent 2021-03-25 19:13:50 +00:00
industrialio-triggered-event.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
inkern.c iio: Provide iio_read_channel_processed_scale() API 2021-03-25 19:13:51 +00:00
Kconfig iio: Add basic unit test for iio_format_value() 2021-03-11 20:47:00 +00:00
Makefile iio: Add basic unit test for iio_format_value() 2021-03-11 20:47:00 +00:00
TODO iio: add a TODO 2020-03-08 17:28:53 +00:00