diff options
author | Beniamin Bia <beniamin.bia@analog.com> | 2019-07-18 09:27:31 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2019-07-28 08:53:59 +0100 |
commit | a0c648c07ce50744d0f6ddb58b483e87907e9122 (patch) | |
tree | 5fa9ba284c5c11f5dc164e990bf18fc968da126a /drivers/iio/adc/ad7606.h | |
parent | 7677f73158d3dac530daca7ce834603989c05b18 (diff) |
iio: adc: ad7606: Move spi dependent features to spi file
Because software mode and register access are only available in spi, they
were moved in spi file and are accessbile via bops structure.
The write_os/scale will be overwritten by sw_mode_config function.
This patch was made in order to support devices in software mode without
making the driver dependent to spi and increase the abstraction of the
core.
Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc/ad7606.h')
-rw-r--r-- | drivers/iio/adc/ad7606.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/iio/adc/ad7606.h b/drivers/iio/adc/ad7606.h index d547e88f4c9d..a6aac33aa33c 100644 --- a/drivers/iio/adc/ad7606.h +++ b/drivers/iio/adc/ad7606.h @@ -39,12 +39,6 @@ * oversampling ratios. * @oversampling_num number of elements stored in oversampling_avail array * @os_req_reset some devices require a reset to update oversampling - * @write_scale_sw pointer to the function which writes the scale via spi - in software mode - * @write_os_sw pointer to the function which writes the os via spi - in software mode - * @sw_mode_config: pointer to a function which configured the device - * for software mode */ struct ad7606_chip_info { const struct iio_chan_spec *channels; @@ -52,9 +46,6 @@ struct ad7606_chip_info { const unsigned int *oversampling_avail; unsigned int oversampling_num; bool os_req_reset; - int (*write_scale_sw)(struct iio_dev *indio_dev, int ch, int val); - int (*write_os_sw)(struct iio_dev *indio_dev, int val); - int (*sw_mode_config)(struct iio_dev *indio_dev); }; /** @@ -124,10 +115,13 @@ struct ad7606_state { /** * struct ad7606_bus_ops - driver bus operations * @read_block function pointer for reading blocks of data + * @sw_mode_config: pointer to a function which configured the device + * for software mode */ struct ad7606_bus_ops { /* more methods added in future? */ int (*read_block)(struct device *dev, int num, void *data); + int (*sw_mode_config)(struct iio_dev *indio_dev); }; int ad7606_probe(struct device *dev, int irq, void __iomem *base_address, |