aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2012-11-13 08:28:00 -0500
committerJonathan Cameron <jic23@kernel.org>2012-11-19 17:22:12 -0500
commitec04cb048d79cd778c06e28f34395a46d774800d (patch)
treeb6c0a01dc7fc137ceeb256381b2f4e96cdc1d59d /drivers/iio
parentaacff892cbd5c6b1904a3906219548a65018d750 (diff)
staging:iio: Move adis library out of staging
Now that the adis library no longer depends on the sw_ring buffer implementation we can move it out of staging. While we are at it also sort the entries in the iio Kconfig and Makefile to be in alphabetical order. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/Kconfig7
-rw-r--r--drivers/iio/Makefile7
-rw-r--r--drivers/iio/imu/Kconfig11
-rw-r--r--drivers/iio/imu/Makefile8
-rw-r--r--drivers/iio/imu/adis.c337
-rw-r--r--drivers/iio/imu/adis_buffer.c159
-rw-r--r--drivers/iio/imu/adis_trigger.c89
7 files changed, 612 insertions, 6 deletions
diff --git a/drivers/iio/Kconfig b/drivers/iio/Kconfig
index 65ae734c607d..b2f963be3993 100644
--- a/drivers/iio/Kconfig
+++ b/drivers/iio/Kconfig
@@ -63,11 +63,12 @@ config IIO_CONSUMERS_PER_TRIGGER
63source "drivers/iio/accel/Kconfig" 63source "drivers/iio/accel/Kconfig"
64source "drivers/iio/adc/Kconfig" 64source "drivers/iio/adc/Kconfig"
65source "drivers/iio/amplifiers/Kconfig" 65source "drivers/iio/amplifiers/Kconfig"
66source "drivers/iio/light/Kconfig"
67source "drivers/iio/frequency/Kconfig"
68source "drivers/iio/dac/Kconfig"
69source "drivers/iio/common/Kconfig" 66source "drivers/iio/common/Kconfig"
67source "drivers/iio/dac/Kconfig"
68source "drivers/iio/frequency/Kconfig"
70source "drivers/iio/gyro/Kconfig" 69source "drivers/iio/gyro/Kconfig"
70source "drivers/iio/imu/Kconfig"
71source "drivers/iio/light/Kconfig"
71source "drivers/iio/magnetometer/Kconfig" 72source "drivers/iio/magnetometer/Kconfig"
72 73
73endif # IIO 74endif # IIO
diff --git a/drivers/iio/Makefile b/drivers/iio/Makefile
index 31d76a07ec65..a0e8cdd67e4d 100644
--- a/drivers/iio/Makefile
+++ b/drivers/iio/Makefile
@@ -14,9 +14,10 @@ obj-$(CONFIG_IIO_KFIFO_BUF) += kfifo_buf.o
14obj-y += accel/ 14obj-y += accel/
15obj-y += adc/ 15obj-y += adc/
16obj-y += amplifiers/ 16obj-y += amplifiers/
17obj-y += light/
18obj-y += frequency/
19obj-y += dac/
20obj-y += common/ 17obj-y += common/
18obj-y += dac/
21obj-y += gyro/ 19obj-y += gyro/
20obj-y += frequency/
21obj-y += imu/
22obj-y += light/
22obj-y += magnetometer/ 23obj-y += magnetometer/
diff --git a/drivers/iio/imu/Kconfig b/drivers/iio/imu/Kconfig
new file mode 100644
index 000000000000..c24410c873c7
--- /dev/null
+++ b/drivers/iio/imu/Kconfig
@@ -0,0 +1,11 @@
1config IIO_ADIS_LIB
2 tristate
3 help
4 A set of IO helper functions for the Analog Devices ADIS* device family.
5
6config IIO_ADIS_LIB_BUFFER
7 bool
8 select IIO_TRIGGERED_BUFFER
9 help
10 A set of buffer helper functions for the Analog Devices ADIS* device
11 family.
diff --git a/drivers/iio/imu/Makefile b/drivers/iio/imu/Makefile
new file mode 100644
index 000000000000..97676ab5723d
--- /dev/null
+++ b/drivers/iio/imu/Makefile
@@ -0,0 +1,8 @@
1#
2# Makefile for Inertial Measurement Units
3#
4
5adis_lib-y += adis.o
6adis_lib-$(CONFIG_IIO_ADIS_LIB_BUFFER) += adis_trigger.o
7adis_lib-$(CONFIG_IIO_ADIS_LIB_BUFFER) += adis_buffer.o
8obj-$(CONFIG_IIO_ADIS_LIB) += adis_lib.o
diff --git a/drivers/iio/imu/adis.c b/drivers/iio/imu/adis.c
new file mode 100644
index 000000000000..8259b774078f
--- /dev/null
+++ b/drivers/iio/imu/adis.c
@@ -0,0 +1,337 @@
1/*
2 * Common library for ADIS16XXX devices
3 *
4 * Copyright 2012 Analog Devices Inc.
5 * Author: Lars-Peter Clausen <lars@metafoo.de>
6 *
7 * Licensed under the GPL-2 or later.
8 */
9
10#include <linux/delay.h>
11#include <linux/mutex.h>
12#include <linux/device.h>
13#include <linux/kernel.h>
14#include <linux/spi/spi.h>
15#include <linux/slab.h>
16#include <linux/sysfs.h>
17#include <linux/module.h>
18#include <asm/unaligned.h>
19
20#include <linux/iio/iio.h>
21#include <linux/iio/sysfs.h>
22#include <linux/iio/buffer.h>
23#include <linux/iio/imu/adis.h>
24
25#define ADIS_MSC_CTRL_DATA_RDY_EN BIT(2)
26#define ADIS_MSC_CTRL_DATA_RDY_POL_HIGH BIT(1)
27#define ADIS_MSC_CTRL_DATA_RDY_DIO2 BIT(0)
28#define ADIS_GLOB_CMD_SW_RESET BIT(7)
29
30/**
31 * adis_write_reg_8() - Write single byte to a register
32 * @adis: The adis device
33 * @reg: The address of the register to be written
34 * @val: The value to write
35 */
36int adis_write_reg_8(struct adis *adis, unsigned int reg, uint8_t val)
37{
38 int ret;
39
40 mutex_lock(&adis->txrx_lock);
41 adis->tx[0] = ADIS_WRITE_REG(reg);
42 adis->tx[1] = val;
43
44 ret = spi_write(adis->spi, adis->tx, 2);
45 mutex_unlock(&adis->txrx_lock);
46
47 return ret;
48}
49EXPORT_SYMBOL_GPL(adis_write_reg_8);
50
51/**
52 * adis_write_reg_16() - Write 2 bytes to a pair of registers
53 * @adis: The adis device
54 * @reg: The address of the lower of the two registers
55 * @val: Value to be written
56 */
57int adis_write_reg_16(struct adis *adis, unsigned int reg, uint16_t value)
58{
59 int ret;
60 struct spi_message msg;
61 struct spi_transfer xfers[] = {
62 {
63 .tx_buf = adis->tx,
64 .bits_per_word = 8,
65 .len = 2,
66 .cs_change = 1,
67 .delay_usecs = adis->data->write_delay,
68 }, {
69 .tx_buf = adis->tx + 2,
70 .bits_per_word = 8,
71 .len = 2,
72 .delay_usecs = adis->data->write_delay,
73 },
74 };
75
76 mutex_lock(&adis->txrx_lock);
77 adis->tx[0] = ADIS_WRITE_REG(reg);
78 adis->tx[1] = value & 0xff;
79 adis->tx[2] = ADIS_WRITE_REG(reg + 1);
80 adis->tx[3] = (value >> 8) & 0xff;
81
82 spi_message_init(&msg);
83 spi_message_add_tail(&xfers[0], &msg);
84 spi_message_add_tail(&xfers[1], &msg);
85 ret = spi_sync(adis->spi, &msg);
86 mutex_unlock(&adis->txrx_lock);
87
88 return ret;
89}
90EXPORT_SYMBOL_GPL(adis_write_reg_16);
91
92/**
93 * adis_read_reg_16() - read 2 bytes from a 16-bit register
94 * @adis: The adis device
95 * @reg: The address of the lower of the two registers
96 * @val: The value read back from the device
97 */
98int adis_read_reg_16(struct adis *adis, unsigned int reg, uint16_t *val)
99{
100 struct spi_message msg;
101 int ret;
102 struct spi_transfer xfers[] = {
103 {
104 .tx_buf = adis->tx,
105 .bits_per_word = 8,
106 .len = 2,
107 .cs_change = 1,
108 .delay_usecs = adis->data->read_delay,
109 }, {
110 .rx_buf = adis->rx,
111 .bits_per_word = 8,
112 .len = 2,
113 .delay_usecs = adis->data->read_delay,
114 },
115 };
116
117 mutex_lock(&adis->txrx_lock);
118 adis->tx[0] = ADIS_READ_REG(reg);
119 adis->tx[1] = 0;
120
121 spi_message_init(&msg);
122 spi_message_add_tail(&xfers[0], &msg);
123 spi_message_add_tail(&xfers[1], &msg);
124 ret = spi_sync(adis->spi, &msg);
125 if (ret) {
126 dev_err(&adis->spi->dev, "Failed to read 16 bit register 0x%02X: %d\n",
127 reg, ret);
128 goto error_ret;
129 }
130 *val = get_unaligned_be16(adis->rx);
131
132error_ret:
133 mutex_unlock(&adis->txrx_lock);
134 return ret;
135}
136EXPORT_SYMBOL_GPL(adis_read_reg_16);
137
138/**
139 * adis_enable_irq() - Enable or disable data ready IRQ
140 * @adis: The adis device
141 * @enable: Whether to enable the IRQ
142 *
143 * Returns 0 on success, negative error code otherwise
144 */
145int adis_enable_irq(struct adis *adis, bool enable)
146{
147 int ret = 0;
148 uint16_t msc;
149
150 ret = adis_read_reg_16(adis, adis->data->msc_ctrl_reg, &msc);
151 if (ret)
152 goto error_ret;
153
154 msc |= ADIS_MSC_CTRL_DATA_RDY_POL_HIGH;
155 msc &= ~ADIS_MSC_CTRL_DATA_RDY_DIO2;
156 if (enable)
157 msc |= ADIS_MSC_CTRL_DATA_RDY_EN;
158 else
159 msc &= ~ADIS_MSC_CTRL_DATA_RDY_EN;
160
161 ret = adis_write_reg_16(adis, adis->data->msc_ctrl_reg, msc);
162
163error_ret:
164 return ret;
165}
166EXPORT_SYMBOL(adis_enable_irq);
167
168/**
169 * adis_check_status() - Check the device for error conditions
170 * @adis: The adis device
171 *
172 * Returns 0 on success, a negative error code otherwise
173 */
174int adis_check_status(struct adis *adis)
175{
176 uint16_t status;
177 int ret;
178 int i;
179
180 ret = adis_read_reg_16(adis, adis->data->diag_stat_reg, &status);
181 if (ret < 0)
182 return ret;
183
184 status &= adis->data->status_error_mask;
185
186 if (status == 0)
187 return 0;
188
189 for (i = 0; i < 16; ++i) {
190 if (status & BIT(i)) {
191 dev_err(&adis->spi->dev, "%s.\n",
192 adis->data->status_error_msgs[i]);
193 }
194 }
195
196 return -EIO;
197}
198EXPORT_SYMBOL_GPL(adis_check_status);
199
200/**
201 * adis_reset() - Reset the device
202 * @adis: The adis device
203 *
204 * Returns 0 on success, a negative error code otherwise
205 */
206int adis_reset(struct adis *adis)
207{
208 int ret;
209
210 ret = adis_write_reg_8(adis, adis->data->glob_cmd_reg,
211 ADIS_GLOB_CMD_SW_RESET);
212 if (ret)
213 dev_err(&adis->spi->dev, "Failed to reset device: %d\n", ret);
214
215 return ret;
216}
217EXPORT_SYMBOL_GPL(adis_reset);
218
219static int adis_self_test(struct adis *adis)
220{
221 int ret;
222
223 ret = adis_write_reg_16(adis, adis->data->msc_ctrl_reg,
224 adis->data->self_test_mask);
225 if (ret) {
226 dev_err(&adis->spi->dev, "Failed to initiate self test: %d\n",
227 ret);
228 return ret;
229 }
230
231 msleep(adis->data->startup_delay);
232
233 return adis_check_status(adis);
234}
235
236/**
237 * adis_inital_startup() - Performs device self-test
238 * @adis: The adis device
239 *
240 * Returns 0 if the device is operational, a negative error code otherwise.
241 *
242 * This function should be called early on in the device initialization sequence
243 * to ensure that the device is in a sane and known state and that it is usable.
244 */
245int adis_initial_startup(struct adis *adis)
246{
247 int ret;
248
249 ret = adis_self_test(adis);
250 if (ret) {
251 dev_err(&adis->spi->dev, "Self-test failed, trying reset.\n");
252 adis_reset(adis);
253 msleep(adis->data->startup_delay);
254 ret = adis_self_test(adis);
255 if (ret) {
256 dev_err(&adis->spi->dev, "Second self-test failed, giving up.\n");
257 return ret;
258 }
259 }
260
261 return 0;
262}
263EXPORT_SYMBOL_GPL(adis_initial_startup);
264
265/**
266 * adis_single_conversion() - Performs a single sample conversion
267 * @indio_dev: The IIO device
268 * @chan: The IIO channel
269 * @error_mask: Mask for the error bit
270 * @val: Result of the conversion
271 *
272 * Returns IIO_VAL_INT on success, a negative error code otherwise.
273 *
274 * The function performs a single conversion on a given channel and post
275 * processes the value accordingly to the channel spec. If a error_mask is given
276 * the function will check if the mask is set in the returned raw value. If it
277 * is set the function will perform a self-check. If the device does not report
278 * a error bit in the channels raw value set error_mask to 0.
279 */
280int adis_single_conversion(struct iio_dev *indio_dev,
281 const struct iio_chan_spec *chan, unsigned int error_mask, int *val)
282{
283 struct adis *adis = iio_device_get_drvdata(indio_dev);
284 uint16_t val16;
285 int ret;
286
287 mutex_lock(&indio_dev->mlock);
288
289 ret = adis_read_reg_16(adis, chan->address, &val16);
290 if (ret)
291 goto err_unlock;
292
293 if (val16 & error_mask) {
294 ret = adis_check_status(adis);
295 if (ret)
296 goto err_unlock;
297 }
298
299 if (chan->scan_type.sign == 's')
300 *val = sign_extend32(val16, chan->scan_type.realbits - 1);
301 else
302 *val = val16 & ((1 << chan->scan_type.realbits) - 1);
303
304 ret = IIO_VAL_INT;
305err_unlock:
306 mutex_unlock(&indio_dev->mlock);
307 return ret;
308}
309EXPORT_SYMBOL_GPL(adis_single_conversion);
310
311/**
312 * adis_init() - Initialize adis device structure
313 * @adis: The adis device
314 * @indio_dev: The iio device
315 * @spi: The spi device
316 * @data: Chip specific data
317 *
318 * Returns 0 on success, a negative error code otherwise.
319 *
320 * This function must be called, before any other adis helper function may be
321 * called.
322 */
323int adis_init(struct adis *adis, struct iio_dev *indio_dev,
324 struct spi_device *spi, const struct adis_data *data)
325{
326 mutex_init(&adis->txrx_lock);
327 adis->spi = spi;
328 adis->data = data;
329 iio_device_set_drvdata(indio_dev, adis);
330
331 return adis_enable_irq(adis, false);
332}
333EXPORT_SYMBOL_GPL(adis_init);
334
335MODULE_LICENSE("GPL");
336MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
337MODULE_DESCRIPTION("Common library code for ADIS16XXX devices");
diff --git a/drivers/iio/imu/adis_buffer.c b/drivers/iio/imu/adis_buffer.c
new file mode 100644
index 000000000000..a91b4cbdc73a
--- /dev/null
+++ b/drivers/iio/imu/adis_buffer.c
@@ -0,0 +1,159 @@
1/*
2 * Common library for ADIS16XXX devices
3 *
4 * Copyright 2012 Analog Devices Inc.
5 * Author: Lars-Peter Clausen <lars@metafoo.de>
6 *
7 * Licensed under the GPL-2 or later.
8 */
9
10#include <linux/export.h>
11#include <linux/interrupt.h>
12#include <linux/mutex.h>
13#include <linux/kernel.h>
14#include <linux/spi/spi.h>
15#include <linux/slab.h>
16
17#include <linux/iio/iio.h>
18#include <linux/iio/buffer.h>
19#include <linux/iio/trigger_consumer.h>
20#include <linux/iio/triggered_buffer.h>
21#include <linux/iio/imu/adis.h>
22
23int adis_update_scan_mode(struct iio_dev *indio_dev,
24 const unsigned long *scan_mask)
25{
26 struct adis *adis = iio_device_get_drvdata(indio_dev);
27 const struct iio_chan_spec *chan;
28 unsigned int scan_count;
29 unsigned int i, j;
30 __be16 *tx, *rx;
31
32 kfree(adis->xfer);
33 kfree(adis->buffer);
34
35 scan_count = indio_dev->scan_bytes / 2;
36
37 adis->xfer = kcalloc(scan_count + 1, sizeof(*adis->xfer), GFP_KERNEL);
38 if (!adis->xfer)
39 return -ENOMEM;
40
41 adis->buffer = kzalloc(indio_dev->scan_bytes * 2, GFP_KERNEL);
42 if (!adis->buffer)
43 return -ENOMEM;
44
45 rx = adis->buffer;
46 tx = rx + indio_dev->scan_bytes;
47
48 spi_message_init(&adis->msg);
49
50 for (j = 0; j <= scan_count; j++) {
51 adis->xfer[j].bits_per_word = 8;
52 if (j != scan_count)
53 adis->xfer[j].cs_change = 1;
54 adis->xfer[j].len = 2;
55 adis->xfer[j].delay_usecs = adis->data->read_delay;
56 if (j < scan_count)
57 adis->xfer[j].tx_buf = &tx[j];
58 if (j >= 1)
59 adis->xfer[j].rx_buf = &rx[j - 1];
60 spi_message_add_tail(&adis->xfer[j], &adis->msg);
61 }
62
63 chan = indio_dev->channels;
64 for (i = 0; i < indio_dev->num_channels; i++, chan++) {
65 if (!test_bit(chan->scan_index, scan_mask))
66 continue;
67 *tx++ = cpu_to_be16(chan->address << 8);
68 }
69
70 return 0;
71}
72EXPORT_SYMBOL_GPL(adis_update_scan_mode);
73
74static irqreturn_t adis_trigger_handler(int irq, void *p)
75{
76 struct iio_poll_func *pf = p;
77 struct iio_dev *indio_dev = pf->indio_dev;
78 struct adis *adis = iio_device_get_drvdata(indio_dev);
79 int ret;
80
81 if (!adis->buffer)
82 return -ENOMEM;
83
84 ret = spi_sync(adis->spi, &adis->msg);
85 if (ret)
86 dev_err(&adis->spi->dev, "Failed to read data: %d", ret);
87
88 /* Guaranteed to be aligned with 8 byte boundary */
89 if (indio_dev->scan_timestamp) {
90 void *b = adis->buffer + indio_dev->scan_bytes - sizeof(s64);
91 *(s64 *)b = pf->timestamp;
92 }
93
94 iio_push_to_buffers(indio_dev, adis->buffer);
95
96 iio_trigger_notify_done(indio_dev->trig);
97
98 return IRQ_HANDLED;
99}
100
101/**
102 * adis_setup_buffer_and_trigger() - Sets up buffer and trigger for the adis device
103 * @adis: The adis device.
104 * @indio_dev: The IIO device.
105 * @trigger_handler: Optional trigger handler, may be NULL.
106 *
107 * Returns 0 on success, a negative error code otherwise.
108 *
109 * This function sets up the buffer and trigger for a adis devices. If
110 * 'trigger_handler' is NULL the default trigger handler will be used. The
111 * default trigger handler will simply read the registers assigned to the
112 * currently active channels.
113 *
114 * adis_cleanup_buffer_and_trigger() should be called to free the resources
115 * allocated by this function.
116 */
117int adis_setup_buffer_and_trigger(struct adis *adis, struct iio_dev *indio_dev,
118 irqreturn_t (*trigger_handler)(int, void *))
119{
120 int ret;
121
122 if (!trigger_handler)
123 trigger_handler = adis_trigger_handler;
124
125 ret = iio_triggered_buffer_setup(indio_dev, &iio_pollfunc_store_time,
126 trigger_handler, NULL);
127 if (ret)
128 return ret;
129
130 if (adis->spi->irq) {
131 ret = adis_probe_trigger(adis, indio_dev);
132 if (ret)
133 goto error_buffer_cleanup;
134 }
135 return 0;
136
137error_buffer_cleanup:
138 iio_triggered_buffer_cleanup(indio_dev);
139 return ret;
140}
141EXPORT_SYMBOL_GPL(adis_setup_buffer_and_trigger);
142
143/**
144 * adis_cleanup_buffer_and_trigger() - Free buffer and trigger resources
145 * @adis: The adis device.
146 * @indio_dev: The IIO device.
147 *
148 * Frees resources allocated by adis_setup_buffer_and_trigger()
149 */
150void adis_cleanup_buffer_and_trigger(struct adis *adis,
151 struct iio_dev *indio_dev)
152{
153 if (adis->spi->irq)
154 adis_remove_trigger(adis);
155 kfree(adis->buffer);
156 kfree(adis->xfer);
157 iio_triggered_buffer_cleanup(indio_dev);
158}
159EXPORT_SYMBOL_GPL(adis_cleanup_buffer_and_trigger);
diff --git a/drivers/iio/imu/adis_trigger.c b/drivers/iio/imu/adis_trigger.c
new file mode 100644
index 000000000000..5a24c9cac343
--- /dev/null
+++ b/drivers/iio/imu/adis_trigger.c
@@ -0,0 +1,89 @@
1/*
2 * Common library for ADIS16XXX devices
3 *
4 * Copyright 2012 Analog Devices Inc.
5 * Author: Lars-Peter Clausen <lars@metafoo.de>
6 *
7 * Licensed under the GPL-2 or later.
8 */
9
10#include <linux/interrupt.h>
11#include <linux/kernel.h>
12#include <linux/spi/spi.h>
13#include <linux/export.h>
14
15#include <linux/iio/iio.h>
16#include <linux/iio/trigger.h>
17#include <linux/iio/imu/adis.h>
18
19static int adis_data_rdy_trigger_set_state(struct iio_trigger *trig,
20 bool state)
21{
22 struct adis *adis = trig->private_data;
23
24 return adis_enable_irq(adis, state);
25}
26
27static const struct iio_trigger_ops adis_trigger_ops = {
28 .owner = THIS_MODULE,
29 .set_trigger_state = &adis_data_rdy_trigger_set_state,
30};
31
32/**
33 * adis_probe_trigger() - Sets up trigger for a adis device
34 * @adis: The adis device
35 * @indio_dev: The IIO device
36 *
37 * Returns 0 on success or a negative error code
38 *
39 * adis_remove_trigger() should be used to free the trigger.
40 */
41int adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev)
42{
43 int ret;
44
45 adis->trig = iio_trigger_alloc("%s-dev%d", indio_dev->name,
46 indio_dev->id);
47 if (adis->trig == NULL)
48 return -ENOMEM;
49
50 ret = request_irq(adis->spi->irq,
51 &iio_trigger_generic_data_rdy_poll,
52 IRQF_TRIGGER_RISING,
53 indio_dev->name,
54 adis->trig);
55 if (ret)
56 goto error_free_trig;
57
58 adis->trig->dev.parent = &adis->spi->dev;
59 adis->trig->ops = &adis_trigger_ops;
60 adis->trig->private_data = adis;
61 ret = iio_trigger_register(adis->trig);
62
63 indio_dev->trig = adis->trig;
64 if (ret)
65 goto error_free_irq;
66
67 return 0;
68
69error_free_irq:
70 free_irq(adis->spi->irq, adis->trig);
71error_free_trig:
72 iio_trigger_free(adis->trig);
73 return ret;
74}
75EXPORT_SYMBOL_GPL(adis_probe_trigger);
76
77/**
78 * adis_remove_trigger() - Remove trigger for a adis devices
79 * @adis: The adis device
80 *
81 * Removes the trigger previously registered with adis_probe_trigger().
82 */
83void adis_remove_trigger(struct adis *adis)
84{
85 iio_trigger_unregister(adis->trig);
86 free_irq(adis->spi->irq, adis->trig);
87 iio_trigger_free(adis->trig);
88}
89EXPORT_SYMBOL_GPL(adis_remove_trigger);