2 * ADT7410 digital temperature sensor driver supporting ADT7410
4 * Copyright 2010 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
9 #include <linux/interrupt.h>
10 #include <linux/gpio.h>
11 #include <linux/workqueue.h>
12 #include <linux/device.h>
13 #include <linux/kernel.h>
14 #include <linux/slab.h>
15 #include <linux/sysfs.h>
16 #include <linux/list.h>
17 #include <linux/i2c.h>
18 #include <linux/rtc.h>
24 * ADT7410 registers definition
27 #define ADT7410_TEMPERATURE 0
28 #define ADT7410_STATUS 2
29 #define ADT7410_CONFIG 3
30 #define ADT7410_T_ALARM_HIGH 4
31 #define ADT7410_T_ALARM_LOW 6
32 #define ADT7410_T_CRIT 8
33 #define ADT7410_T_HYST 0xA
34 #define ADT7410_ID 0xB
35 #define ADT7410_RESET 0x2F
40 #define ADT7410_STAT_T_LOW 0x10
41 #define ADT7410_STAT_T_HIGH 0x20
42 #define ADT7410_STAT_T_CRIT 0x40
43 #define ADT7410_STAT_NOT_RDY 0x80
48 #define ADT7410_FAULT_QUEUE_MASK 0x3
49 #define ADT7410_CT_POLARITY 0x4
50 #define ADT7410_INT_POLARITY 0x8
51 #define ADT7410_EVENT_MODE 0x10
52 #define ADT7410_MODE_MASK 0x60
53 #define ADT7410_ONESHOT 0x20
54 #define ADT7410_SPS 0x40
55 #define ADT7410_PD 0x60
56 #define ADT7410_RESOLUTION 0x80
61 #define ADT7410_T16_VALUE_SIGN 0x8000
62 #define ADT7410_T16_VALUE_FLOAT_OFFSET 7
63 #define ADT7410_T16_VALUE_FLOAT_MASK 0x7F
64 #define ADT7410_T13_VALUE_SIGN 0x1000
65 #define ADT7410_T13_VALUE_OFFSET 3
66 #define ADT7410_T13_VALUE_FLOAT_OFFSET 4
67 #define ADT7410_T13_VALUE_FLOAT_MASK 0xF
68 #define ADT7410_T_HYST_MASK 0xF
69 #define ADT7410_DEVICE_ID_MASK 0xF
70 #define ADT7410_MANUFACTORY_ID_MASK 0xF0
71 #define ADT7410_MANUFACTORY_ID_OFFSET 4
73 #define ADT7410_IRQS 2
76 * struct adt7410_chip_info - chip specifc information
79 struct adt7410_chip_info {
81 struct i2c_client *client;
82 struct iio_dev *indio_dev;
83 struct work_struct thresh_work;
89 * adt7410 register access by I2C
92 static int adt7410_i2c_read_word(struct adt7410_chip_info *chip, u8 reg, u16 *data)
94 struct i2c_client *client = chip->client;
97 ret = i2c_smbus_read_word_data(client, reg);
99 dev_err(&client->dev, "I2C read error\n");
103 *data = swab16((u16)ret);
108 static int adt7410_i2c_write_word(struct adt7410_chip_info *chip, u8 reg, u16 data)
110 struct i2c_client *client = chip->client;
113 ret = i2c_smbus_write_word_data(client, reg, swab16(data));
115 dev_err(&client->dev, "I2C write error\n");
120 static int adt7410_i2c_read_byte(struct adt7410_chip_info *chip, u8 reg, u8 *data)
122 struct i2c_client *client = chip->client;
125 ret = i2c_smbus_read_byte_data(client, reg);
127 dev_err(&client->dev, "I2C read error\n");
136 static int adt7410_i2c_write_byte(struct adt7410_chip_info *chip, u8 reg, u8 data)
138 struct i2c_client *client = chip->client;
141 ret = i2c_smbus_write_byte_data(client, reg, data);
143 dev_err(&client->dev, "I2C write error\n");
148 static ssize_t adt7410_show_mode(struct device *dev,
149 struct device_attribute *attr,
152 struct iio_dev *dev_info = dev_get_drvdata(dev);
153 struct adt7410_chip_info *chip = dev_info->dev_data;
156 config = chip->config & ADT7410_MODE_MASK;
160 return sprintf(buf, "power-down\n");
161 case ADT7410_ONESHOT:
162 return sprintf(buf, "one-shot\n");
164 return sprintf(buf, "sps\n");
166 return sprintf(buf, "full\n");
170 static ssize_t adt7410_store_mode(struct device *dev,
171 struct device_attribute *attr,
175 struct iio_dev *dev_info = dev_get_drvdata(dev);
176 struct adt7410_chip_info *chip = dev_info->dev_data;
180 ret = adt7410_i2c_read_byte(chip, ADT7410_CONFIG, &chip->config);
184 config = chip->config & (~ADT7410_MODE_MASK);
185 if (strcmp(buf, "power-down"))
186 config |= ADT7410_PD;
187 else if (strcmp(buf, "one-shot"))
188 config |= ADT7410_ONESHOT;
189 else if (strcmp(buf, "sps"))
190 config |= ADT7410_SPS;
192 ret = adt7410_i2c_write_byte(chip, ADT7410_CONFIG, config);
196 chip->config = config;
201 static IIO_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR,
206 static ssize_t adt7410_show_available_modes(struct device *dev,
207 struct device_attribute *attr,
210 return sprintf(buf, "full\none-shot\nsps\npower-down\n");
213 static IIO_DEVICE_ATTR(available_modes, S_IRUGO, adt7410_show_available_modes, NULL, 0);
215 static ssize_t adt7410_show_resolution(struct device *dev,
216 struct device_attribute *attr,
219 struct iio_dev *dev_info = dev_get_drvdata(dev);
220 struct adt7410_chip_info *chip = dev_info->dev_data;
224 ret = adt7410_i2c_read_byte(chip, ADT7410_CONFIG, &chip->config);
228 if (chip->config & ADT7410_RESOLUTION)
233 return sprintf(buf, "%d bits\n", bits);
236 static ssize_t adt7410_store_resolution(struct device *dev,
237 struct device_attribute *attr,
241 struct iio_dev *dev_info = dev_get_drvdata(dev);
242 struct adt7410_chip_info *chip = dev_info->dev_data;
247 ret = strict_strtoul(buf, 10, &data);
251 ret = adt7410_i2c_read_byte(chip, ADT7410_CONFIG, &chip->config);
255 config = chip->config & (~ADT7410_RESOLUTION);
257 config |= ADT7410_RESOLUTION;
259 ret = adt7410_i2c_write_byte(chip, ADT7410_CONFIG, config);
263 chip->config = config;
268 static IIO_DEVICE_ATTR(resolution, S_IRUGO | S_IWUSR,
269 adt7410_show_resolution,
270 adt7410_store_resolution,
273 static ssize_t adt7410_show_id(struct device *dev,
274 struct device_attribute *attr,
277 struct iio_dev *dev_info = dev_get_drvdata(dev);
278 struct adt7410_chip_info *chip = dev_info->dev_data;
282 ret = adt7410_i2c_read_byte(chip, ADT7410_ID, &id);
286 return sprintf(buf, "device id: 0x%x\nmanufactory id: 0x%x\n",
287 id & ADT7410_DEVICE_ID_MASK,
288 (id & ADT7410_MANUFACTORY_ID_MASK) >> ADT7410_MANUFACTORY_ID_OFFSET);
291 static IIO_DEVICE_ATTR(id, S_IRUGO | S_IWUSR,
296 static ssize_t adt7410_convert_temperature(struct adt7410_chip_info *chip,
301 if (chip->config & ADT7410_RESOLUTION) {
302 if (data & ADT7410_T16_VALUE_SIGN) {
303 /* convert supplement to positive value */
304 data = (u16)((ADT7410_T16_VALUE_SIGN << 1) - (u32)data);
307 return sprintf(buf, "%c%d.%.7d\n", sign,
308 (data >> ADT7410_T16_VALUE_FLOAT_OFFSET),
309 (data & ADT7410_T16_VALUE_FLOAT_MASK) * 78125);
311 if (data & ADT7410_T13_VALUE_SIGN) {
312 /* convert supplement to positive value */
313 data >>= ADT7410_T13_VALUE_OFFSET;
314 data = (ADT7410_T13_VALUE_SIGN << 1) - data;
317 return sprintf(buf, "%c%d.%.4d\n", sign,
318 (data >> ADT7410_T13_VALUE_FLOAT_OFFSET),
319 (data & ADT7410_T13_VALUE_FLOAT_MASK) * 625);
323 static ssize_t adt7410_show_value(struct device *dev,
324 struct device_attribute *attr,
327 struct iio_dev *dev_info = dev_get_drvdata(dev);
328 struct adt7410_chip_info *chip = dev_info->dev_data;
334 ret = adt7410_i2c_read_byte(chip, ADT7410_STATUS, &status);
340 } while (status & ADT7410_STAT_NOT_RDY);
342 ret = adt7410_i2c_read_word(chip, ADT7410_TEMPERATURE, &data);
346 return adt7410_convert_temperature(chip, data, buf);
349 static IIO_DEVICE_ATTR(value, S_IRUGO, adt7410_show_value, NULL, 0);
351 static ssize_t adt7410_show_name(struct device *dev,
352 struct device_attribute *attr,
355 struct iio_dev *dev_info = dev_get_drvdata(dev);
356 struct adt7410_chip_info *chip = dev_info->dev_data;
357 return sprintf(buf, "%s\n", chip->name);
360 static IIO_DEVICE_ATTR(name, S_IRUGO, adt7410_show_name, NULL, 0);
362 static struct attribute *adt7410_attributes[] = {
363 &iio_dev_attr_available_modes.dev_attr.attr,
364 &iio_dev_attr_mode.dev_attr.attr,
365 &iio_dev_attr_resolution.dev_attr.attr,
366 &iio_dev_attr_id.dev_attr.attr,
367 &iio_dev_attr_value.dev_attr.attr,
368 &iio_dev_attr_name.dev_attr.attr,
372 static const struct attribute_group adt7410_attribute_group = {
373 .attrs = adt7410_attributes,
377 * temperature bound events
380 #define IIO_EVENT_CODE_ADT7410_ABOVE_ALARM IIO_BUFFER_EVENT_CODE(0)
381 #define IIO_EVENT_CODE_ADT7410_BELLOW_ALARM IIO_BUFFER_EVENT_CODE(1)
382 #define IIO_EVENT_CODE_ADT7410_ABOVE_CRIT IIO_BUFFER_EVENT_CODE(2)
384 static void adt7410_interrupt_bh(struct work_struct *work_s)
386 struct adt7410_chip_info *chip =
387 container_of(work_s, struct adt7410_chip_info, thresh_work);
390 if (adt7410_i2c_read_byte(chip, ADT7410_STATUS, &status))
393 enable_irq(chip->client->irq);
395 if (status & ADT7410_STAT_T_HIGH)
396 iio_push_event(chip->indio_dev, 0,
397 IIO_EVENT_CODE_ADT7410_ABOVE_ALARM,
398 chip->last_timestamp);
399 if (status & ADT7410_STAT_T_LOW)
400 iio_push_event(chip->indio_dev, 0,
401 IIO_EVENT_CODE_ADT7410_BELLOW_ALARM,
402 chip->last_timestamp);
403 if (status & ADT7410_STAT_T_CRIT)
404 iio_push_event(chip->indio_dev, 0,
405 IIO_EVENT_CODE_ADT7410_ABOVE_CRIT,
406 chip->last_timestamp);
409 static int adt7410_interrupt(struct iio_dev *dev_info,
414 struct adt7410_chip_info *chip = dev_info->dev_data;
416 chip->last_timestamp = timestamp;
417 schedule_work(&chip->thresh_work);
422 IIO_EVENT_SH(adt7410, &adt7410_interrupt);
423 IIO_EVENT_SH(adt7410_ct, &adt7410_interrupt);
425 static ssize_t adt7410_show_event_mode(struct device *dev,
426 struct device_attribute *attr,
429 struct iio_dev *dev_info = dev_get_drvdata(dev);
430 struct adt7410_chip_info *chip = dev_info->dev_data;
433 ret = adt7410_i2c_read_byte(chip, ADT7410_CONFIG, &chip->config);
437 if (chip->config & ADT7410_EVENT_MODE)
438 return sprintf(buf, "interrupt\n");
440 return sprintf(buf, "comparator\n");
443 static ssize_t adt7410_set_event_mode(struct device *dev,
444 struct device_attribute *attr,
448 struct iio_dev *dev_info = dev_get_drvdata(dev);
449 struct adt7410_chip_info *chip = dev_info->dev_data;
453 ret = adt7410_i2c_read_byte(chip, ADT7410_CONFIG, &chip->config);
457 config = chip->config &= ~ADT7410_EVENT_MODE;
458 if (strcmp(buf, "comparator") != 0)
459 config |= ADT7410_EVENT_MODE;
461 ret = adt7410_i2c_write_byte(chip, ADT7410_CONFIG, config);
465 chip->config = config;
470 static ssize_t adt7410_show_available_event_modes(struct device *dev,
471 struct device_attribute *attr,
474 return sprintf(buf, "comparator\ninterrupt\n");
477 static ssize_t adt7410_show_fault_queue(struct device *dev,
478 struct device_attribute *attr,
481 struct iio_dev *dev_info = dev_get_drvdata(dev);
482 struct adt7410_chip_info *chip = dev_info->dev_data;
485 ret = adt7410_i2c_read_byte(chip, ADT7410_CONFIG, &chip->config);
489 return sprintf(buf, "%d\n", chip->config & ADT7410_FAULT_QUEUE_MASK);
492 static ssize_t adt7410_set_fault_queue(struct device *dev,
493 struct device_attribute *attr,
497 struct iio_dev *dev_info = dev_get_drvdata(dev);
498 struct adt7410_chip_info *chip = dev_info->dev_data;
503 ret = strict_strtoul(buf, 10, &data);
507 ret = adt7410_i2c_read_byte(chip, ADT7410_CONFIG, &chip->config);
511 config = chip->config & ~ADT7410_FAULT_QUEUE_MASK;
513 ret = adt7410_i2c_write_byte(chip, ADT7410_CONFIG, config);
517 chip->config = config;
522 static inline ssize_t adt7410_show_t_bound(struct device *dev,
523 struct device_attribute *attr,
527 struct iio_dev *dev_info = dev_get_drvdata(dev);
528 struct adt7410_chip_info *chip = dev_info->dev_data;
532 ret = adt7410_i2c_read_word(chip, bound_reg, &data);
536 return adt7410_convert_temperature(chip, data, buf);
539 static inline ssize_t adt7410_set_t_bound(struct device *dev,
540 struct device_attribute *attr,
545 struct iio_dev *dev_info = dev_get_drvdata(dev);
546 struct adt7410_chip_info *chip = dev_info->dev_data;
552 pos = strchr(buf, '.');
554 ret = strict_strtol(buf, 10, &tmp1);
556 if (ret || tmp1 > 127 || tmp1 < -128)
562 if (chip->config & ADT7410_RESOLUTION) {
563 if (len > ADT7410_T16_VALUE_FLOAT_OFFSET)
564 len = ADT7410_T16_VALUE_FLOAT_OFFSET;
566 ret = strict_strtol(pos, 10, &tmp2);
569 tmp2 = (tmp2 / 78125) * 78125;
571 if (len > ADT7410_T13_VALUE_FLOAT_OFFSET)
572 len = ADT7410_T13_VALUE_FLOAT_OFFSET;
574 ret = strict_strtol(pos, 10, &tmp2);
577 tmp2 = (tmp2 / 625) * 625;
586 if (chip->config & ADT7410_RESOLUTION) {
587 data = (data << ADT7410_T16_VALUE_FLOAT_OFFSET) |
588 (tmp2 & ADT7410_T16_VALUE_FLOAT_MASK);
591 /* convert positive value to supplyment */
592 data = (u16)((ADT7410_T16_VALUE_SIGN << 1) - (u32)data);
594 data = (data << ADT7410_T13_VALUE_FLOAT_OFFSET) |
595 (tmp2 & ADT7410_T13_VALUE_FLOAT_MASK);
598 /* convert positive value to supplyment */
599 data = (ADT7410_T13_VALUE_SIGN << 1) - data;
600 data <<= ADT7410_T13_VALUE_OFFSET;
603 ret = adt7410_i2c_write_word(chip, bound_reg, data);
610 static ssize_t adt7410_show_t_alarm_high(struct device *dev,
611 struct device_attribute *attr,
614 return adt7410_show_t_bound(dev, attr,
615 ADT7410_T_ALARM_HIGH, buf);
618 static inline ssize_t adt7410_set_t_alarm_high(struct device *dev,
619 struct device_attribute *attr,
623 return adt7410_set_t_bound(dev, attr,
624 ADT7410_T_ALARM_HIGH, buf, len);
627 static ssize_t adt7410_show_t_alarm_low(struct device *dev,
628 struct device_attribute *attr,
631 return adt7410_show_t_bound(dev, attr,
632 ADT7410_T_ALARM_LOW, buf);
635 static inline ssize_t adt7410_set_t_alarm_low(struct device *dev,
636 struct device_attribute *attr,
640 return adt7410_set_t_bound(dev, attr,
641 ADT7410_T_ALARM_LOW, buf, len);
644 static ssize_t adt7410_show_t_crit(struct device *dev,
645 struct device_attribute *attr,
648 return adt7410_show_t_bound(dev, attr,
649 ADT7410_T_CRIT, buf);
652 static inline ssize_t adt7410_set_t_crit(struct device *dev,
653 struct device_attribute *attr,
657 return adt7410_set_t_bound(dev, attr,
658 ADT7410_T_CRIT, buf, len);
661 static ssize_t adt7410_show_t_hyst(struct device *dev,
662 struct device_attribute *attr,
665 struct iio_dev *dev_info = dev_get_drvdata(dev);
666 struct adt7410_chip_info *chip = dev_info->dev_data;
670 ret = adt7410_i2c_read_byte(chip, ADT7410_T_HYST, &t_hyst);
674 return sprintf(buf, "%d\n", t_hyst & ADT7410_T_HYST_MASK);
677 static inline ssize_t adt7410_set_t_hyst(struct device *dev,
678 struct device_attribute *attr,
682 struct iio_dev *dev_info = dev_get_drvdata(dev);
683 struct adt7410_chip_info *chip = dev_info->dev_data;
688 ret = strict_strtol(buf, 10, &data);
690 if (ret || data > ADT7410_T_HYST_MASK)
695 ret = adt7410_i2c_write_byte(chip, ADT7410_T_HYST, t_hyst);
702 IIO_EVENT_ATTR_SH(event_mode, iio_event_adt7410,
703 adt7410_show_event_mode, adt7410_set_event_mode, 0);
704 IIO_EVENT_ATTR_SH(available_event_modes, iio_event_adt7410,
705 adt7410_show_available_event_modes, NULL, 0);
706 IIO_EVENT_ATTR_SH(fault_queue, iio_event_adt7410,
707 adt7410_show_fault_queue, adt7410_set_fault_queue, 0);
708 IIO_EVENT_ATTR_SH(t_alarm_high, iio_event_adt7410,
709 adt7410_show_t_alarm_high, adt7410_set_t_alarm_high, 0);
710 IIO_EVENT_ATTR_SH(t_alarm_low, iio_event_adt7410,
711 adt7410_show_t_alarm_low, adt7410_set_t_alarm_low, 0);
712 IIO_EVENT_ATTR_SH(t_crit, iio_event_adt7410_ct,
713 adt7410_show_t_crit, adt7410_set_t_crit, 0);
714 IIO_EVENT_ATTR_SH(t_hyst, iio_event_adt7410,
715 adt7410_show_t_hyst, adt7410_set_t_hyst, 0);
717 static struct attribute *adt7410_event_int_attributes[] = {
718 &iio_event_attr_event_mode.dev_attr.attr,
719 &iio_event_attr_available_event_modes.dev_attr.attr,
720 &iio_event_attr_fault_queue.dev_attr.attr,
721 &iio_event_attr_t_alarm_high.dev_attr.attr,
722 &iio_event_attr_t_alarm_low.dev_attr.attr,
723 &iio_event_attr_t_hyst.dev_attr.attr,
727 static struct attribute *adt7410_event_ct_attributes[] = {
728 &iio_event_attr_event_mode.dev_attr.attr,
729 &iio_event_attr_available_event_modes.dev_attr.attr,
730 &iio_event_attr_fault_queue.dev_attr.attr,
731 &iio_event_attr_t_crit.dev_attr.attr,
732 &iio_event_attr_t_hyst.dev_attr.attr,
736 static struct attribute_group adt7410_event_attribute_group[ADT7410_IRQS] = {
738 .attrs = adt7410_event_int_attributes,
741 .attrs = adt7410_event_ct_attributes,
746 * device probe and remove
749 static int __devinit adt7410_probe(struct i2c_client *client,
750 const struct i2c_device_id *id)
752 struct adt7410_chip_info *chip;
754 unsigned long *adt7410_platform_data = client->dev.platform_data;
756 chip = kzalloc(sizeof(struct adt7410_chip_info), GFP_KERNEL);
761 /* this is only used for device removal purposes */
762 i2c_set_clientdata(client, chip);
764 chip->client = client;
765 chip->name = id->name;
767 chip->indio_dev = iio_allocate_device();
768 if (chip->indio_dev == NULL) {
770 goto error_free_chip;
773 chip->indio_dev->dev.parent = &client->dev;
774 chip->indio_dev->attrs = &adt7410_attribute_group;
775 chip->indio_dev->event_attrs = adt7410_event_attribute_group;
776 chip->indio_dev->dev_data = (void *)chip;
777 chip->indio_dev->driver_module = THIS_MODULE;
778 chip->indio_dev->num_interrupt_lines = ADT7410_IRQS;
779 chip->indio_dev->modes = INDIO_DIRECT_MODE;
781 ret = iio_device_register(chip->indio_dev);
785 /* CT critcal temperature event. line 0 */
787 ret = iio_register_interrupt_line(client->irq,
793 goto error_unreg_dev;
796 * The event handler list element refer to iio_event_adt7410.
797 * All event attributes bind to the same event handler.
798 * One event handler can only be added to one event list.
800 iio_add_event_to_list(&iio_event_adt7410,
801 &chip->indio_dev->interrupts[0]->ev_list);
804 /* INT bound temperature alarm event. line 1 */
805 if (adt7410_platform_data[0]) {
806 ret = iio_register_interrupt_line(adt7410_platform_data[0],
809 adt7410_platform_data[1],
812 goto error_unreg_ct_irq;
815 * The event handler list element refer to iio_event_adt7410.
816 * All event attributes bind to the same event handler.
817 * One event handler can only be added to one event list.
819 iio_add_event_to_list(&iio_event_adt7410_ct,
820 &chip->indio_dev->interrupts[1]->ev_list);
823 if (client->irq && adt7410_platform_data[0]) {
824 INIT_WORK(&chip->thresh_work, adt7410_interrupt_bh);
826 ret = adt7410_i2c_read_byte(chip, ADT7410_CONFIG, &chip->config);
829 goto error_unreg_int_irq;
832 /* set irq polarity low level */
833 chip->config &= ~ADT7410_CT_POLARITY;
835 if (adt7410_platform_data[1] & IRQF_TRIGGER_HIGH)
836 chip->config |= ADT7410_INT_POLARITY;
838 chip->config &= ~ADT7410_INT_POLARITY;
840 ret = adt7410_i2c_write_byte(chip, ADT7410_CONFIG, chip->config);
843 goto error_unreg_int_irq;
847 dev_info(&client->dev, "%s temperature sensor registered.\n",
853 iio_unregister_interrupt_line(chip->indio_dev, 1);
855 iio_unregister_interrupt_line(chip->indio_dev, 0);
857 iio_device_unregister(chip->indio_dev);
859 iio_free_device(chip->indio_dev);
866 static int __devexit adt7410_remove(struct i2c_client *client)
868 struct adt7410_chip_info *chip = i2c_get_clientdata(client);
869 struct iio_dev *indio_dev = chip->indio_dev;
870 unsigned long *adt7410_platform_data = client->dev.platform_data;
872 if (adt7410_platform_data[0])
873 iio_unregister_interrupt_line(indio_dev, 1);
875 iio_unregister_interrupt_line(indio_dev, 0);
876 iio_device_unregister(indio_dev);
877 iio_free_device(chip->indio_dev);
883 static const struct i2c_device_id adt7410_id[] = {
888 MODULE_DEVICE_TABLE(i2c, adt7410_id);
890 static struct i2c_driver adt7410_driver = {
894 .probe = adt7410_probe,
895 .remove = __devexit_p(adt7410_remove),
896 .id_table = adt7410_id,
899 static __init int adt7410_init(void)
901 return i2c_add_driver(&adt7410_driver);
904 static __exit void adt7410_exit(void)
906 i2c_del_driver(&adt7410_driver);
910 MODULE_DESCRIPTION("Analog Devices ADT7410 digital"
911 " temperature sensor driver");
912 MODULE_LICENSE("GPL v2");
914 module_init(adt7410_init);
915 module_exit(adt7410_exit);