1 #include <linux/export.h>
4 #include <linux/kernel.h>
6 #include <linux/slab.h>
9 #include "../ring_sw.h"
18 static int adis16240_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");
54 static irqreturn_t adis16240_trigger_handler(
int irq,
void *
p)
65 dev_err(&st->
us->dev,
"memory alloc failed in ring bh");
70 adis16240_read_ring_data(indio_dev, st->
rx) >= 0)
103 struct iio_buffer *
ring;
111 ring->scan_timestamp =
true;
112 indio_dev->
setup_ops = &adis16240_ring_setup_ops;
115 &adis16240_trigger_handler,
123 goto error_iio_sw_rb_free;
129 error_iio_sw_rb_free: