1 // SPDX-License-Identifier: GPL-2.0+
3 * AD4000 SPI ADC driver
5 * Copyright 2024 Analog Devices Inc.
7 #include <linux/bits.h>
8 #include <linux/bitfield.h>
9 #include <linux/byteorder/generic.h>
10 #include <linux/cleanup.h>
11 #include <linux/device.h>
12 #include <linux/err.h>
13 #include <linux/math.h>
14 #include <linux/module.h>
15 #include <linux/mod_devicetable.h>
16 #include <linux/gpio/consumer.h>
17 #include <linux/regulator/consumer.h>
18 #include <linux/spi/spi.h>
19 #include <linux/units.h>
20 #include <linux/util_macros.h>
21 #include <linux/iio/iio.h>
23 #include <linux/iio/buffer.h>
24 #include <linux/iio/triggered_buffer.h>
25 #include <linux/iio/trigger_consumer.h>
27 #define AD4000_READ_COMMAND 0x54
28 #define AD4000_WRITE_COMMAND 0x14
30 #define AD4000_CONFIG_REG_DEFAULT 0xE1
32 /* AD4000 Configuration Register programmable bits */
33 #define AD4000_CFG_SPAN_COMP BIT(3) /* Input span compression */
34 #define AD4000_CFG_HIGHZ BIT(2) /* High impedance mode */
36 #define AD4000_SCALE_OPTIONS 2
38 #define AD4000_TQUIET1_NS 190
39 #define AD4000_TQUIET2_NS 60
40 #define AD4000_TCONV_NS 320
42 #define __AD4000_DIFF_CHANNEL(_sign, _real_bits, _storage_bits, _reg_access) \
44 .type = IIO_VOLTAGE, \
49 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
50 BIT(IIO_CHAN_INFO_SCALE), \
51 .info_mask_separate_available = _reg_access ? BIT(IIO_CHAN_INFO_SCALE) : 0,\
54 .realbits = _real_bits, \
55 .storagebits = _storage_bits, \
56 .shift = _storage_bits - _real_bits, \
57 .endianness = IIO_BE, \
61 #define AD4000_DIFF_CHANNEL(_sign, _real_bits, _reg_access) \
62 __AD4000_DIFF_CHANNEL((_sign), (_real_bits), \
63 ((_real_bits) > 16 ? 32 : 16), (_reg_access))
65 #define __AD4000_PSEUDO_DIFF_CHANNEL(_sign, _real_bits, _storage_bits, _reg_access)\
67 .type = IIO_VOLTAGE, \
70 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
71 BIT(IIO_CHAN_INFO_SCALE) | \
72 BIT(IIO_CHAN_INFO_OFFSET), \
73 .info_mask_separate_available = _reg_access ? BIT(IIO_CHAN_INFO_SCALE) : 0,\
76 .realbits = _real_bits, \
77 .storagebits = _storage_bits, \
78 .shift = _storage_bits - _real_bits, \
79 .endianness = IIO_BE, \
83 #define AD4000_PSEUDO_DIFF_CHANNEL(_sign, _real_bits, _reg_access) \
84 __AD4000_PSEUDO_DIFF_CHANNEL((_sign), (_real_bits), \
85 ((_real_bits) > 16 ? 32 : 16), (_reg_access))
87 static const char * const ad4000_power_supplies[] = {
98 /* maps adi,sdi-pin property value to enum */
99 static const char * const ad4000_sdi_pin[] = {
100 [AD4000_SDI_MOSI] = "sdi",
101 [AD4000_SDI_VIO] = "high",
102 [AD4000_SDI_CS] = "cs",
103 [AD4000_SDI_GND] = "low",
106 /* Gains stored as fractions of 1000 so they can be expressed by integers. */
107 static const int ad4000_gains[] = {
108 454, 909, 1000, 1900,
111 struct ad4000_chip_info {
112 const char *dev_name;
113 struct iio_chan_spec chan_spec;
114 struct iio_chan_spec reg_access_chan_spec;
115 bool has_hardware_gain;
118 static const struct ad4000_chip_info ad4000_chip_info = {
119 .dev_name = "ad4000",
120 .chan_spec = AD4000_PSEUDO_DIFF_CHANNEL('u', 16, 0),
121 .reg_access_chan_spec = AD4000_PSEUDO_DIFF_CHANNEL('u', 16, 1),
124 static const struct ad4000_chip_info ad4001_chip_info = {
125 .dev_name = "ad4001",
126 .chan_spec = AD4000_DIFF_CHANNEL('s', 16, 0),
127 .reg_access_chan_spec = AD4000_DIFF_CHANNEL('s', 16, 1),
130 static const struct ad4000_chip_info ad4002_chip_info = {
131 .dev_name = "ad4002",
132 .chan_spec = AD4000_PSEUDO_DIFF_CHANNEL('u', 18, 0),
133 .reg_access_chan_spec = AD4000_PSEUDO_DIFF_CHANNEL('u', 18, 1),
136 static const struct ad4000_chip_info ad4003_chip_info = {
137 .dev_name = "ad4003",
138 .chan_spec = AD4000_DIFF_CHANNEL('s', 18, 0),
139 .reg_access_chan_spec = AD4000_DIFF_CHANNEL('s', 18, 1),
142 static const struct ad4000_chip_info ad4004_chip_info = {
143 .dev_name = "ad4004",
144 .chan_spec = AD4000_PSEUDO_DIFF_CHANNEL('u', 16, 0),
145 .reg_access_chan_spec = AD4000_PSEUDO_DIFF_CHANNEL('u', 16, 1),
148 static const struct ad4000_chip_info ad4005_chip_info = {
149 .dev_name = "ad4005",
150 .chan_spec = AD4000_DIFF_CHANNEL('s', 16, 0),
151 .reg_access_chan_spec = AD4000_DIFF_CHANNEL('s', 16, 1),
154 static const struct ad4000_chip_info ad4006_chip_info = {
155 .dev_name = "ad4006",
156 .chan_spec = AD4000_PSEUDO_DIFF_CHANNEL('u', 18, 0),
157 .reg_access_chan_spec = AD4000_PSEUDO_DIFF_CHANNEL('u', 18, 1),
160 static const struct ad4000_chip_info ad4007_chip_info = {
161 .dev_name = "ad4007",
162 .chan_spec = AD4000_DIFF_CHANNEL('s', 18, 0),
163 .reg_access_chan_spec = AD4000_DIFF_CHANNEL('s', 18, 1),
166 static const struct ad4000_chip_info ad4008_chip_info = {
167 .dev_name = "ad4008",
168 .chan_spec = AD4000_PSEUDO_DIFF_CHANNEL('u', 16, 0),
169 .reg_access_chan_spec = AD4000_PSEUDO_DIFF_CHANNEL('u', 16, 1),
172 static const struct ad4000_chip_info ad4010_chip_info = {
173 .dev_name = "ad4010",
174 .chan_spec = AD4000_PSEUDO_DIFF_CHANNEL('u', 18, 0),
175 .reg_access_chan_spec = AD4000_PSEUDO_DIFF_CHANNEL('u', 18, 1),
178 static const struct ad4000_chip_info ad4011_chip_info = {
179 .dev_name = "ad4011",
180 .chan_spec = AD4000_DIFF_CHANNEL('s', 18, 0),
181 .reg_access_chan_spec = AD4000_DIFF_CHANNEL('s', 18, 1),
184 static const struct ad4000_chip_info ad4020_chip_info = {
185 .dev_name = "ad4020",
186 .chan_spec = AD4000_DIFF_CHANNEL('s', 20, 0),
187 .reg_access_chan_spec = AD4000_DIFF_CHANNEL('s', 20, 1),
190 static const struct ad4000_chip_info ad4021_chip_info = {
191 .dev_name = "ad4021",
192 .chan_spec = AD4000_DIFF_CHANNEL('s', 20, 0),
193 .reg_access_chan_spec = AD4000_DIFF_CHANNEL('s', 20, 1),
196 static const struct ad4000_chip_info ad4022_chip_info = {
197 .dev_name = "ad4022",
198 .chan_spec = AD4000_DIFF_CHANNEL('s', 20, 0),
199 .reg_access_chan_spec = AD4000_DIFF_CHANNEL('s', 20, 1),
202 static const struct ad4000_chip_info adaq4001_chip_info = {
203 .dev_name = "adaq4001",
204 .chan_spec = AD4000_DIFF_CHANNEL('s', 16, 0),
205 .reg_access_chan_spec = AD4000_DIFF_CHANNEL('s', 16, 1),
206 .has_hardware_gain = true,
209 static const struct ad4000_chip_info adaq4003_chip_info = {
210 .dev_name = "adaq4003",
211 .chan_spec = AD4000_DIFF_CHANNEL('s', 18, 0),
212 .reg_access_chan_spec = AD4000_DIFF_CHANNEL('s', 18, 1),
213 .has_hardware_gain = true,
216 struct ad4000_state {
217 struct spi_device *spi;
218 struct gpio_desc *cnv_gpio;
219 struct spi_transfer xfers[2];
220 struct spi_message msg;
221 struct mutex lock; /* Protect read modify write cycle */
223 enum ad4000_sdi sdi_pin;
226 int scale_tbl[AD4000_SCALE_OPTIONS][2];
229 * DMA (thus cache coherency maintenance) requires the transfer buffers
230 * to live in their own cache lines.
237 s64 timestamp __aligned(8);
238 } scan __aligned(IIO_DMA_MINALIGN);
243 static void ad4000_fill_scale_tbl(struct ad4000_state *st,
244 struct iio_chan_spec const *chan)
251 * ADCs that output two's complement code have one less bit to express
254 if (chan->scan_type.sign == 's')
255 scale_bits = chan->scan_type.realbits - 1;
257 scale_bits = chan->scan_type.realbits;
260 * The gain is stored as a fraction of 1000 and, as we need to
261 * divide vref_mv by the gain, we invert the gain/1000 fraction.
262 * Also multiply by an extra MILLI to preserve precision.
263 * Thus, we have MILLI * MILLI equals MICRO as fraction numerator.
265 val = mult_frac(st->vref_mv, MICRO, st->gain_milli);
267 /* Would multiply by NANO here but we multiplied by extra MILLI */
268 tmp2 = shift_right((u64)val * MICRO, scale_bits);
269 tmp0 = div_s64_rem(tmp2, NANO, &tmp1);
271 /* Store scale for when span compression is disabled */
272 st->scale_tbl[0][0] = tmp0; /* Integer part */
273 st->scale_tbl[0][1] = abs(tmp1); /* Fractional part */
275 /* Store scale for when span compression is enabled */
276 st->scale_tbl[1][0] = tmp0;
278 /* The integer part is always zero so don't bother to divide it. */
279 if (chan->differential)
280 st->scale_tbl[1][1] = DIV_ROUND_CLOSEST(abs(tmp1) * 4, 5);
282 st->scale_tbl[1][1] = DIV_ROUND_CLOSEST(abs(tmp1) * 9, 10);
285 static int ad4000_write_reg(struct ad4000_state *st, uint8_t val)
287 st->tx_buf[0] = AD4000_WRITE_COMMAND;
289 return spi_write(st->spi, st->tx_buf, ARRAY_SIZE(st->tx_buf));
292 static int ad4000_read_reg(struct ad4000_state *st, unsigned int *val)
294 struct spi_transfer t = {
295 .tx_buf = st->tx_buf,
296 .rx_buf = st->rx_buf,
301 st->tx_buf[0] = AD4000_READ_COMMAND;
302 ret = spi_sync_transfer(st->spi, &t, 1);
306 *val = st->rx_buf[1];
310 static int ad4000_convert_and_acquire(struct ad4000_state *st)
315 * In 4-wire mode, the CNV line is held high for the entire conversion
316 * and acquisition process. In other modes, the CNV GPIO is optional
317 * and, if provided, replaces controller CS. If CNV GPIO is not defined
318 * gpiod_set_value_cansleep() has no effect.
320 gpiod_set_value_cansleep(st->cnv_gpio, 1);
321 ret = spi_sync(st->spi, &st->msg);
322 gpiod_set_value_cansleep(st->cnv_gpio, 0);
327 static int ad4000_single_conversion(struct iio_dev *indio_dev,
328 const struct iio_chan_spec *chan, int *val)
330 struct ad4000_state *st = iio_priv(indio_dev);
334 ret = ad4000_convert_and_acquire(st);
338 if (chan->scan_type.storagebits > 16)
339 sample = be32_to_cpu(st->scan.data.sample_buf32);
341 sample = be16_to_cpu(st->scan.data.sample_buf16);
343 sample >>= chan->scan_type.shift;
345 if (chan->scan_type.sign == 's')
346 *val = sign_extend32(sample, chan->scan_type.realbits - 1);
353 static int ad4000_read_raw(struct iio_dev *indio_dev,
354 struct iio_chan_spec const *chan, int *val,
355 int *val2, long info)
357 struct ad4000_state *st = iio_priv(indio_dev);
360 case IIO_CHAN_INFO_RAW:
361 iio_device_claim_direct_scoped(return -EBUSY, indio_dev)
362 return ad4000_single_conversion(indio_dev, chan, val);
364 case IIO_CHAN_INFO_SCALE:
365 *val = st->scale_tbl[st->span_comp][0];
366 *val2 = st->scale_tbl[st->span_comp][1];
367 return IIO_VAL_INT_PLUS_NANO;
368 case IIO_CHAN_INFO_OFFSET:
371 *val = mult_frac(st->vref_mv, 1, 10);
379 static int ad4000_read_avail(struct iio_dev *indio_dev,
380 struct iio_chan_spec const *chan,
381 const int **vals, int *type, int *length,
384 struct ad4000_state *st = iio_priv(indio_dev);
387 case IIO_CHAN_INFO_SCALE:
388 *vals = (int *)st->scale_tbl;
389 *length = AD4000_SCALE_OPTIONS * 2;
390 *type = IIO_VAL_INT_PLUS_NANO;
391 return IIO_AVAIL_LIST;
397 static int ad4000_write_raw_get_fmt(struct iio_dev *indio_dev,
398 struct iio_chan_spec const *chan, long mask)
401 case IIO_CHAN_INFO_SCALE:
402 return IIO_VAL_INT_PLUS_NANO;
404 return IIO_VAL_INT_PLUS_MICRO;
408 static int ad4000_write_raw(struct iio_dev *indio_dev,
409 struct iio_chan_spec const *chan, int val, int val2,
412 struct ad4000_state *st = iio_priv(indio_dev);
413 unsigned int reg_val;
418 case IIO_CHAN_INFO_SCALE:
419 iio_device_claim_direct_scoped(return -EBUSY, indio_dev) {
420 guard(mutex)(&st->lock);
422 ret = ad4000_read_reg(st, ®_val);
426 span_comp_en = val2 == st->scale_tbl[1][1];
427 reg_val &= ~AD4000_CFG_SPAN_COMP;
428 reg_val |= FIELD_PREP(AD4000_CFG_SPAN_COMP, span_comp_en);
430 ret = ad4000_write_reg(st, reg_val);
434 st->span_comp = span_comp_en;
443 static irqreturn_t ad4000_trigger_handler(int irq, void *p)
445 struct iio_poll_func *pf = p;
446 struct iio_dev *indio_dev = pf->indio_dev;
447 struct ad4000_state *st = iio_priv(indio_dev);
450 ret = ad4000_convert_and_acquire(st);
454 iio_push_to_buffers_with_timestamp(indio_dev, &st->scan, pf->timestamp);
457 iio_trigger_notify_done(indio_dev->trig);
461 static const struct iio_info ad4000_reg_access_info = {
462 .read_raw = &ad4000_read_raw,
463 .read_avail = &ad4000_read_avail,
464 .write_raw = &ad4000_write_raw,
465 .write_raw_get_fmt = &ad4000_write_raw_get_fmt,
468 static const struct iio_info ad4000_info = {
469 .read_raw = &ad4000_read_raw,
473 * This executes a data sample transfer for when the device connections are
474 * in "3-wire" mode, selected when the adi,sdi-pin device tree property is
475 * absent or set to "high". In this connection mode, the ADC SDI pin is
476 * connected to MOSI or to VIO and ADC CNV pin is connected either to a SPI
477 * controller CS or to a GPIO.
478 * AD4000 series of devices initiate conversions on the rising edge of CNV pin.
480 * If the CNV pin is connected to an SPI controller CS line (which is by default
481 * active low), the ADC readings would have a latency (delay) of one read.
482 * Moreover, since we also do ADC sampling for filling the buffer on triggered
483 * buffer mode, the timestamps of buffer readings would be disarranged.
484 * To prevent the read latency and reduce the time discrepancy between the
485 * sample read request and the time of actual sampling by the ADC, do a
486 * preparatory transfer to pulse the CS/CNV line.
488 static int ad4000_prepare_3wire_mode_message(struct ad4000_state *st,
489 const struct iio_chan_spec *chan)
491 unsigned int cnv_pulse_time = AD4000_TCONV_NS;
492 struct spi_transfer *xfers = st->xfers;
494 xfers[0].cs_change = 1;
495 xfers[0].cs_change_delay.value = cnv_pulse_time;
496 xfers[0].cs_change_delay.unit = SPI_DELAY_UNIT_NSECS;
498 xfers[1].rx_buf = &st->scan.data;
499 xfers[1].len = BITS_TO_BYTES(chan->scan_type.storagebits);
500 xfers[1].delay.value = AD4000_TQUIET2_NS;
501 xfers[1].delay.unit = SPI_DELAY_UNIT_NSECS;
503 spi_message_init_with_transfers(&st->msg, st->xfers, 2);
505 return devm_spi_optimize_message(&st->spi->dev, st->spi, &st->msg);
509 * This executes a data sample transfer for when the device connections are
510 * in "4-wire" mode, selected when the adi,sdi-pin device tree property is
511 * set to "cs". In this connection mode, the controller CS pin is connected to
512 * ADC SDI pin and a GPIO is connected to ADC CNV pin.
513 * The GPIO connected to ADC CNV pin is set outside of the SPI transfer.
515 static int ad4000_prepare_4wire_mode_message(struct ad4000_state *st,
516 const struct iio_chan_spec *chan)
518 unsigned int cnv_to_sdi_time = AD4000_TCONV_NS;
519 struct spi_transfer *xfers = st->xfers;
522 * Dummy transfer to cause enough delay between CNV going high and SDI
526 xfers[0].delay.value = cnv_to_sdi_time;
527 xfers[0].delay.unit = SPI_DELAY_UNIT_NSECS;
529 xfers[1].rx_buf = &st->scan.data;
530 xfers[1].len = BITS_TO_BYTES(chan->scan_type.storagebits);
532 spi_message_init_with_transfers(&st->msg, st->xfers, 2);
534 return devm_spi_optimize_message(&st->spi->dev, st->spi, &st->msg);
537 static int ad4000_config(struct ad4000_state *st)
539 unsigned int reg_val = AD4000_CONFIG_REG_DEFAULT;
541 if (device_property_present(&st->spi->dev, "adi,high-z-input"))
542 reg_val |= FIELD_PREP(AD4000_CFG_HIGHZ, 1);
544 return ad4000_write_reg(st, reg_val);
547 static int ad4000_probe(struct spi_device *spi)
549 const struct ad4000_chip_info *chip;
550 struct device *dev = &spi->dev;
551 struct iio_dev *indio_dev;
552 struct ad4000_state *st;
555 indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
559 chip = spi_get_device_match_data(spi);
563 st = iio_priv(indio_dev);
566 ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(ad4000_power_supplies),
567 ad4000_power_supplies);
569 return dev_err_probe(dev, ret, "Failed to enable power supplies\n");
571 ret = devm_regulator_get_enable_read_voltage(dev, "ref");
573 return dev_err_probe(dev, ret,
574 "Failed to get ref regulator reference\n");
575 st->vref_mv = ret / 1000;
577 st->cnv_gpio = devm_gpiod_get_optional(dev, "cnv", GPIOD_OUT_HIGH);
578 if (IS_ERR(st->cnv_gpio))
579 return dev_err_probe(dev, PTR_ERR(st->cnv_gpio),
580 "Failed to get CNV GPIO");
582 ret = device_property_match_property_string(dev, "adi,sdi-pin",
584 ARRAY_SIZE(ad4000_sdi_pin));
585 if (ret < 0 && ret != -EINVAL)
586 return dev_err_probe(dev, ret,
587 "getting adi,sdi-pin property failed\n");
589 /* Default to usual SPI connections if pin properties are not present */
590 st->sdi_pin = ret == -EINVAL ? AD4000_SDI_MOSI : ret;
591 switch (st->sdi_pin) {
592 case AD4000_SDI_MOSI:
593 indio_dev->info = &ad4000_reg_access_info;
594 indio_dev->channels = &chip->reg_access_chan_spec;
597 * In "3-wire mode", the ADC SDI line must be kept high when
598 * data is not being clocked out of the controller.
599 * Request the SPI controller to make MOSI idle high.
601 spi->mode |= SPI_MOSI_IDLE_HIGH;
602 ret = spi_setup(spi);
606 ret = ad4000_prepare_3wire_mode_message(st, indio_dev->channels);
610 ret = ad4000_config(st);
612 return dev_err_probe(dev, ret, "Failed to config device\n");
616 indio_dev->info = &ad4000_info;
617 indio_dev->channels = &chip->chan_spec;
618 ret = ad4000_prepare_3wire_mode_message(st, indio_dev->channels);
624 indio_dev->info = &ad4000_info;
625 indio_dev->channels = &chip->chan_spec;
626 ret = ad4000_prepare_4wire_mode_message(st, indio_dev->channels);
632 return dev_err_probe(dev, -EPROTONOSUPPORT,
633 "Unsupported connection mode\n");
636 return dev_err_probe(dev, -EINVAL, "Unrecognized connection mode\n");
639 indio_dev->name = chip->dev_name;
640 indio_dev->num_channels = 1;
642 ret = devm_mutex_init(dev, &st->lock);
646 st->gain_milli = 1000;
647 if (chip->has_hardware_gain) {
648 ret = device_property_read_u16(dev, "adi,gain-milli",
651 /* Match gain value from dt to one of supported gains */
652 gain_idx = find_closest(st->gain_milli, ad4000_gains,
653 ARRAY_SIZE(ad4000_gains));
654 st->gain_milli = ad4000_gains[gain_idx];
656 return dev_err_probe(dev, ret,
657 "Failed to read gain property\n");
661 ad4000_fill_scale_tbl(st, indio_dev->channels);
663 ret = devm_iio_triggered_buffer_setup(dev, indio_dev,
664 &iio_pollfunc_store_time,
665 &ad4000_trigger_handler, NULL);
669 return devm_iio_device_register(dev, indio_dev);
672 static const struct spi_device_id ad4000_id[] = {
673 { "ad4000", (kernel_ulong_t)&ad4000_chip_info },
674 { "ad4001", (kernel_ulong_t)&ad4001_chip_info },
675 { "ad4002", (kernel_ulong_t)&ad4002_chip_info },
676 { "ad4003", (kernel_ulong_t)&ad4003_chip_info },
677 { "ad4004", (kernel_ulong_t)&ad4004_chip_info },
678 { "ad4005", (kernel_ulong_t)&ad4005_chip_info },
679 { "ad4006", (kernel_ulong_t)&ad4006_chip_info },
680 { "ad4007", (kernel_ulong_t)&ad4007_chip_info },
681 { "ad4008", (kernel_ulong_t)&ad4008_chip_info },
682 { "ad4010", (kernel_ulong_t)&ad4010_chip_info },
683 { "ad4011", (kernel_ulong_t)&ad4011_chip_info },
684 { "ad4020", (kernel_ulong_t)&ad4020_chip_info },
685 { "ad4021", (kernel_ulong_t)&ad4021_chip_info },
686 { "ad4022", (kernel_ulong_t)&ad4022_chip_info },
687 { "adaq4001", (kernel_ulong_t)&adaq4001_chip_info },
688 { "adaq4003", (kernel_ulong_t)&adaq4003_chip_info },
691 MODULE_DEVICE_TABLE(spi, ad4000_id);
693 static const struct of_device_id ad4000_of_match[] = {
694 { .compatible = "adi,ad4000", .data = &ad4000_chip_info },
695 { .compatible = "adi,ad4001", .data = &ad4001_chip_info },
696 { .compatible = "adi,ad4002", .data = &ad4002_chip_info },
697 { .compatible = "adi,ad4003", .data = &ad4003_chip_info },
698 { .compatible = "adi,ad4004", .data = &ad4004_chip_info },
699 { .compatible = "adi,ad4005", .data = &ad4005_chip_info },
700 { .compatible = "adi,ad4006", .data = &ad4006_chip_info },
701 { .compatible = "adi,ad4007", .data = &ad4007_chip_info },
702 { .compatible = "adi,ad4008", .data = &ad4008_chip_info },
703 { .compatible = "adi,ad4010", .data = &ad4010_chip_info },
704 { .compatible = "adi,ad4011", .data = &ad4011_chip_info },
705 { .compatible = "adi,ad4020", .data = &ad4020_chip_info },
706 { .compatible = "adi,ad4021", .data = &ad4021_chip_info },
707 { .compatible = "adi,ad4022", .data = &ad4022_chip_info },
708 { .compatible = "adi,adaq4001", .data = &adaq4001_chip_info },
709 { .compatible = "adi,adaq4003", .data = &adaq4003_chip_info },
712 MODULE_DEVICE_TABLE(of, ad4000_of_match);
714 static struct spi_driver ad4000_driver = {
717 .of_match_table = ad4000_of_match,
719 .probe = ad4000_probe,
720 .id_table = ad4000_id,
722 module_spi_driver(ad4000_driver);
725 MODULE_DESCRIPTION("Analog Devices AD4000 ADC driver");
726 MODULE_LICENSE("GPL");