summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/adc/ad7606.h
diff options
context:
space:
mode:
authorStefan Popa2018-12-17 13:23:37 +0100
committerJonathan Cameron2019-01-05 17:10:52 +0100
commitcc49bd1652a405dc641aeffa6b0925ad9a1affb3 (patch)
tree756031214125e0400b29923e179e9011c3ef0090 /drivers/staging/iio/adc/ad7606.h
parentstaging: iio: adc: ad7606: Use SPDX identifier (diff)
downloadkernel-qcow2-linux-cc49bd1652a405dc641aeffa6b0925ad9a1affb3.tar.gz
kernel-qcow2-linux-cc49bd1652a405dc641aeffa6b0925ad9a1affb3.tar.xz
kernel-qcow2-linux-cc49bd1652a405dc641aeffa6b0925ad9a1affb3.zip
staging: iio: adc: ad7606: Add support for threaded irq
This patch replaces the use of a polling ring buffer with a threaded interrupt. Enabling the buffer sets the CONVST signal to high. When the rising edge of the CONVST is applied, BUSY signal goes logic high and transitions low at the end of the entire conversion process. The falling edge of the BUSY signal triggers the interrupt. ad7606_trigger_handler() is used as bottom half of the poll function. It reads data from the device and stores it in the internal buffer. Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/staging/iio/adc/ad7606.h')
-rw-r--r--drivers/staging/iio/adc/ad7606.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/iio/adc/ad7606.h b/drivers/staging/iio/adc/ad7606.h
index 3e12fff2f1ad..9a832d208acf 100644
--- a/drivers/staging/iio/adc/ad7606.h
+++ b/drivers/staging/iio/adc/ad7606.h
@@ -26,8 +26,6 @@ struct ad7606_chip_info {
* @dev pointer to kernel device
* @chip_info entry in the table of chips that describes this device
* @reg regulator info for the the power supply of the device
- * @poll_work work struct for continuously reading data from the device
- * into an IIO triggered buffer
* @bops bus operations (SPI or parallel)
* @range voltage range selection, selects which scale to apply
* @oversampling oversampling selection
@@ -42,14 +40,13 @@ struct ad7606_chip_info {
* is being read on the first channel
* @gpio_os GPIO descriptors to control oversampling on the device
* @complete completion to indicate end of conversion
+ * @trig The IIO trigger associated with the device.
* @data buffer for reading data from the device
*/
-
struct ad7606_state {
struct device *dev;
const struct ad7606_chip_info *chip_info;
struct regulator *reg;
- struct work_struct poll_work;
const struct ad7606_bus_ops *bops;
unsigned int range;
unsigned int oversampling;
@@ -62,6 +59,7 @@ struct ad7606_state {
struct gpio_desc *gpio_standby;
struct gpio_desc *gpio_frstdata;
struct gpio_descs *gpio_os;
+ struct iio_trigger *trig;
struct completion completion;
/*