2 * nct7904.c - driver for Nuvoton NCT7904D.
4 * Copyright (c) 2015 Kontron
5 * Author: Vadim V. Vlasov <vvlasov@dev.rtsoft.ru>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
18 #include <linux/module.h>
19 #include <linux/device.h>
20 #include <linux/init.h>
21 #include <linux/i2c.h>
22 #include <linux/mutex.h>
23 #include <linux/hwmon.h>
24 #include <linux/hwmon-sysfs.h>
26 #define VENDOR_ID_REG 0x7A /* Any bank */
27 #define NUVOTON_ID 0x50
28 #define CHIP_ID_REG 0x7B /* Any bank */
29 #define NCT7904_ID 0xC5
30 #define DEVICE_ID_REG 0x7C /* Any bank */
32 #define BANK_SEL_REG 0xFF
40 #define FANIN_MAX 12 /* Counted from 1 */
41 #define VSEN_MAX 21 /* VSEN1..14, 3VDD, VBAT, V3VSB,
42 LTD (not a voltage), VSEN17..19 */
43 #define FANCTL_MAX 4 /* Counted from 1 */
44 #define TCPU_MAX 8 /* Counted from 1 */
45 #define TEMP_MAX 4 /* Counted from 1 */
47 #define VT_ADC_CTRL0_REG 0x20 /* Bank 0 */
48 #define VT_ADC_CTRL1_REG 0x21 /* Bank 0 */
49 #define VT_ADC_CTRL2_REG 0x22 /* Bank 0 */
50 #define FANIN_CTRL0_REG 0x24
51 #define FANIN_CTRL1_REG 0x25
52 #define DTS_T_CTRL0_REG 0x26
53 #define DTS_T_CTRL1_REG 0x27
54 #define VT_ADC_MD_REG 0x2E
56 #define VSEN1_HV_REG 0x40 /* Bank 0; 2 regs (HV/LV) per sensor */
57 #define TEMP_CH1_HV_REG 0x42 /* Bank 0; same as VSEN2_HV */
58 #define LTD_HV_REG 0x62 /* Bank 0; 2 regs in VSEN range */
59 #define FANIN1_HV_REG 0x80 /* Bank 0; 2 regs (HV/LV) per sensor */
60 #define T_CPU1_HV_REG 0xA0 /* Bank 0; 2 regs (HV/LV) per sensor */
62 #define PRTS_REG 0x03 /* Bank 2 */
63 #define FANCTL1_FMR_REG 0x00 /* Bank 3; 1 reg per channel */
64 #define FANCTL1_OUT_REG 0x10 /* Bank 3; 1 reg per channel */
66 static const unsigned short normal_i2c
[] = {
67 0x2d, 0x2e, I2C_CLIENT_END
71 struct i2c_client
*client
;
72 struct mutex bank_lock
;
77 u8 fan_mode
[FANCTL_MAX
];
80 /* Access functions */
81 static int nct7904_bank_lock(struct nct7904_data
*data
, unsigned bank
)
85 mutex_lock(&data
->bank_lock
);
86 if (data
->bank_sel
== bank
)
88 ret
= i2c_smbus_write_byte_data(data
->client
, BANK_SEL_REG
, bank
);
90 data
->bank_sel
= bank
;
96 static inline void nct7904_bank_release(struct nct7904_data
*data
)
98 mutex_unlock(&data
->bank_lock
);
101 /* Read 1-byte register. Returns unsigned reg or -ERRNO on error. */
102 static int nct7904_read_reg(struct nct7904_data
*data
,
103 unsigned bank
, unsigned reg
)
105 struct i2c_client
*client
= data
->client
;
108 ret
= nct7904_bank_lock(data
, bank
);
110 ret
= i2c_smbus_read_byte_data(client
, reg
);
112 nct7904_bank_release(data
);
117 * Read 2-byte register. Returns register in big-endian format or
120 static int nct7904_read_reg16(struct nct7904_data
*data
,
121 unsigned bank
, unsigned reg
)
123 struct i2c_client
*client
= data
->client
;
126 ret
= nct7904_bank_lock(data
, bank
);
128 ret
= i2c_smbus_read_byte_data(client
, reg
);
131 ret
= i2c_smbus_read_byte_data(client
, reg
+ 1);
137 nct7904_bank_release(data
);
141 /* Write 1-byte register. Returns 0 or -ERRNO on error. */
142 static int nct7904_write_reg(struct nct7904_data
*data
,
143 unsigned bank
, unsigned reg
, u8 val
)
145 struct i2c_client
*client
= data
->client
;
148 ret
= nct7904_bank_lock(data
, bank
);
150 ret
= i2c_smbus_write_byte_data(client
, reg
, val
);
152 nct7904_bank_release(data
);
157 static ssize_t
show_fan(struct device
*dev
,
158 struct device_attribute
*devattr
, char *buf
)
160 int index
= to_sensor_dev_attr(devattr
)->index
;
161 struct nct7904_data
*data
= dev_get_drvdata(dev
);
165 ret
= nct7904_read_reg16(data
, BANK_0
, FANIN1_HV_REG
+ index
* 2);
168 cnt
= ((ret
& 0xff00) >> 3) | (ret
& 0x1f);
173 return sprintf(buf
, "%u\n", rpm
);
176 static umode_t
nct7904_fanin_is_visible(struct kobject
*kobj
,
177 struct attribute
*a
, int n
)
179 struct device
*dev
= container_of(kobj
, struct device
, kobj
);
180 struct nct7904_data
*data
= dev_get_drvdata(dev
);
182 if (data
->fanin_mask
& (1 << n
))
187 static SENSOR_DEVICE_ATTR(fan1_input
, S_IRUGO
, show_fan
, NULL
, 0);
188 static SENSOR_DEVICE_ATTR(fan2_input
, S_IRUGO
, show_fan
, NULL
, 1);
189 static SENSOR_DEVICE_ATTR(fan3_input
, S_IRUGO
, show_fan
, NULL
, 2);
190 static SENSOR_DEVICE_ATTR(fan4_input
, S_IRUGO
, show_fan
, NULL
, 3);
191 static SENSOR_DEVICE_ATTR(fan5_input
, S_IRUGO
, show_fan
, NULL
, 4);
192 static SENSOR_DEVICE_ATTR(fan6_input
, S_IRUGO
, show_fan
, NULL
, 5);
193 static SENSOR_DEVICE_ATTR(fan7_input
, S_IRUGO
, show_fan
, NULL
, 6);
194 static SENSOR_DEVICE_ATTR(fan8_input
, S_IRUGO
, show_fan
, NULL
, 7);
195 static SENSOR_DEVICE_ATTR(fan9_input
, S_IRUGO
, show_fan
, NULL
, 8);
196 static SENSOR_DEVICE_ATTR(fan10_input
, S_IRUGO
, show_fan
, NULL
, 9);
197 static SENSOR_DEVICE_ATTR(fan11_input
, S_IRUGO
, show_fan
, NULL
, 10);
198 static SENSOR_DEVICE_ATTR(fan12_input
, S_IRUGO
, show_fan
, NULL
, 11);
200 static struct attribute
*nct7904_fanin_attrs
[] = {
201 &sensor_dev_attr_fan1_input
.dev_attr
.attr
,
202 &sensor_dev_attr_fan2_input
.dev_attr
.attr
,
203 &sensor_dev_attr_fan3_input
.dev_attr
.attr
,
204 &sensor_dev_attr_fan4_input
.dev_attr
.attr
,
205 &sensor_dev_attr_fan5_input
.dev_attr
.attr
,
206 &sensor_dev_attr_fan6_input
.dev_attr
.attr
,
207 &sensor_dev_attr_fan7_input
.dev_attr
.attr
,
208 &sensor_dev_attr_fan8_input
.dev_attr
.attr
,
209 &sensor_dev_attr_fan9_input
.dev_attr
.attr
,
210 &sensor_dev_attr_fan10_input
.dev_attr
.attr
,
211 &sensor_dev_attr_fan11_input
.dev_attr
.attr
,
212 &sensor_dev_attr_fan12_input
.dev_attr
.attr
,
216 static const struct attribute_group nct7904_fanin_group
= {
217 .attrs
= nct7904_fanin_attrs
,
218 .is_visible
= nct7904_fanin_is_visible
,
222 static ssize_t
show_voltage(struct device
*dev
,
223 struct device_attribute
*devattr
, char *buf
)
225 int index
= to_sensor_dev_attr(devattr
)->index
;
226 struct nct7904_data
*data
= dev_get_drvdata(dev
);
230 ret
= nct7904_read_reg16(data
, BANK_0
, VSEN1_HV_REG
+ index
* 2);
233 volt
= ((ret
& 0xff00) >> 5) | (ret
& 0x7);
235 volt
*= 2; /* 0.002V scale */
237 volt
*= 6; /* 0.006V scale */
239 return sprintf(buf
, "%d\n", volt
);
242 static ssize_t
show_ltemp(struct device
*dev
,
243 struct device_attribute
*devattr
, char *buf
)
245 struct nct7904_data
*data
= dev_get_drvdata(dev
);
249 ret
= nct7904_read_reg16(data
, BANK_0
, LTD_HV_REG
);
252 temp
= ((ret
& 0xff00) >> 5) | (ret
& 0x7);
253 temp
= sign_extend32(temp
, 10) * 125;
255 return sprintf(buf
, "%d\n", temp
);
258 static umode_t
nct7904_vsen_is_visible(struct kobject
*kobj
,
259 struct attribute
*a
, int n
)
261 struct device
*dev
= container_of(kobj
, struct device
, kobj
);
262 struct nct7904_data
*data
= dev_get_drvdata(dev
);
264 if (data
->vsen_mask
& (1 << n
))
269 static SENSOR_DEVICE_ATTR(in1_input
, S_IRUGO
, show_voltage
, NULL
, 0);
270 static SENSOR_DEVICE_ATTR(in2_input
, S_IRUGO
, show_voltage
, NULL
, 1);
271 static SENSOR_DEVICE_ATTR(in3_input
, S_IRUGO
, show_voltage
, NULL
, 2);
272 static SENSOR_DEVICE_ATTR(in4_input
, S_IRUGO
, show_voltage
, NULL
, 3);
273 static SENSOR_DEVICE_ATTR(in5_input
, S_IRUGO
, show_voltage
, NULL
, 4);
274 static SENSOR_DEVICE_ATTR(in6_input
, S_IRUGO
, show_voltage
, NULL
, 5);
275 static SENSOR_DEVICE_ATTR(in7_input
, S_IRUGO
, show_voltage
, NULL
, 6);
276 static SENSOR_DEVICE_ATTR(in8_input
, S_IRUGO
, show_voltage
, NULL
, 7);
277 static SENSOR_DEVICE_ATTR(in9_input
, S_IRUGO
, show_voltage
, NULL
, 8);
278 static SENSOR_DEVICE_ATTR(in10_input
, S_IRUGO
, show_voltage
, NULL
, 9);
279 static SENSOR_DEVICE_ATTR(in11_input
, S_IRUGO
, show_voltage
, NULL
, 10);
280 static SENSOR_DEVICE_ATTR(in12_input
, S_IRUGO
, show_voltage
, NULL
, 11);
281 static SENSOR_DEVICE_ATTR(in13_input
, S_IRUGO
, show_voltage
, NULL
, 12);
282 static SENSOR_DEVICE_ATTR(in14_input
, S_IRUGO
, show_voltage
, NULL
, 13);
284 * Next 3 voltage sensors have specific names in the Nuvoton doc
285 * (3VDD, VBAT, 3VSB) but we use vacant numbers for them.
287 static SENSOR_DEVICE_ATTR(in15_input
, S_IRUGO
, show_voltage
, NULL
, 14);
288 static SENSOR_DEVICE_ATTR(in16_input
, S_IRUGO
, show_voltage
, NULL
, 15);
289 static SENSOR_DEVICE_ATTR(in20_input
, S_IRUGO
, show_voltage
, NULL
, 16);
290 /* This is not a voltage, but a local temperature sensor. */
291 static SENSOR_DEVICE_ATTR(temp1_input
, S_IRUGO
, show_ltemp
, NULL
, 0);
292 static SENSOR_DEVICE_ATTR(in17_input
, S_IRUGO
, show_voltage
, NULL
, 18);
293 static SENSOR_DEVICE_ATTR(in18_input
, S_IRUGO
, show_voltage
, NULL
, 19);
294 static SENSOR_DEVICE_ATTR(in19_input
, S_IRUGO
, show_voltage
, NULL
, 20);
296 static struct attribute
*nct7904_vsen_attrs
[] = {
297 &sensor_dev_attr_in1_input
.dev_attr
.attr
,
298 &sensor_dev_attr_in2_input
.dev_attr
.attr
,
299 &sensor_dev_attr_in3_input
.dev_attr
.attr
,
300 &sensor_dev_attr_in4_input
.dev_attr
.attr
,
301 &sensor_dev_attr_in5_input
.dev_attr
.attr
,
302 &sensor_dev_attr_in6_input
.dev_attr
.attr
,
303 &sensor_dev_attr_in7_input
.dev_attr
.attr
,
304 &sensor_dev_attr_in8_input
.dev_attr
.attr
,
305 &sensor_dev_attr_in9_input
.dev_attr
.attr
,
306 &sensor_dev_attr_in10_input
.dev_attr
.attr
,
307 &sensor_dev_attr_in11_input
.dev_attr
.attr
,
308 &sensor_dev_attr_in12_input
.dev_attr
.attr
,
309 &sensor_dev_attr_in13_input
.dev_attr
.attr
,
310 &sensor_dev_attr_in14_input
.dev_attr
.attr
,
311 &sensor_dev_attr_in15_input
.dev_attr
.attr
,
312 &sensor_dev_attr_in16_input
.dev_attr
.attr
,
313 &sensor_dev_attr_in20_input
.dev_attr
.attr
,
314 &sensor_dev_attr_temp1_input
.dev_attr
.attr
,
315 &sensor_dev_attr_in17_input
.dev_attr
.attr
,
316 &sensor_dev_attr_in18_input
.dev_attr
.attr
,
317 &sensor_dev_attr_in19_input
.dev_attr
.attr
,
321 static const struct attribute_group nct7904_vsen_group
= {
322 .attrs
= nct7904_vsen_attrs
,
323 .is_visible
= nct7904_vsen_is_visible
,
327 static ssize_t
show_tcpu(struct device
*dev
,
328 struct device_attribute
*devattr
, char *buf
)
330 int index
= to_sensor_dev_attr(devattr
)->index
;
331 struct nct7904_data
*data
= dev_get_drvdata(dev
);
335 ret
= nct7904_read_reg16(data
, BANK_0
, T_CPU1_HV_REG
+ index
* 2);
339 temp
= ((ret
& 0xff00) >> 5) | (ret
& 0x7);
340 temp
= sign_extend32(temp
, 10) * 125;
341 return sprintf(buf
, "%d\n", temp
);
344 static umode_t
nct7904_tcpu_is_visible(struct kobject
*kobj
,
345 struct attribute
*a
, int n
)
347 struct device
*dev
= container_of(kobj
, struct device
, kobj
);
348 struct nct7904_data
*data
= dev_get_drvdata(dev
);
350 if (data
->tcpu_mask
& (1 << n
))
355 /* "temp1_input" reserved for local temp */
356 static SENSOR_DEVICE_ATTR(temp2_input
, S_IRUGO
, show_tcpu
, NULL
, 0);
357 static SENSOR_DEVICE_ATTR(temp3_input
, S_IRUGO
, show_tcpu
, NULL
, 1);
358 static SENSOR_DEVICE_ATTR(temp4_input
, S_IRUGO
, show_tcpu
, NULL
, 2);
359 static SENSOR_DEVICE_ATTR(temp5_input
, S_IRUGO
, show_tcpu
, NULL
, 3);
360 static SENSOR_DEVICE_ATTR(temp6_input
, S_IRUGO
, show_tcpu
, NULL
, 4);
361 static SENSOR_DEVICE_ATTR(temp7_input
, S_IRUGO
, show_tcpu
, NULL
, 5);
362 static SENSOR_DEVICE_ATTR(temp8_input
, S_IRUGO
, show_tcpu
, NULL
, 6);
363 static SENSOR_DEVICE_ATTR(temp9_input
, S_IRUGO
, show_tcpu
, NULL
, 7);
365 static struct attribute
*nct7904_tcpu_attrs
[] = {
366 &sensor_dev_attr_temp2_input
.dev_attr
.attr
,
367 &sensor_dev_attr_temp3_input
.dev_attr
.attr
,
368 &sensor_dev_attr_temp4_input
.dev_attr
.attr
,
369 &sensor_dev_attr_temp5_input
.dev_attr
.attr
,
370 &sensor_dev_attr_temp6_input
.dev_attr
.attr
,
371 &sensor_dev_attr_temp7_input
.dev_attr
.attr
,
372 &sensor_dev_attr_temp8_input
.dev_attr
.attr
,
373 &sensor_dev_attr_temp9_input
.dev_attr
.attr
,
377 static const struct attribute_group nct7904_tcpu_group
= {
378 .attrs
= nct7904_tcpu_attrs
,
379 .is_visible
= nct7904_tcpu_is_visible
,
383 static ssize_t
store_pwm(struct device
*dev
, struct device_attribute
*devattr
,
384 const char *buf
, size_t count
)
386 int index
= to_sensor_dev_attr(devattr
)->index
;
387 struct nct7904_data
*data
= dev_get_drvdata(dev
);
391 if (kstrtoul(buf
, 10, &val
) < 0)
396 ret
= nct7904_write_reg(data
, BANK_3
, FANCTL1_OUT_REG
+ index
, val
);
398 return ret
? ret
: count
;
401 static ssize_t
show_pwm(struct device
*dev
,
402 struct device_attribute
*devattr
, char *buf
)
404 int index
= to_sensor_dev_attr(devattr
)->index
;
405 struct nct7904_data
*data
= dev_get_drvdata(dev
);
408 val
= nct7904_read_reg(data
, BANK_3
, FANCTL1_OUT_REG
+ index
);
412 return sprintf(buf
, "%d\n", val
);
415 static ssize_t
store_mode(struct device
*dev
, struct device_attribute
*devattr
,
416 const char *buf
, size_t count
)
418 int index
= to_sensor_dev_attr(devattr
)->index
;
419 struct nct7904_data
*data
= dev_get_drvdata(dev
);
423 if (kstrtoul(buf
, 10, &val
) < 0)
425 if (val
> 1 || (val
&& !data
->fan_mode
[index
]))
428 ret
= nct7904_write_reg(data
, BANK_3
, FANCTL1_FMR_REG
+ index
,
429 val
? data
->fan_mode
[index
] : 0);
431 return ret
? ret
: count
;
434 /* Return 0 for manual mode or 1 for SmartFan mode */
435 static ssize_t
show_mode(struct device
*dev
,
436 struct device_attribute
*devattr
, char *buf
)
438 int index
= to_sensor_dev_attr(devattr
)->index
;
439 struct nct7904_data
*data
= dev_get_drvdata(dev
);
442 val
= nct7904_read_reg(data
, BANK_3
, FANCTL1_FMR_REG
+ index
);
446 return sprintf(buf
, "%d\n", val
? 1 : 0);
449 /* 2 attributes per channel: pwm and mode */
450 static SENSOR_DEVICE_ATTR(fan1_pwm
, S_IRUGO
| S_IWUSR
,
451 show_pwm
, store_pwm
, 0);
452 static SENSOR_DEVICE_ATTR(fan1_mode
, S_IRUGO
| S_IWUSR
,
453 show_mode
, store_mode
, 0);
454 static SENSOR_DEVICE_ATTR(fan2_pwm
, S_IRUGO
| S_IWUSR
,
455 show_pwm
, store_pwm
, 1);
456 static SENSOR_DEVICE_ATTR(fan2_mode
, S_IRUGO
| S_IWUSR
,
457 show_mode
, store_mode
, 1);
458 static SENSOR_DEVICE_ATTR(fan3_pwm
, S_IRUGO
| S_IWUSR
,
459 show_pwm
, store_pwm
, 2);
460 static SENSOR_DEVICE_ATTR(fan3_mode
, S_IRUGO
| S_IWUSR
,
461 show_mode
, store_mode
, 2);
462 static SENSOR_DEVICE_ATTR(fan4_pwm
, S_IRUGO
| S_IWUSR
,
463 show_pwm
, store_pwm
, 3);
464 static SENSOR_DEVICE_ATTR(fan4_mode
, S_IRUGO
| S_IWUSR
,
465 show_mode
, store_mode
, 3);
467 static struct attribute
*nct7904_fanctl_attrs
[] = {
468 &sensor_dev_attr_fan1_pwm
.dev_attr
.attr
,
469 &sensor_dev_attr_fan1_mode
.dev_attr
.attr
,
470 &sensor_dev_attr_fan2_pwm
.dev_attr
.attr
,
471 &sensor_dev_attr_fan2_mode
.dev_attr
.attr
,
472 &sensor_dev_attr_fan3_pwm
.dev_attr
.attr
,
473 &sensor_dev_attr_fan3_mode
.dev_attr
.attr
,
474 &sensor_dev_attr_fan4_pwm
.dev_attr
.attr
,
475 &sensor_dev_attr_fan4_mode
.dev_attr
.attr
,
479 static const struct attribute_group nct7904_fanctl_group
= {
480 .attrs
= nct7904_fanctl_attrs
,
483 static const struct attribute_group
*nct7904_groups
[] = {
484 &nct7904_fanin_group
,
487 &nct7904_fanctl_group
,
491 /* Return 0 if detection is successful, -ENODEV otherwise */
492 static int nct7904_detect(struct i2c_client
*client
,
493 struct i2c_board_info
*info
)
495 struct i2c_adapter
*adapter
= client
->adapter
;
497 if (!i2c_check_functionality(adapter
,
498 I2C_FUNC_SMBUS_READ_BYTE
|
499 I2C_FUNC_SMBUS_WRITE_BYTE_DATA
))
502 /* Determine the chip type. */
503 if (i2c_smbus_read_byte_data(client
, VENDOR_ID_REG
) != NUVOTON_ID
||
504 i2c_smbus_read_byte_data(client
, CHIP_ID_REG
) != NCT7904_ID
||
505 (i2c_smbus_read_byte_data(client
, DEVICE_ID_REG
) & 0xf0) != 0x50 ||
506 (i2c_smbus_read_byte_data(client
, BANK_SEL_REG
) & 0xf8) != 0x00)
509 strlcpy(info
->type
, "nct7904", I2C_NAME_SIZE
);
514 static int nct7904_probe(struct i2c_client
*client
,
515 const struct i2c_device_id
*id
)
517 struct nct7904_data
*data
;
518 struct device
*hwmon_dev
;
519 struct device
*dev
= &client
->dev
;
523 data
= devm_kzalloc(dev
, sizeof(struct nct7904_data
), GFP_KERNEL
);
527 data
->client
= client
;
528 mutex_init(&data
->bank_lock
);
531 /* Setup sensor groups. */
532 /* FANIN attributes */
533 ret
= nct7904_read_reg16(data
, BANK_0
, FANIN_CTRL0_REG
);
536 data
->fanin_mask
= (ret
>> 8) | ((ret
& 0xff) << 8);
541 * Note: voltage sensors overlap with external temperature
542 * sensors. So, if we ever decide to support the latter
543 * we will have to adjust 'vsen_mask' accordingly.
546 ret
= nct7904_read_reg16(data
, BANK_0
, VT_ADC_CTRL0_REG
);
548 mask
= (ret
>> 8) | ((ret
& 0xff) << 8);
549 ret
= nct7904_read_reg(data
, BANK_0
, VT_ADC_CTRL2_REG
);
552 data
->vsen_mask
= mask
;
554 /* CPU_TEMP attributes */
555 ret
= nct7904_read_reg16(data
, BANK_0
, DTS_T_CTRL0_REG
);
558 data
->tcpu_mask
= ((ret
>> 8) & 0xf) | ((ret
& 0xf) << 4);
560 for (i
= 0; i
< FANCTL_MAX
; i
++) {
561 ret
= nct7904_read_reg(data
, BANK_3
, FANCTL1_FMR_REG
+ i
);
564 data
->fan_mode
[i
] = ret
;
568 devm_hwmon_device_register_with_groups(dev
, client
->name
, data
,
570 return PTR_ERR_OR_ZERO(hwmon_dev
);
573 static const struct i2c_device_id nct7904_id
[] = {
578 static struct i2c_driver nct7904_driver
= {
579 .class = I2C_CLASS_HWMON
,
583 .probe
= nct7904_probe
,
584 .id_table
= nct7904_id
,
585 .detect
= nct7904_detect
,
586 .address_list
= normal_i2c
,
589 module_i2c_driver(nct7904_driver
);
591 MODULE_AUTHOR("Vadim V. Vlasov <vvlasov@dev.rtsoft.ru>");
592 MODULE_DESCRIPTION("Hwmon driver for NUVOTON NCT7904");
593 MODULE_LICENSE("GPL");