OpenCloudOS-Kernel/include/linux/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: accel: kxcjk1013: Support orientation matrix 2020-01-18 14:26:13 +00:00
adc iio: adc: adi-axi-adc: fix typo in doc-string 2021-03-11 20:47:11 +00:00
common iio: cros: unify hw fifo attributes without API changes 2021-03-25 19:13:52 +00:00
dac treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177 2019-05-30 11:29:19 -07:00
frequency iio: adf4350: Convert to use GPIO descriptor 2019-12-15 11:42:16 +00:00
gyro treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
imu iio: adis: add helpers for locking 2021-03-11 20:47:12 +00:00
timer treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
buffer-dma.h iio: dma-buffer: Cleanup buffer.h/buffer_impl.h includes 2020-04-19 16:56:31 +01:00
buffer-dmaengine.h iio: buffer-dma,adi-axi-adc: introduce devm_iio_dmaengine_buffer_setup() 2021-03-11 20:47:02 +00:00
buffer.h iio: buffer: introduce support for attaching more IIO buffers 2021-03-11 20:47:05 +00:00
buffer_impl.h iio: buffer: add ioctl() to support opening extra buffers for IIO device 2021-03-11 20:47:05 +00:00
configfs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
consumer.h iio: Provide iio_read_channel_processed_scale() API 2021-03-25 19:13:51 +00:00
driver.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
events.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
hw-consumer.h iio: buffer: drop devm_iio_hw_consumer_free() API call 2020-04-19 16:56:37 +01:00
iio-opaque.h iio: buffer: add ioctl() to support opening extra buffers for IIO device 2021-03-11 20:47:05 +00:00
iio.h iio: set default trig->dev.parent 2021-03-25 19:13:50 +00:00
kfifo_buf.h iio: kfifo: add devm_iio_triggered_buffer_setup_ext variant 2021-03-25 19:13:52 +00:00
machine.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sw_device.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sw_trigger.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sysfs.h iio: add reference to iio buffer on iio_dev_attr 2021-03-11 20:47:04 +00:00
trigger.h iio: set default trig->dev.parent 2021-03-25 19:13:50 +00:00
trigger_consumer.h iio: Add __printf() attributes to various allocation functions 2020-09-21 18:54:18 +01:00
triggered_buffer.h iio: triggered-buffer: add {devm_}iio_triggered_buffer_setup_ext variants 2020-11-21 14:53:09 +00:00
triggered_event.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
types.h iio: Add relative sensitivity support 2021-03-11 20:47:09 +00:00