iio: expose shared parameter in IIO_ENUM_AVAILABLE
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Fri, 19 Nov 2021 08:56:27 +0000 (10:56 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 27 Nov 2021 16:12:23 +0000 (16:12 +0000)
commitffc7c5172a6d1f7ec468066a7172ce65baf1e3e1
treef7b615c572e0e4872568d148e1953a6ad8c0d66e
parentab1fb45579d876aee70eb736d3d9e6a9bacc798d
iio: expose shared parameter in IIO_ENUM_AVAILABLE

The shared parameter should be configurable based on its usage, and not
constrained to IIO_SHARED_BY_TYPE.

This patch aims to improve the flexibility in using the
IIO_ENUM_AVAILABLE define and avoid redefining custom iio enums that
expose the shared parameter.

An example is the ad5766.c driver where IIO_ENUM_AVAILABLE_SHARED was
defined in order to achieve `shared` parameter customization.

The current state of the IIO_ENUM_AVAILABLE implementation will imply
similar redefinitions each time a driver will require access to the
`shared` parameter. An example would be admv1013 driver which will
require custom device attribute for the frequency translation modes:
Quadrature I/Q mode and Intermediate Frequency mode.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20211119085627.6348-1-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
21 files changed:
drivers/iio/accel/bma180.c
drivers/iio/accel/mma9553.c
drivers/iio/adc/ad7192.c
drivers/iio/adc/hi8435.c
drivers/iio/dac/ad5064.c
drivers/iio/dac/ad5380.c
drivers/iio/dac/ad5446.c
drivers/iio/dac/ad5504.c
drivers/iio/dac/ad5624r_spi.c
drivers/iio/dac/ad5686.c
drivers/iio/dac/ad5766.c
drivers/iio/dac/ad5791.c
drivers/iio/dac/max5821.c
drivers/iio/dac/mcp4725.c
drivers/iio/dac/stm32-dac.c
drivers/iio/dac/ti-dac082s085.c
drivers/iio/dac/ti-dac5571.c
drivers/iio/dac/ti-dac7311.c
drivers/iio/magnetometer/hmc5843_core.c
drivers/iio/trigger/stm32-timer-trigger.c
include/linux/iio/iio.h