3 * Copyright (C) 2010-2011 Michael Hennerich, Analog Devices Inc.
5 * based on iio/adc/max1363
6 * Copyright (C) 2008-2010 Jonathan Cameron
8 * based on linux/drivers/i2c/chips/max123x
9 * Copyright (C) 2002-2004 Stefan Eletzhofer
11 * based on linux/drivers/acron/char/pcf8583.c
12 * Copyright (C) 2000 Russell King
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
20 * Support for ad7991, ad7995, ad7999, ad7992, ad7993, ad7994, ad7997,
21 * ad7998 and similar chips.
25 #include <linux/interrupt.h>
26 #include <linux/device.h>
27 #include <linux/kernel.h>
28 #include <linux/sysfs.h>
29 #include <linux/i2c.h>
30 #include <linux/regulator/consumer.h>
31 #include <linux/slab.h>
32 #include <linux/types.h>
33 #include <linux/err.h>
34 #include <linux/module.h>
35 #include <linux/bitops.h>
37 #include <linux/iio/iio.h>
38 #include <linux/iio/sysfs.h>
39 #include <linux/iio/events.h>
40 #include <linux/iio/buffer.h>
41 #include <linux/iio/trigger_consumer.h>
42 #include <linux/iio/triggered_buffer.h>
44 #define AD799X_CHANNEL_SHIFT 4
47 * AD7991, AD7995 and AD7999 defines
50 #define AD7991_REF_SEL 0x08
51 #define AD7991_FLTR 0x04
52 #define AD7991_BIT_TRIAL_DELAY 0x02
53 #define AD7991_SAMPLE_DELAY 0x01
56 * AD7992, AD7993, AD7994, AD7997 and AD7998 defines
59 #define AD7998_FLTR BIT(3)
60 #define AD7998_ALERT_EN BIT(2)
61 #define AD7998_BUSY_ALERT BIT(1)
62 #define AD7998_BUSY_ALERT_POL BIT(0)
64 #define AD7998_CONV_RES_REG 0x0
65 #define AD7998_ALERT_STAT_REG 0x1
66 #define AD7998_CONF_REG 0x2
67 #define AD7998_CYCLE_TMR_REG 0x3
69 #define AD7998_DATALOW_REG(x) ((x) * 3 + 0x4)
70 #define AD7998_DATAHIGH_REG(x) ((x) * 3 + 0x5)
71 #define AD7998_HYST_REG(x) ((x) * 3 + 0x6)
73 #define AD7998_CYC_MASK GENMASK(2, 0)
74 #define AD7998_CYC_DIS 0x0
75 #define AD7998_CYC_TCONF_32 0x1
76 #define AD7998_CYC_TCONF_64 0x2
77 #define AD7998_CYC_TCONF_128 0x3
78 #define AD7998_CYC_TCONF_256 0x4
79 #define AD7998_CYC_TCONF_512 0x5
80 #define AD7998_CYC_TCONF_1024 0x6
81 #define AD7998_CYC_TCONF_2048 0x7
83 #define AD7998_ALERT_STAT_CLEAR 0xFF
86 * AD7997 and AD7997 defines
89 #define AD7997_8_READ_SINGLE BIT(7)
90 #define AD7997_8_READ_SEQUENCE (BIT(6) | BIT(5) | BIT(4))
104 * struct ad799x_chip_config - chip specific information
105 * @channel: channel specification
106 * @default_config: device default configuration
107 * @info: pointer to iio_info struct
109 struct ad799x_chip_config {
110 const struct iio_chan_spec channel[9];
112 const struct iio_info *info;
116 * struct ad799x_chip_info - chip specific information
117 * @num_channels: number of channels
118 * @noirq_config: device configuration w/o IRQ
119 * @irq_config: device configuration w/IRQ
121 struct ad799x_chip_info {
123 const struct ad799x_chip_config noirq_config;
124 const struct ad799x_chip_config irq_config;
127 struct ad799x_state {
128 struct i2c_client *client;
129 const struct ad799x_chip_config *chip_config;
130 struct regulator *reg;
131 struct regulator *vref;
136 unsigned int transfer_size;
139 static int ad799x_write_config(struct ad799x_state *st, u16 val)
144 return i2c_smbus_write_word_swapped(st->client, AD7998_CONF_REG,
149 return i2c_smbus_write_byte_data(st->client, AD7998_CONF_REG,
152 /* Will be written when doing a conversion */
158 static int ad799x_read_config(struct ad799x_state *st)
163 return i2c_smbus_read_word_swapped(st->client, AD7998_CONF_REG);
167 return i2c_smbus_read_byte_data(st->client, AD7998_CONF_REG);
169 /* No readback support */
175 * ad799x_trigger_handler() bh of trigger launched polling to ring buffer
177 * Currently there is no option in this driver to disable the saving of
178 * timestamps within the ring.
180 static irqreturn_t ad799x_trigger_handler(int irq, void *p)
182 struct iio_poll_func *pf = p;
183 struct iio_dev *indio_dev = pf->indio_dev;
184 struct ad799x_state *st = iio_priv(indio_dev);
193 (*indio_dev->active_scan_mask << AD799X_CHANNEL_SHIFT);
198 cmd = (*indio_dev->active_scan_mask << AD799X_CHANNEL_SHIFT) |
203 cmd = AD7997_8_READ_SEQUENCE | AD7998_CONV_RES_REG;
209 b_sent = i2c_smbus_read_i2c_block_data(st->client,
210 cmd, st->transfer_size, st->rx_buf);
214 iio_push_to_buffers_with_timestamp(indio_dev, st->rx_buf,
215 iio_get_time_ns(indio_dev));
217 iio_trigger_notify_done(indio_dev->trig);
222 static int ad799x_update_scan_mode(struct iio_dev *indio_dev,
223 const unsigned long *scan_mask)
225 struct ad799x_state *st = iio_priv(indio_dev);
228 st->rx_buf = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
232 st->transfer_size = bitmap_weight(scan_mask, indio_dev->masklength) * 2;
240 st->config &= ~(GENMASK(7, 0) << AD799X_CHANNEL_SHIFT);
241 st->config |= (*scan_mask << AD799X_CHANNEL_SHIFT);
242 return ad799x_write_config(st, st->config);
248 static int ad799x_scan_direct(struct ad799x_state *st, unsigned ch)
256 cmd = st->config | (BIT(ch) << AD799X_CHANNEL_SHIFT);
261 cmd = BIT(ch) << AD799X_CHANNEL_SHIFT;
265 cmd = (ch << AD799X_CHANNEL_SHIFT) | AD7997_8_READ_SINGLE;
271 return i2c_smbus_read_word_swapped(st->client, cmd);
274 static int ad799x_read_raw(struct iio_dev *indio_dev,
275 struct iio_chan_spec const *chan,
281 struct ad799x_state *st = iio_priv(indio_dev);
284 case IIO_CHAN_INFO_RAW:
285 ret = iio_device_claim_direct_mode(indio_dev);
288 ret = ad799x_scan_direct(st, chan->scan_index);
289 iio_device_release_direct_mode(indio_dev);
293 *val = (ret >> chan->scan_type.shift) &
294 GENMASK(chan->scan_type.realbits - 1, 0);
296 case IIO_CHAN_INFO_SCALE:
297 ret = regulator_get_voltage(st->vref);
301 *val2 = chan->scan_type.realbits;
302 return IIO_VAL_FRACTIONAL_LOG2;
306 static const unsigned int ad7998_frequencies[] = {
307 [AD7998_CYC_DIS] = 0,
308 [AD7998_CYC_TCONF_32] = 15625,
309 [AD7998_CYC_TCONF_64] = 7812,
310 [AD7998_CYC_TCONF_128] = 3906,
311 [AD7998_CYC_TCONF_512] = 976,
312 [AD7998_CYC_TCONF_1024] = 488,
313 [AD7998_CYC_TCONF_2048] = 244,
316 static ssize_t ad799x_read_frequency(struct device *dev,
317 struct device_attribute *attr,
320 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
321 struct ad799x_state *st = iio_priv(indio_dev);
323 int ret = i2c_smbus_read_byte_data(st->client, AD7998_CYCLE_TMR_REG);
327 return sprintf(buf, "%u\n", ad7998_frequencies[ret & AD7998_CYC_MASK]);
330 static ssize_t ad799x_write_frequency(struct device *dev,
331 struct device_attribute *attr,
335 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
336 struct ad799x_state *st = iio_priv(indio_dev);
341 ret = kstrtol(buf, 10, &val);
345 mutex_lock(&indio_dev->mlock);
346 ret = i2c_smbus_read_byte_data(st->client, AD7998_CYCLE_TMR_REG);
348 goto error_ret_mutex;
349 /* Wipe the bits clean */
350 ret &= ~AD7998_CYC_MASK;
352 for (i = 0; i < ARRAY_SIZE(ad7998_frequencies); i++)
353 if (val == ad7998_frequencies[i])
355 if (i == ARRAY_SIZE(ad7998_frequencies)) {
357 goto error_ret_mutex;
360 ret = i2c_smbus_write_byte_data(st->client, AD7998_CYCLE_TMR_REG,
363 goto error_ret_mutex;
367 mutex_unlock(&indio_dev->mlock);
372 static int ad799x_read_event_config(struct iio_dev *indio_dev,
373 const struct iio_chan_spec *chan,
374 enum iio_event_type type,
375 enum iio_event_direction dir)
377 struct ad799x_state *st = iio_priv(indio_dev);
379 if (!(st->config & AD7998_ALERT_EN))
382 if ((st->config >> AD799X_CHANNEL_SHIFT) & BIT(chan->scan_index))
388 static int ad799x_write_event_config(struct iio_dev *indio_dev,
389 const struct iio_chan_spec *chan,
390 enum iio_event_type type,
391 enum iio_event_direction dir,
394 struct ad799x_state *st = iio_priv(indio_dev);
397 ret = iio_device_claim_direct_mode(indio_dev);
402 st->config |= BIT(chan->scan_index) << AD799X_CHANNEL_SHIFT;
404 st->config &= ~(BIT(chan->scan_index) << AD799X_CHANNEL_SHIFT);
406 if (st->config >> AD799X_CHANNEL_SHIFT)
407 st->config |= AD7998_ALERT_EN;
409 st->config &= ~AD7998_ALERT_EN;
411 ret = ad799x_write_config(st, st->config);
412 iio_device_release_direct_mode(indio_dev);
416 static unsigned int ad799x_threshold_reg(const struct iio_chan_spec *chan,
417 enum iio_event_direction dir,
418 enum iio_event_info info)
421 case IIO_EV_INFO_VALUE:
422 if (dir == IIO_EV_DIR_FALLING)
423 return AD7998_DATALOW_REG(chan->channel);
425 return AD7998_DATAHIGH_REG(chan->channel);
426 case IIO_EV_INFO_HYSTERESIS:
427 return AD7998_HYST_REG(chan->channel);
435 static int ad799x_write_event_value(struct iio_dev *indio_dev,
436 const struct iio_chan_spec *chan,
437 enum iio_event_type type,
438 enum iio_event_direction dir,
439 enum iio_event_info info,
443 struct ad799x_state *st = iio_priv(indio_dev);
445 if (val < 0 || val > GENMASK(chan->scan_type.realbits - 1, 0))
448 mutex_lock(&indio_dev->mlock);
449 ret = i2c_smbus_write_word_swapped(st->client,
450 ad799x_threshold_reg(chan, dir, info),
451 val << chan->scan_type.shift);
452 mutex_unlock(&indio_dev->mlock);
457 static int ad799x_read_event_value(struct iio_dev *indio_dev,
458 const struct iio_chan_spec *chan,
459 enum iio_event_type type,
460 enum iio_event_direction dir,
461 enum iio_event_info info,
465 struct ad799x_state *st = iio_priv(indio_dev);
467 mutex_lock(&indio_dev->mlock);
468 ret = i2c_smbus_read_word_swapped(st->client,
469 ad799x_threshold_reg(chan, dir, info));
470 mutex_unlock(&indio_dev->mlock);
473 *val = (ret >> chan->scan_type.shift) &
474 GENMASK(chan->scan_type.realbits - 1, 0);
479 static irqreturn_t ad799x_event_handler(int irq, void *private)
481 struct iio_dev *indio_dev = private;
482 struct ad799x_state *st = iio_priv(private);
485 ret = i2c_smbus_read_byte_data(st->client, AD7998_ALERT_STAT_REG);
489 if (i2c_smbus_write_byte_data(st->client, AD7998_ALERT_STAT_REG,
490 AD7998_ALERT_STAT_CLEAR) < 0)
493 for (i = 0; i < 8; i++) {
495 iio_push_event(indio_dev,
497 IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE,
501 IIO_UNMOD_EVENT_CODE(IIO_VOLTAGE,
505 iio_get_time_ns(indio_dev));
512 static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO,
513 ad799x_read_frequency,
514 ad799x_write_frequency);
515 static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("15625 7812 3906 1953 976 488 244 0");
517 static struct attribute *ad799x_event_attributes[] = {
518 &iio_dev_attr_sampling_frequency.dev_attr.attr,
519 &iio_const_attr_sampling_frequency_available.dev_attr.attr,
523 static struct attribute_group ad799x_event_attrs_group = {
524 .attrs = ad799x_event_attributes,
527 static const struct iio_info ad7991_info = {
528 .read_raw = &ad799x_read_raw,
529 .driver_module = THIS_MODULE,
532 static const struct iio_info ad7993_4_7_8_noirq_info = {
533 .read_raw = &ad799x_read_raw,
534 .driver_module = THIS_MODULE,
535 .update_scan_mode = ad799x_update_scan_mode,
538 static const struct iio_info ad7993_4_7_8_irq_info = {
539 .read_raw = &ad799x_read_raw,
540 .event_attrs = &ad799x_event_attrs_group,
541 .read_event_config = &ad799x_read_event_config,
542 .write_event_config = &ad799x_write_event_config,
543 .read_event_value = &ad799x_read_event_value,
544 .write_event_value = &ad799x_write_event_value,
545 .driver_module = THIS_MODULE,
546 .update_scan_mode = ad799x_update_scan_mode,
549 static const struct iio_event_spec ad799x_events[] = {
551 .type = IIO_EV_TYPE_THRESH,
552 .dir = IIO_EV_DIR_RISING,
553 .mask_separate = BIT(IIO_EV_INFO_VALUE) |
554 BIT(IIO_EV_INFO_ENABLE),
556 .type = IIO_EV_TYPE_THRESH,
557 .dir = IIO_EV_DIR_FALLING,
558 .mask_separate = BIT(IIO_EV_INFO_VALUE) |
559 BIT(IIO_EV_INFO_ENABLE),
561 .type = IIO_EV_TYPE_THRESH,
562 .dir = IIO_EV_DIR_EITHER,
563 .mask_separate = BIT(IIO_EV_INFO_HYSTERESIS),
567 #define _AD799X_CHANNEL(_index, _realbits, _ev_spec, _num_ev_spec) { \
568 .type = IIO_VOLTAGE, \
570 .channel = (_index), \
571 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
572 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
573 .scan_index = (_index), \
576 .realbits = (_realbits), \
578 .shift = 12 - (_realbits), \
579 .endianness = IIO_BE, \
581 .event_spec = _ev_spec, \
582 .num_event_specs = _num_ev_spec, \
585 #define AD799X_CHANNEL(_index, _realbits) \
586 _AD799X_CHANNEL(_index, _realbits, NULL, 0)
588 #define AD799X_CHANNEL_WITH_EVENTS(_index, _realbits) \
589 _AD799X_CHANNEL(_index, _realbits, ad799x_events, \
590 ARRAY_SIZE(ad799x_events))
592 static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
597 AD799X_CHANNEL(0, 12),
598 AD799X_CHANNEL(1, 12),
599 AD799X_CHANNEL(2, 12),
600 AD799X_CHANNEL(3, 12),
601 IIO_CHAN_SOFT_TIMESTAMP(4),
603 .info = &ad7991_info,
610 AD799X_CHANNEL(0, 10),
611 AD799X_CHANNEL(1, 10),
612 AD799X_CHANNEL(2, 10),
613 AD799X_CHANNEL(3, 10),
614 IIO_CHAN_SOFT_TIMESTAMP(4),
616 .info = &ad7991_info,
623 AD799X_CHANNEL(0, 8),
624 AD799X_CHANNEL(1, 8),
625 AD799X_CHANNEL(2, 8),
626 AD799X_CHANNEL(3, 8),
627 IIO_CHAN_SOFT_TIMESTAMP(4),
629 .info = &ad7991_info,
636 AD799X_CHANNEL(0, 12),
637 AD799X_CHANNEL(1, 12),
638 IIO_CHAN_SOFT_TIMESTAMP(3),
640 .info = &ad7993_4_7_8_noirq_info,
644 AD799X_CHANNEL_WITH_EVENTS(0, 12),
645 AD799X_CHANNEL_WITH_EVENTS(1, 12),
646 IIO_CHAN_SOFT_TIMESTAMP(3),
648 .default_config = AD7998_ALERT_EN | AD7998_BUSY_ALERT,
649 .info = &ad7993_4_7_8_irq_info,
656 AD799X_CHANNEL(0, 10),
657 AD799X_CHANNEL(1, 10),
658 AD799X_CHANNEL(2, 10),
659 AD799X_CHANNEL(3, 10),
660 IIO_CHAN_SOFT_TIMESTAMP(4),
662 .info = &ad7993_4_7_8_noirq_info,
666 AD799X_CHANNEL_WITH_EVENTS(0, 10),
667 AD799X_CHANNEL_WITH_EVENTS(1, 10),
668 AD799X_CHANNEL_WITH_EVENTS(2, 10),
669 AD799X_CHANNEL_WITH_EVENTS(3, 10),
670 IIO_CHAN_SOFT_TIMESTAMP(4),
672 .default_config = AD7998_ALERT_EN | AD7998_BUSY_ALERT,
673 .info = &ad7993_4_7_8_irq_info,
680 AD799X_CHANNEL(0, 12),
681 AD799X_CHANNEL(1, 12),
682 AD799X_CHANNEL(2, 12),
683 AD799X_CHANNEL(3, 12),
684 IIO_CHAN_SOFT_TIMESTAMP(4),
686 .info = &ad7993_4_7_8_noirq_info,
690 AD799X_CHANNEL_WITH_EVENTS(0, 12),
691 AD799X_CHANNEL_WITH_EVENTS(1, 12),
692 AD799X_CHANNEL_WITH_EVENTS(2, 12),
693 AD799X_CHANNEL_WITH_EVENTS(3, 12),
694 IIO_CHAN_SOFT_TIMESTAMP(4),
696 .default_config = AD7998_ALERT_EN | AD7998_BUSY_ALERT,
697 .info = &ad7993_4_7_8_irq_info,
704 AD799X_CHANNEL(0, 10),
705 AD799X_CHANNEL(1, 10),
706 AD799X_CHANNEL(2, 10),
707 AD799X_CHANNEL(3, 10),
708 AD799X_CHANNEL(4, 10),
709 AD799X_CHANNEL(5, 10),
710 AD799X_CHANNEL(6, 10),
711 AD799X_CHANNEL(7, 10),
712 IIO_CHAN_SOFT_TIMESTAMP(8),
714 .info = &ad7993_4_7_8_noirq_info,
718 AD799X_CHANNEL_WITH_EVENTS(0, 10),
719 AD799X_CHANNEL_WITH_EVENTS(1, 10),
720 AD799X_CHANNEL_WITH_EVENTS(2, 10),
721 AD799X_CHANNEL_WITH_EVENTS(3, 10),
722 AD799X_CHANNEL(4, 10),
723 AD799X_CHANNEL(5, 10),
724 AD799X_CHANNEL(6, 10),
725 AD799X_CHANNEL(7, 10),
726 IIO_CHAN_SOFT_TIMESTAMP(8),
728 .default_config = AD7998_ALERT_EN | AD7998_BUSY_ALERT,
729 .info = &ad7993_4_7_8_irq_info,
736 AD799X_CHANNEL(0, 12),
737 AD799X_CHANNEL(1, 12),
738 AD799X_CHANNEL(2, 12),
739 AD799X_CHANNEL(3, 12),
740 AD799X_CHANNEL(4, 12),
741 AD799X_CHANNEL(5, 12),
742 AD799X_CHANNEL(6, 12),
743 AD799X_CHANNEL(7, 12),
744 IIO_CHAN_SOFT_TIMESTAMP(8),
746 .info = &ad7993_4_7_8_noirq_info,
750 AD799X_CHANNEL_WITH_EVENTS(0, 12),
751 AD799X_CHANNEL_WITH_EVENTS(1, 12),
752 AD799X_CHANNEL_WITH_EVENTS(2, 12),
753 AD799X_CHANNEL_WITH_EVENTS(3, 12),
754 AD799X_CHANNEL(4, 12),
755 AD799X_CHANNEL(5, 12),
756 AD799X_CHANNEL(6, 12),
757 AD799X_CHANNEL(7, 12),
758 IIO_CHAN_SOFT_TIMESTAMP(8),
760 .default_config = AD7998_ALERT_EN | AD7998_BUSY_ALERT,
761 .info = &ad7993_4_7_8_irq_info,
766 static int ad799x_probe(struct i2c_client *client,
767 const struct i2c_device_id *id)
770 struct ad799x_state *st;
771 struct iio_dev *indio_dev;
772 const struct ad799x_chip_info *chip_info =
773 &ad799x_chip_info_tbl[id->driver_data];
775 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*st));
776 if (indio_dev == NULL)
779 st = iio_priv(indio_dev);
780 /* this is only used for device removal purposes */
781 i2c_set_clientdata(client, indio_dev);
783 st->id = id->driver_data;
784 if (client->irq > 0 && chip_info->irq_config.info)
785 st->chip_config = &chip_info->irq_config;
787 st->chip_config = &chip_info->noirq_config;
789 /* TODO: Add pdata options for filtering and bit delay */
791 st->reg = devm_regulator_get(&client->dev, "vcc");
793 return PTR_ERR(st->reg);
794 ret = regulator_enable(st->reg);
797 st->vref = devm_regulator_get(&client->dev, "vref");
798 if (IS_ERR(st->vref)) {
799 ret = PTR_ERR(st->vref);
800 goto error_disable_reg;
802 ret = regulator_enable(st->vref);
804 goto error_disable_reg;
808 indio_dev->dev.parent = &client->dev;
809 indio_dev->dev.of_node = client->dev.of_node;
810 indio_dev->name = id->name;
811 indio_dev->info = st->chip_config->info;
813 indio_dev->modes = INDIO_DIRECT_MODE;
814 indio_dev->channels = st->chip_config->channel;
815 indio_dev->num_channels = chip_info->num_channels;
817 ret = ad799x_write_config(st, st->chip_config->default_config);
819 goto error_disable_reg;
820 ret = ad799x_read_config(st);
822 goto error_disable_reg;
825 ret = iio_triggered_buffer_setup(indio_dev, NULL,
826 &ad799x_trigger_handler, NULL);
828 goto error_disable_vref;
830 if (client->irq > 0) {
831 ret = devm_request_threaded_irq(&client->dev,
834 ad799x_event_handler,
835 IRQF_TRIGGER_FALLING |
840 goto error_cleanup_ring;
842 ret = iio_device_register(indio_dev);
844 goto error_cleanup_ring;
849 iio_triggered_buffer_cleanup(indio_dev);
851 regulator_disable(st->vref);
853 regulator_disable(st->reg);
858 static int ad799x_remove(struct i2c_client *client)
860 struct iio_dev *indio_dev = i2c_get_clientdata(client);
861 struct ad799x_state *st = iio_priv(indio_dev);
863 iio_device_unregister(indio_dev);
865 iio_triggered_buffer_cleanup(indio_dev);
866 regulator_disable(st->vref);
867 regulator_disable(st->reg);
873 static const struct i2c_device_id ad799x_id[] = {
874 { "ad7991", ad7991 },
875 { "ad7995", ad7995 },
876 { "ad7999", ad7999 },
877 { "ad7992", ad7992 },
878 { "ad7993", ad7993 },
879 { "ad7994", ad7994 },
880 { "ad7997", ad7997 },
881 { "ad7998", ad7998 },
885 MODULE_DEVICE_TABLE(i2c, ad799x_id);
887 static struct i2c_driver ad799x_driver = {
891 .probe = ad799x_probe,
892 .remove = ad799x_remove,
893 .id_table = ad799x_id,
895 module_i2c_driver(ad799x_driver);
897 MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
898 MODULE_DESCRIPTION("Analog Devices AD799x ADC");
899 MODULE_LICENSE("GPL v2");