hwmon: (adm1025) Avoid forward declaration
[cascardo/linux.git] / drivers / hwmon / adm1025.c
1 /*
2  * adm1025.c
3  *
4  * Copyright (C) 2000       Chen-Yuan Wu <gwu@esoft.com>
5  * Copyright (C) 2003-2009  Jean Delvare <jdelvare@suse.de>
6  *
7  * The ADM1025 is a sensor chip made by Analog Devices. It reports up to 6
8  * voltages (including its own power source) and up to two temperatures
9  * (its own plus up to one external one). Voltages are scaled internally
10  * (which is not the common way) with ratios such that the nominal value
11  * of each voltage correspond to a register value of 192 (which means a
12  * resolution of about 0.5% of the nominal value). Temperature values are
13  * reported with a 1 deg resolution and a 3 deg accuracy. Complete
14  * datasheet can be obtained from Analog's website at:
15  *   http://www.onsemi.com/PowerSolutions/product.do?id=ADM1025
16  *
17  * This driver also supports the ADM1025A, which differs from the ADM1025
18  * only in that it has "open-drain VID inputs while the ADM1025 has
19  * on-chip 100k pull-ups on the VID inputs". It doesn't make any
20  * difference for us.
21  *
22  * This driver also supports the NE1619, a sensor chip made by Philips.
23  * That chip is similar to the ADM1025A, with a few differences. The only
24  * difference that matters to us is that the NE1619 has only two possible
25  * addresses while the ADM1025A has a third one. Complete datasheet can be
26  * obtained from Philips's website at:
27  *   http://www.semiconductors.philips.com/pip/NE1619DS.html
28  *
29  * Since the ADM1025 was the first chipset supported by this driver, most
30  * comments will refer to this chipset, but are actually general and
31  * concern all supported chipsets, unless mentioned otherwise.
32  *
33  * This program is free software; you can redistribute it and/or modify
34  * it under the terms of the GNU General Public License as published by
35  * the Free Software Foundation; either version 2 of the License, or
36  * (at your option) any later version.
37  *
38  * This program is distributed in the hope that it will be useful,
39  * but WITHOUT ANY WARRANTY; without even the implied warranty of
40  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
41  * GNU General Public License for more details.
42  *
43  * You should have received a copy of the GNU General Public License
44  * along with this program; if not, write to the Free Software
45  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
46  */
47
48 #include <linux/module.h>
49 #include <linux/init.h>
50 #include <linux/slab.h>
51 #include <linux/jiffies.h>
52 #include <linux/i2c.h>
53 #include <linux/hwmon.h>
54 #include <linux/hwmon-sysfs.h>
55 #include <linux/hwmon-vid.h>
56 #include <linux/err.h>
57 #include <linux/mutex.h>
58
59 /*
60  * Addresses to scan
61  * ADM1025 and ADM1025A have three possible addresses: 0x2c, 0x2d and 0x2e.
62  * NE1619 has two possible addresses: 0x2c and 0x2d.
63  */
64
65 static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
66
67 enum chips { adm1025, ne1619 };
68
69 /*
70  * The ADM1025 registers
71  */
72
73 #define ADM1025_REG_MAN_ID              0x3E
74 #define ADM1025_REG_CHIP_ID             0x3F
75 #define ADM1025_REG_CONFIG              0x40
76 #define ADM1025_REG_STATUS1             0x41
77 #define ADM1025_REG_STATUS2             0x42
78 #define ADM1025_REG_IN(nr)              (0x20 + (nr))
79 #define ADM1025_REG_IN_MAX(nr)          (0x2B + (nr) * 2)
80 #define ADM1025_REG_IN_MIN(nr)          (0x2C + (nr) * 2)
81 #define ADM1025_REG_TEMP(nr)            (0x26 + (nr))
82 #define ADM1025_REG_TEMP_HIGH(nr)       (0x37 + (nr) * 2)
83 #define ADM1025_REG_TEMP_LOW(nr)        (0x38 + (nr) * 2)
84 #define ADM1025_REG_VID                 0x47
85 #define ADM1025_REG_VID4                0x49
86
87 /*
88  * Conversions and various macros
89  * The ADM1025 uses signed 8-bit values for temperatures.
90  */
91
92 static const int in_scale[6] = { 2500, 2250, 3300, 5000, 12000, 3300 };
93
94 #define IN_FROM_REG(reg, scale) (((reg) * (scale) + 96) / 192)
95 #define IN_TO_REG(val, scale)   ((val) <= 0 ? 0 : \
96                                  (val) * 192 >= (scale) * 255 ? 255 : \
97                                  ((val) * 192 + (scale) / 2) / (scale))
98
99 #define TEMP_FROM_REG(reg)      ((reg) * 1000)
100 #define TEMP_TO_REG(val)        ((val) <= -127500 ? -128 : \
101                                  (val) >= 126500 ? 127 : \
102                                  (((val) < 0 ? (val) - 500 : \
103                                    (val) + 500) / 1000))
104
105 /*
106  * Client data (each client gets its own)
107  */
108
109 struct adm1025_data {
110         struct device *hwmon_dev;
111         struct mutex update_lock;
112         char valid; /* zero until following fields are valid */
113         unsigned long last_updated; /* in jiffies */
114
115         u8 in[6];               /* register value */
116         u8 in_max[6];           /* register value */
117         u8 in_min[6];           /* register value */
118         s8 temp[2];             /* register value */
119         s8 temp_min[2];         /* register value */
120         s8 temp_max[2];         /* register value */
121         u16 alarms;             /* register values, combined */
122         u8 vid;                 /* register values, combined */
123         u8 vrm;
124 };
125
126 static struct adm1025_data *adm1025_update_device(struct device *dev)
127 {
128         struct i2c_client *client = to_i2c_client(dev);
129         struct adm1025_data *data = i2c_get_clientdata(client);
130
131         mutex_lock(&data->update_lock);
132
133         if (time_after(jiffies, data->last_updated + HZ * 2) || !data->valid) {
134                 int i;
135
136                 dev_dbg(&client->dev, "Updating data.\n");
137                 for (i = 0; i < 6; i++) {
138                         data->in[i] = i2c_smbus_read_byte_data(client,
139                                       ADM1025_REG_IN(i));
140                         data->in_min[i] = i2c_smbus_read_byte_data(client,
141                                           ADM1025_REG_IN_MIN(i));
142                         data->in_max[i] = i2c_smbus_read_byte_data(client,
143                                           ADM1025_REG_IN_MAX(i));
144                 }
145                 for (i = 0; i < 2; i++) {
146                         data->temp[i] = i2c_smbus_read_byte_data(client,
147                                         ADM1025_REG_TEMP(i));
148                         data->temp_min[i] = i2c_smbus_read_byte_data(client,
149                                             ADM1025_REG_TEMP_LOW(i));
150                         data->temp_max[i] = i2c_smbus_read_byte_data(client,
151                                             ADM1025_REG_TEMP_HIGH(i));
152                 }
153                 data->alarms = i2c_smbus_read_byte_data(client,
154                                ADM1025_REG_STATUS1)
155                              | (i2c_smbus_read_byte_data(client,
156                                 ADM1025_REG_STATUS2) << 8);
157                 data->vid = (i2c_smbus_read_byte_data(client,
158                              ADM1025_REG_VID) & 0x0f)
159                           | ((i2c_smbus_read_byte_data(client,
160                               ADM1025_REG_VID4) & 0x01) << 4);
161
162                 data->last_updated = jiffies;
163                 data->valid = 1;
164         }
165
166         mutex_unlock(&data->update_lock);
167
168         return data;
169 }
170
171 /*
172  * Sysfs stuff
173  */
174
175 static ssize_t
176 show_in(struct device *dev, struct device_attribute *attr, char *buf)
177 {
178         int index = to_sensor_dev_attr(attr)->index;
179         struct adm1025_data *data = adm1025_update_device(dev);
180         return sprintf(buf, "%u\n", IN_FROM_REG(data->in[index],
181                        in_scale[index]));
182 }
183
184 static ssize_t
185 show_in_min(struct device *dev, struct device_attribute *attr, char *buf)
186 {
187         int index = to_sensor_dev_attr(attr)->index;
188         struct adm1025_data *data = adm1025_update_device(dev);
189         return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[index],
190                        in_scale[index]));
191 }
192
193 static ssize_t
194 show_in_max(struct device *dev, struct device_attribute *attr, char *buf)
195 {
196         int index = to_sensor_dev_attr(attr)->index;
197         struct adm1025_data *data = adm1025_update_device(dev);
198         return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[index],
199                        in_scale[index]));
200 }
201
202 static ssize_t
203 show_temp(struct device *dev, struct device_attribute *attr, char *buf)
204 {
205         int index = to_sensor_dev_attr(attr)->index;
206         struct adm1025_data *data = adm1025_update_device(dev);
207         return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[index]));
208 }
209
210 static ssize_t
211 show_temp_min(struct device *dev, struct device_attribute *attr, char *buf)
212 {
213         int index = to_sensor_dev_attr(attr)->index;
214         struct adm1025_data *data = adm1025_update_device(dev);
215         return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[index]));
216 }
217
218 static ssize_t
219 show_temp_max(struct device *dev, struct device_attribute *attr, char *buf)
220 {
221         int index = to_sensor_dev_attr(attr)->index;
222         struct adm1025_data *data = adm1025_update_device(dev);
223         return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[index]));
224 }
225
226 static ssize_t set_in_min(struct device *dev, struct device_attribute *attr,
227                           const char *buf, size_t count)
228 {
229         int index = to_sensor_dev_attr(attr)->index;
230         struct i2c_client *client = to_i2c_client(dev);
231         struct adm1025_data *data = i2c_get_clientdata(client);
232         long val;
233         int err;
234
235         err = kstrtol(buf, 10, &val);
236         if (err)
237                 return err;
238
239         mutex_lock(&data->update_lock);
240         data->in_min[index] = IN_TO_REG(val, in_scale[index]);
241         i2c_smbus_write_byte_data(client, ADM1025_REG_IN_MIN(index),
242                                   data->in_min[index]);
243         mutex_unlock(&data->update_lock);
244         return count;
245 }
246
247 static ssize_t set_in_max(struct device *dev, struct device_attribute *attr,
248                           const char *buf, size_t count)
249 {
250         int index = to_sensor_dev_attr(attr)->index;
251         struct i2c_client *client = to_i2c_client(dev);
252         struct adm1025_data *data = i2c_get_clientdata(client);
253         long val;
254         int err;
255
256         err = kstrtol(buf, 10, &val);
257         if (err)
258                 return err;
259
260         mutex_lock(&data->update_lock);
261         data->in_max[index] = IN_TO_REG(val, in_scale[index]);
262         i2c_smbus_write_byte_data(client, ADM1025_REG_IN_MAX(index),
263                                   data->in_max[index]);
264         mutex_unlock(&data->update_lock);
265         return count;
266 }
267
268 #define set_in(offset) \
269 static SENSOR_DEVICE_ATTR(in##offset##_input, S_IRUGO, \
270         show_in, NULL, offset); \
271 static SENSOR_DEVICE_ATTR(in##offset##_min, S_IWUSR | S_IRUGO, \
272         show_in_min, set_in_min, offset); \
273 static SENSOR_DEVICE_ATTR(in##offset##_max, S_IWUSR | S_IRUGO, \
274         show_in_max, set_in_max, offset)
275 set_in(0);
276 set_in(1);
277 set_in(2);
278 set_in(3);
279 set_in(4);
280 set_in(5);
281
282 static ssize_t set_temp_min(struct device *dev, struct device_attribute *attr,
283                             const char *buf, size_t count)
284 {
285         int index = to_sensor_dev_attr(attr)->index;
286         struct i2c_client *client = to_i2c_client(dev);
287         struct adm1025_data *data = i2c_get_clientdata(client);
288         long val;
289         int err;
290
291         err = kstrtol(buf, 10, &val);
292         if (err)
293                 return err;
294
295         mutex_lock(&data->update_lock);
296         data->temp_min[index] = TEMP_TO_REG(val);
297         i2c_smbus_write_byte_data(client, ADM1025_REG_TEMP_LOW(index),
298                                   data->temp_min[index]);
299         mutex_unlock(&data->update_lock);
300         return count;
301 }
302
303 static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr,
304         const char *buf, size_t count)
305 {
306         int index = to_sensor_dev_attr(attr)->index;
307         struct i2c_client *client = to_i2c_client(dev);
308         struct adm1025_data *data = i2c_get_clientdata(client);
309         long val;
310         int err;
311
312         err = kstrtol(buf, 10, &val);
313         if (err)
314                 return err;
315
316         mutex_lock(&data->update_lock);
317         data->temp_max[index] = TEMP_TO_REG(val);
318         i2c_smbus_write_byte_data(client, ADM1025_REG_TEMP_HIGH(index),
319                                   data->temp_max[index]);
320         mutex_unlock(&data->update_lock);
321         return count;
322 }
323
324 #define set_temp(offset) \
325 static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO, \
326         show_temp, NULL, offset - 1); \
327 static SENSOR_DEVICE_ATTR(temp##offset##_min, S_IWUSR | S_IRUGO, \
328         show_temp_min, set_temp_min, offset - 1); \
329 static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IWUSR | S_IRUGO, \
330         show_temp_max, set_temp_max, offset - 1)
331 set_temp(1);
332 set_temp(2);
333
334 static ssize_t
335 show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
336 {
337         struct adm1025_data *data = adm1025_update_device(dev);
338         return sprintf(buf, "%u\n", data->alarms);
339 }
340 static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
341
342 static ssize_t
343 show_alarm(struct device *dev, struct device_attribute *attr, char *buf)
344 {
345         int bitnr = to_sensor_dev_attr(attr)->index;
346         struct adm1025_data *data = adm1025_update_device(dev);
347         return sprintf(buf, "%u\n", (data->alarms >> bitnr) & 1);
348 }
349 static SENSOR_DEVICE_ATTR(in0_alarm, S_IRUGO, show_alarm, NULL, 0);
350 static SENSOR_DEVICE_ATTR(in1_alarm, S_IRUGO, show_alarm, NULL, 1);
351 static SENSOR_DEVICE_ATTR(in2_alarm, S_IRUGO, show_alarm, NULL, 2);
352 static SENSOR_DEVICE_ATTR(in3_alarm, S_IRUGO, show_alarm, NULL, 3);
353 static SENSOR_DEVICE_ATTR(in4_alarm, S_IRUGO, show_alarm, NULL, 8);
354 static SENSOR_DEVICE_ATTR(in5_alarm, S_IRUGO, show_alarm, NULL, 9);
355 static SENSOR_DEVICE_ATTR(temp1_alarm, S_IRUGO, show_alarm, NULL, 5);
356 static SENSOR_DEVICE_ATTR(temp2_alarm, S_IRUGO, show_alarm, NULL, 4);
357 static SENSOR_DEVICE_ATTR(temp1_fault, S_IRUGO, show_alarm, NULL, 14);
358
359 static ssize_t
360 show_vid(struct device *dev, struct device_attribute *attr, char *buf)
361 {
362         struct adm1025_data *data = adm1025_update_device(dev);
363         return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm));
364 }
365 static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
366
367 static ssize_t
368 show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
369 {
370         struct adm1025_data *data = dev_get_drvdata(dev);
371         return sprintf(buf, "%u\n", data->vrm);
372 }
373 static ssize_t set_vrm(struct device *dev, struct device_attribute *attr,
374                        const char *buf, size_t count)
375 {
376         struct adm1025_data *data = dev_get_drvdata(dev);
377         unsigned long val;
378         int err;
379
380         err = kstrtoul(buf, 10, &val);
381         if (err)
382                 return err;
383
384         data->vrm = val;
385         return count;
386 }
387 static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm);
388
389 /*
390  * Real code
391  */
392
393 static struct attribute *adm1025_attributes[] = {
394         &sensor_dev_attr_in0_input.dev_attr.attr,
395         &sensor_dev_attr_in1_input.dev_attr.attr,
396         &sensor_dev_attr_in2_input.dev_attr.attr,
397         &sensor_dev_attr_in3_input.dev_attr.attr,
398         &sensor_dev_attr_in5_input.dev_attr.attr,
399         &sensor_dev_attr_in0_min.dev_attr.attr,
400         &sensor_dev_attr_in1_min.dev_attr.attr,
401         &sensor_dev_attr_in2_min.dev_attr.attr,
402         &sensor_dev_attr_in3_min.dev_attr.attr,
403         &sensor_dev_attr_in5_min.dev_attr.attr,
404         &sensor_dev_attr_in0_max.dev_attr.attr,
405         &sensor_dev_attr_in1_max.dev_attr.attr,
406         &sensor_dev_attr_in2_max.dev_attr.attr,
407         &sensor_dev_attr_in3_max.dev_attr.attr,
408         &sensor_dev_attr_in5_max.dev_attr.attr,
409         &sensor_dev_attr_in0_alarm.dev_attr.attr,
410         &sensor_dev_attr_in1_alarm.dev_attr.attr,
411         &sensor_dev_attr_in2_alarm.dev_attr.attr,
412         &sensor_dev_attr_in3_alarm.dev_attr.attr,
413         &sensor_dev_attr_in5_alarm.dev_attr.attr,
414         &sensor_dev_attr_temp1_input.dev_attr.attr,
415         &sensor_dev_attr_temp2_input.dev_attr.attr,
416         &sensor_dev_attr_temp1_min.dev_attr.attr,
417         &sensor_dev_attr_temp2_min.dev_attr.attr,
418         &sensor_dev_attr_temp1_max.dev_attr.attr,
419         &sensor_dev_attr_temp2_max.dev_attr.attr,
420         &sensor_dev_attr_temp1_alarm.dev_attr.attr,
421         &sensor_dev_attr_temp2_alarm.dev_attr.attr,
422         &sensor_dev_attr_temp1_fault.dev_attr.attr,
423         &dev_attr_alarms.attr,
424         &dev_attr_cpu0_vid.attr,
425         &dev_attr_vrm.attr,
426         NULL
427 };
428
429 static const struct attribute_group adm1025_group = {
430         .attrs = adm1025_attributes,
431 };
432
433 static struct attribute *adm1025_attributes_in4[] = {
434         &sensor_dev_attr_in4_input.dev_attr.attr,
435         &sensor_dev_attr_in4_min.dev_attr.attr,
436         &sensor_dev_attr_in4_max.dev_attr.attr,
437         &sensor_dev_attr_in4_alarm.dev_attr.attr,
438         NULL
439 };
440
441 static const struct attribute_group adm1025_group_in4 = {
442         .attrs = adm1025_attributes_in4,
443 };
444
445 /* Return 0 if detection is successful, -ENODEV otherwise */
446 static int adm1025_detect(struct i2c_client *client,
447                           struct i2c_board_info *info)
448 {
449         struct i2c_adapter *adapter = client->adapter;
450         const char *name;
451         u8 man_id, chip_id;
452
453         if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
454                 return -ENODEV;
455
456         /* Check for unused bits */
457         if ((i2c_smbus_read_byte_data(client, ADM1025_REG_CONFIG) & 0x80)
458          || (i2c_smbus_read_byte_data(client, ADM1025_REG_STATUS1) & 0xC0)
459          || (i2c_smbus_read_byte_data(client, ADM1025_REG_STATUS2) & 0xBC)) {
460                 dev_dbg(&adapter->dev, "ADM1025 detection failed at 0x%02x\n",
461                         client->addr);
462                 return -ENODEV;
463         }
464
465         /* Identification */
466         chip_id = i2c_smbus_read_byte_data(client, ADM1025_REG_CHIP_ID);
467         if ((chip_id & 0xF0) != 0x20)
468                 return -ENODEV;
469
470         man_id = i2c_smbus_read_byte_data(client, ADM1025_REG_MAN_ID);
471         if (man_id == 0x41)
472                 name = "adm1025";
473         else if (man_id == 0xA1 && client->addr != 0x2E)
474                 name = "ne1619";
475         else
476                 return -ENODEV;
477
478         strlcpy(info->type, name, I2C_NAME_SIZE);
479
480         return 0;
481 }
482
483 static void adm1025_init_client(struct i2c_client *client)
484 {
485         u8 reg;
486         struct adm1025_data *data = i2c_get_clientdata(client);
487         int i;
488
489         data->vrm = vid_which_vrm();
490
491         /*
492          * Set high limits
493          * Usually we avoid setting limits on driver init, but it happens
494          * that the ADM1025 comes with stupid default limits (all registers
495          * set to 0). In case the chip has not gone through any limit
496          * setting yet, we better set the high limits to the max so that
497          * no alarm triggers.
498          */
499         for (i = 0; i < 6; i++) {
500                 reg = i2c_smbus_read_byte_data(client,
501                                                ADM1025_REG_IN_MAX(i));
502                 if (reg == 0)
503                         i2c_smbus_write_byte_data(client,
504                                                   ADM1025_REG_IN_MAX(i),
505                                                   0xFF);
506         }
507         for (i = 0; i < 2; i++) {
508                 reg = i2c_smbus_read_byte_data(client,
509                                                ADM1025_REG_TEMP_HIGH(i));
510                 if (reg == 0)
511                         i2c_smbus_write_byte_data(client,
512                                                   ADM1025_REG_TEMP_HIGH(i),
513                                                   0x7F);
514         }
515
516         /*
517          * Start the conversions
518          */
519         reg = i2c_smbus_read_byte_data(client, ADM1025_REG_CONFIG);
520         if (!(reg & 0x01))
521                 i2c_smbus_write_byte_data(client, ADM1025_REG_CONFIG,
522                                           (reg&0x7E)|0x01);
523 }
524
525 static int adm1025_probe(struct i2c_client *client,
526                          const struct i2c_device_id *id)
527 {
528         struct adm1025_data *data;
529         int err;
530         u8 config;
531
532         data = devm_kzalloc(&client->dev, sizeof(struct adm1025_data),
533                             GFP_KERNEL);
534         if (!data)
535                 return -ENOMEM;
536
537         i2c_set_clientdata(client, data);
538         mutex_init(&data->update_lock);
539
540         /* Initialize the ADM1025 chip */
541         adm1025_init_client(client);
542
543         /* Register sysfs hooks */
544         err = sysfs_create_group(&client->dev.kobj, &adm1025_group);
545         if (err)
546                 return err;
547
548         /* Pin 11 is either in4 (+12V) or VID4 */
549         config = i2c_smbus_read_byte_data(client, ADM1025_REG_CONFIG);
550         if (!(config & 0x20)) {
551                 err = sysfs_create_group(&client->dev.kobj, &adm1025_group_in4);
552                 if (err)
553                         goto exit_remove;
554         }
555
556         data->hwmon_dev = hwmon_device_register(&client->dev);
557         if (IS_ERR(data->hwmon_dev)) {
558                 err = PTR_ERR(data->hwmon_dev);
559                 goto exit_remove;
560         }
561
562         return 0;
563
564 exit_remove:
565         sysfs_remove_group(&client->dev.kobj, &adm1025_group);
566         sysfs_remove_group(&client->dev.kobj, &adm1025_group_in4);
567         return err;
568 }
569
570 static int adm1025_remove(struct i2c_client *client)
571 {
572         struct adm1025_data *data = i2c_get_clientdata(client);
573
574         hwmon_device_unregister(data->hwmon_dev);
575         sysfs_remove_group(&client->dev.kobj, &adm1025_group);
576         sysfs_remove_group(&client->dev.kobj, &adm1025_group_in4);
577
578         return 0;
579 }
580
581 static const struct i2c_device_id adm1025_id[] = {
582         { "adm1025", adm1025 },
583         { "ne1619", ne1619 },
584         { }
585 };
586 MODULE_DEVICE_TABLE(i2c, adm1025_id);
587
588 static struct i2c_driver adm1025_driver = {
589         .class          = I2C_CLASS_HWMON,
590         .driver = {
591                 .name   = "adm1025",
592         },
593         .probe          = adm1025_probe,
594         .remove         = adm1025_remove,
595         .id_table       = adm1025_id,
596         .detect         = adm1025_detect,
597         .address_list   = normal_i2c,
598 };
599
600 module_i2c_driver(adm1025_driver);
601
602 MODULE_AUTHOR("Jean Delvare <jdelvare@suse.de>");
603 MODULE_DESCRIPTION("ADM1025 driver");
604 MODULE_LICENSE("GPL");