linux-stable/include/linux/iio
Matti Vaittinen 38416c28e1 iio: light: Add gain-time-scale helpers
Some light sensors can adjust both the HW-gain and integration time.
There are cases where adjusting the integration time has similar impact
to the scale of the reported values as gain setting has.

IIO users do typically expect to handle scale by a single writable 'scale'
entry. Driver should then adjust the gain/time accordingly.

It however is difficult for a driver to know whether it should change
gain or integration time to meet the requested scale. Usually it is
preferred to have longer integration time which usually improves
accuracy, but there may be use-cases where long measurement times can be
an issue. Thus it can be preferable to allow also changing the
integration time - but mitigate the scale impact by also changing the gain
underneath. Eg, if integration time change doubles the measured values,
the driver can reduce the HW-gain to half.

The theory of the computations of gain-time-scale is simple. However,
some people (undersigned) got that implemented wrong for more than once.

Add some gain-time-scale helpers in order to not dublicate errors in all
drivers needing these computations.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/268d418e7cffcdaa2ece6738478bbc57692c213e.1680263956.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-04-10 12:26:34 +01:00
..
accel
adc Char / Misc / Other smaller driver subsystem updates for 5.19-rc1 2022-06-03 11:36:34 -07:00
afe iio: afe: rescale: add offset support 2022-02-27 13:38:10 +00:00
common iio: st_sensors: core and lsm9ds0 switch to devm_regulator_bulk_get_enable() 2022-11-23 19:44:01 +00:00
dac
frequency
gyro iio: gyro: itg3200_core: do not use internal iio_dev lock 2022-11-23 19:43:58 +00:00
imu iio: imu: adis: Remove adis_initial_startup function 2022-11-23 20:37:51 +00:00
timer
buffer-dma.h iio: buffer-dma: Remove unused iio_buffer_block struct 2021-11-27 15:12:01 +00:00
buffer-dmaengine.h
buffer.h iio: Add output buffer support 2021-10-19 08:30:44 +01:00
buffer_impl.h iio: Don't silently expect attribute types 2022-11-23 19:44:04 +00:00
configfs.h
consumer.h iio: inkern: remove OF dependencies 2022-08-15 22:30:00 +01:00
driver.h iio: inkern: introduce devm_iio_map_array_register() short-hand function 2021-10-19 08:27:34 +01:00
events.h
hw-consumer.h
iio-gts-helper.h iio: light: Add gain-time-scale helpers 2023-04-10 12:26:34 +01:00
iio-opaque.h iio: core: move 'mlock' to 'struct iio_dev_opaque' 2022-11-23 19:44:00 +00:00
iio.h iio: add struct declaration for iio types 2022-12-28 17:19:44 +00:00
kfifo_buf.h iio: Don't silently expect attribute types 2022-11-23 19:44:04 +00:00
machine.h
sw_device.h
sw_trigger.h
sysfs.h iio: Add IIO_STATIC_CONST_DEVICE_ATTR 2022-11-23 19:44:03 +00:00
trigger.h iio: Rename iio_trigger_poll_chained and add kernel-doc 2023-03-11 12:18:29 +00:00
trigger_consumer.h
triggered_buffer.h iio: Don't silently expect attribute types 2022-11-23 19:44:04 +00:00
triggered_event.h
types.h iio: Add new event type gesture and use direction for single and double tap 2022-09-05 18:08:42 +01:00