1 #include <linux/export.h>
4 #include <linux/kernel.h>
6 #include <linux/slab.h>
9 #include "../ring_sw.h"
18 static int adis16209_read_ring_data(
struct iio_dev *indio_dev,
u8 *
rx)
28 spi_message_init(&
msg);
30 memset(xfers, 0,
sizeof(xfers));
32 xfers[
i].bits_per_word = 8;
33 xfers[
i].cs_change = 1;
35 xfers[
i].delay_usecs = 30;
36 xfers[
i].tx_buf = st->tx + 2 *
i;
39 st->tx[2 * i + 1] = 0;
41 xfers[
i].rx_buf = rx + 2 * (i - 1);
42 spi_message_add_tail(&xfers[i], &
msg);
47 dev_err(&st->
us->dev,
"problem when burst reading");
57 static irqreturn_t adis16209_trigger_handler(
int irq,
void *
p)
67 dev_err(&st->
us->dev,
"memory alloc failed in ring bh");
72 adis16209_read_ring_data(indio_dev, st->
rx) >= 0)
105 struct iio_buffer *
ring;
113 ring->scan_timestamp =
true;
114 indio_dev->
setup_ops = &adis16209_ring_setup_ops;
117 &adis16209_trigger_handler,
125 goto error_iio_sw_rb_free;
131 error_iio_sw_rb_free: