linux/drivers/iio/magnetometer
Alexandru Ardelean 067fda1c06 iio: hid-sensors: move triggered buffer setup into hid_sensor_setup_trigger
The main intent here is to get rid of the iio_buffer_set_attrs() helper, or
at least rework it's usage a bit.
The problem with that helper is that it needs a pointer to the buffer,
which makes supporting multiple buffers per IIO device a bit more
cumbersome.

The hid_sensor_setup_trigger() is pretty much used in the same way:
- iio_triggered_buffer_setup() gets called before
- then hid_sensor_setup_trigger() and hid_sensor_setup_batch_mode() gets
  called which may attach some fifo attributes

This change merges the 2 together under the hid_sensor_setup_trigger()
function. Only the &iio_pollfunc_store_time is passed to all devices, so
it's not even required to pass it explicitly outside of the common
hid_sensor_setup_trigger() function.

Moving the devm_iio_triggered_buffer_setup/cleanup() calls into the common
place code can help the rework of the buffer code, since it is in one
place.

One detail of the change is that there are 2 drivers that use
devm_iio_triggered_buffer_setup(). That function gets implicitly
replaced with iio_triggered_buffer_setup()/cleanup(), but since all drivers
call both hid_sensor_setup_trigger9) & hid_sensor_remove_trigger() trigger,
the iio_triggered_buffer_cleanup() piggy backs on the
hid_sensor_remove_trigger() call, which should cover the cleanup.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-10 09:35:53 +01:00
..
ak8974.c iio: magnetometer: ak8974: Provide scaling 2020-05-03 09:47:22 +01:00
ak8975.c iio: magnetometer: ak8975: Convert to use device_get_match_data() 2020-01-18 11:43:17 +00:00
bmc150_magn_i2c.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
bmc150_magn_spi.c iio: magn: bmc150: Use vsprintf extension %pe for symbolic error name 2020-04-19 16:56:18 +01:00
bmc150_magn.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
bmc150_magn.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hid-sensor-magn-3d.c iio: hid-sensors: move triggered buffer setup into hid_sensor_setup_trigger 2020-05-10 09:35:53 +01:00
hmc5843_core.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
hmc5843_i2c.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
hmc5843_spi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
hmc5843.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mag3110.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 330 2019-06-05 17:37:06 +02:00
Makefile iio: magnetometer: Add driver support for PNI RM3100 2018-11-16 18:32:31 +00:00
mmc35240.c iio:magn:mmc35240: Drop unnecessary casts of val parameter in regmap_bulk* 2020-04-19 16:56:40 +01:00
rm3100-core.c iio: magnetometer: rm3100: Use get_unaligned_be24() 2020-05-03 09:47:20 +01:00
rm3100-i2c.c iio: magnetometer: Add driver support for PNI RM3100 2018-11-16 18:32:31 +00:00
rm3100-spi.c iio: magnetometer: Add driver support for PNI RM3100 2018-11-16 18:32:31 +00:00
rm3100.h iio: magnetometer: Add driver support for PNI RM3100 2018-11-16 18:32:31 +00:00
st_magn_buffer.c iio:st_sensors: remove buffer allocation at each buffer enable 2019-08-11 09:26:04 +01:00
st_magn_core.c iio: st_sensors: Drop unneeded explicit castings 2020-03-21 10:26:21 +00:00
st_magn_i2c.c iio: st_sensors: Make use of device properties 2020-01-13 21:53:39 +00:00
st_magn_spi.c iio: st_sensors: Make use of device properties 2020-01-13 21:53:39 +00:00
st_magn.h iio:magn: introduce st_magn_get_settings() function 2019-07-27 22:52:05 +01:00