summaryrefslogtreecommitdiffstats
path: root/drivers/iio/dac/ad5064.c
diff options
context:
space:
mode:
authorAntoniu Miclaus <antoniu.miclaus@analog.com>2021-11-19 09:56:27 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-11-27 17:12:23 +0100
commitffc7c5172a6d1f7ec468066a7172ce65baf1e3e1 (patch)
treef7b615c572e0e4872568d148e1953a6ad8c0d66e /drivers/iio/dac/ad5064.c
parentiio: buffer-dma: Use round_down() instead of rounddown() (diff)
downloadlinux-ffc7c5172a6d1f7ec468066a7172ce65baf1e3e1.tar.xz
linux-ffc7c5172a6d1f7ec468066a7172ce65baf1e3e1.zip
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>
Diffstat (limited to 'drivers/iio/dac/ad5064.c')
-rw-r--r--drivers/iio/dac/ad5064.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/dac/ad5064.c b/drivers/iio/dac/ad5064.c
index fd9cac4f6321..27ee2c63c5d4 100644
--- a/drivers/iio/dac/ad5064.c
+++ b/drivers/iio/dac/ad5064.c
@@ -377,7 +377,7 @@ static const struct iio_chan_spec_ext_info ad5064_ext_info[] = {
.shared = IIO_SEPARATE,
},
IIO_ENUM("powerdown_mode", IIO_SEPARATE, &ad5064_powerdown_mode_enum),
- IIO_ENUM_AVAILABLE("powerdown_mode", &ad5064_powerdown_mode_enum),
+ IIO_ENUM_AVAILABLE("powerdown_mode", IIO_SHARED_BY_TYPE, &ad5064_powerdown_mode_enum),
{ },
};
@@ -389,7 +389,7 @@ static const struct iio_chan_spec_ext_info ltc2617_ext_info[] = {
.shared = IIO_SEPARATE,
},
IIO_ENUM("powerdown_mode", IIO_SEPARATE, &ltc2617_powerdown_mode_enum),
- IIO_ENUM_AVAILABLE("powerdown_mode", &ltc2617_powerdown_mode_enum),
+ IIO_ENUM_AVAILABLE("powerdown_mode", IIO_SHARED_BY_TYPE, &ltc2617_powerdown_mode_enum),
{ },
};