11 #include <linux/device.h>
12 #include <linux/kernel.h>
14 #include <linux/slab.h>
16 #include <linux/list.h>
17 #include <linux/module.h>
22 #define ADIS16130_CON 0x0
23 #define ADIS16130_CON_RD (1 << 6)
24 #define ADIS16130_IOP 0x1
27 #define ADIS16130_IOP_ALL_RDY (1 << 3)
28 #define ADIS16130_IOP_SYNC (1 << 0)
29 #define ADIS16130_RATEDATA 0x8
30 #define ADIS16130_TEMPDATA 0xA
31 #define ADIS16130_RATECS 0x28
32 #define ADIS16130_RATECS_EN (1 << 3)
33 #define ADIS16130_TEMPCS 0x2A
34 #define ADIS16130_TEMPCS_EN (1 << 3)
35 #define ADIS16130_RATECONV 0x30
36 #define ADIS16130_TEMPCONV 0x32
37 #define ADIS16130_MODE 0x38
38 #define ADIS16130_MODE_24BIT (1 << 1)
66 st->buf[1] = st->buf[2] = st->buf[3] = 0;
68 spi_message_init(&msg);
69 spi_message_add_tail(&xfer, &msg);
71 ret = spi_read(st->
us, st->buf, 4);
74 *val = (st->buf[1] << 16) | (st->buf[2] << 8) | st->buf[3];
80 static int adis16130_read_raw(
struct iio_dev *indio_dev,
90 ret = adis16130_spi_read(indio_dev, chan->
address, &temp);
114 static const struct iio_info adis16130_info = {
115 .read_raw = &adis16130_read_raw,
127 if (indio_dev ==
NULL) {
131 st = iio_priv(indio_dev);
133 spi_set_drvdata(spi, indio_dev);
136 indio_dev->
name = spi->
dev.driver->name;
137 indio_dev->
channels = adis16130_channels;
139 indio_dev->
dev.parent = &spi->
dev;
140 indio_dev->
info = &adis16130_info;
170 .probe = adis16130_probe,