diff options
author | Guenter Roeck <guenter.roeck@ericsson.com> | 2010-08-14 15:08:55 -0400 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2010-08-14 15:08:55 -0400 |
commit | c39aedafb242601729bef48db052ebc055ce3ab4 (patch) | |
tree | 518a88dca7fa8b4904a21ad88df761b02c466c04 /drivers/hwmon | |
parent | da2e025590cf7038440132d4bbc967a579b11112 (diff) |
hwmon: (w83627ehf) Add support for W83667HG-B
Add support for W83667HG-B (very similar to the W83667HG).
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/w83627ehf.c | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c index e01a3e97aa17..e96e69dd36fb 100644 --- a/drivers/hwmon/w83627ehf.c +++ b/drivers/hwmon/w83627ehf.c | |||
@@ -39,6 +39,7 @@ | |||
39 | w83627dhg 9 5 4 3 0xa020 0xc1 0x5ca3 | 39 | w83627dhg 9 5 4 3 0xa020 0xc1 0x5ca3 |
40 | w83627dhg-p 9 5 4 3 0xb070 0xc1 0x5ca3 | 40 | w83627dhg-p 9 5 4 3 0xb070 0xc1 0x5ca3 |
41 | w83667hg 9 5 3 3 0xa510 0xc1 0x5ca3 | 41 | w83667hg 9 5 3 3 0xa510 0xc1 0x5ca3 |
42 | w83667hg-b 9 5 3 3 0xb350 0xc1 0x5ca3 | ||
42 | */ | 43 | */ |
43 | 44 | ||
44 | #include <linux/module.h> | 45 | #include <linux/module.h> |
@@ -55,7 +56,7 @@ | |||
55 | #include <linux/io.h> | 56 | #include <linux/io.h> |
56 | #include "lm75.h" | 57 | #include "lm75.h" |
57 | 58 | ||
58 | enum kinds { w83627ehf, w83627dhg, w83627dhg_p, w83667hg }; | 59 | enum kinds { w83627ehf, w83627dhg, w83627dhg_p, w83667hg, w83667hg_b }; |
59 | 60 | ||
60 | /* used to set data->name = w83627ehf_device_names[data->sio_kind] */ | 61 | /* used to set data->name = w83627ehf_device_names[data->sio_kind] */ |
61 | static const char * w83627ehf_device_names[] = { | 62 | static const char * w83627ehf_device_names[] = { |
@@ -63,6 +64,7 @@ static const char * w83627ehf_device_names[] = { | |||
63 | "w83627dhg", | 64 | "w83627dhg", |
64 | "w83627dhg", | 65 | "w83627dhg", |
65 | "w83667hg", | 66 | "w83667hg", |
67 | "w83667hg", | ||
66 | }; | 68 | }; |
67 | 69 | ||
68 | static unsigned short force_id; | 70 | static unsigned short force_id; |
@@ -91,6 +93,7 @@ MODULE_PARM_DESC(force_id, "Override the detected device ID"); | |||
91 | #define SIO_W83627DHG_ID 0xa020 | 93 | #define SIO_W83627DHG_ID 0xa020 |
92 | #define SIO_W83627DHG_P_ID 0xb070 | 94 | #define SIO_W83627DHG_P_ID 0xb070 |
93 | #define SIO_W83667HG_ID 0xa510 | 95 | #define SIO_W83667HG_ID 0xa510 |
96 | #define SIO_W83667HG_B_ID 0xb350 | ||
94 | #define SIO_ID_MASK 0xFFF0 | 97 | #define SIO_ID_MASK 0xFFF0 |
95 | 98 | ||
96 | static inline void | 99 | static inline void |
@@ -201,8 +204,14 @@ static const u8 W83627EHF_REG_TOLERANCE[] = { 0x07, 0x07, 0x14, 0x62 }; | |||
201 | static const u8 W83627EHF_REG_FAN_START_OUTPUT[] = { 0x0a, 0x0b, 0x16, 0x65 }; | 204 | static const u8 W83627EHF_REG_FAN_START_OUTPUT[] = { 0x0a, 0x0b, 0x16, 0x65 }; |
202 | static const u8 W83627EHF_REG_FAN_STOP_OUTPUT[] = { 0x08, 0x09, 0x15, 0x64 }; | 205 | static const u8 W83627EHF_REG_FAN_STOP_OUTPUT[] = { 0x08, 0x09, 0x15, 0x64 }; |
203 | static const u8 W83627EHF_REG_FAN_STOP_TIME[] = { 0x0c, 0x0d, 0x17, 0x66 }; | 206 | static const u8 W83627EHF_REG_FAN_STOP_TIME[] = { 0x0c, 0x0d, 0x17, 0x66 }; |
204 | static const u8 W83627EHF_REG_FAN_MAX_OUTPUT[] = { 0xff, 0x67, 0xff, 0x69 }; | 207 | |
205 | static const u8 W83627EHF_REG_FAN_STEP_OUTPUT[] = { 0xff, 0x68, 0xff, 0x6a }; | 208 | static const u8 W83627EHF_REG_FAN_MAX_OUTPUT_COMMON[] |
209 | = { 0xff, 0x67, 0xff, 0x69 }; | ||
210 | static const u8 W83627EHF_REG_FAN_STEP_OUTPUT_COMMON[] | ||
211 | = { 0xff, 0x68, 0xff, 0x6a }; | ||
212 | |||
213 | static const u8 W83627EHF_REG_FAN_MAX_OUTPUT_W83667_B[] = { 0x67, 0x69, 0x6b }; | ||
214 | static const u8 W83627EHF_REG_FAN_STEP_OUTPUT_W83667_B[] = { 0x68, 0x6a, 0x6c }; | ||
206 | 215 | ||
207 | /* | 216 | /* |
208 | * Conversions | 217 | * Conversions |
@@ -1382,10 +1391,11 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) | |||
1382 | /* 627EHG and 627EHF have 10 voltage inputs; 627DHG and 667HG have 9 */ | 1391 | /* 627EHG and 627EHF have 10 voltage inputs; 627DHG and 667HG have 9 */ |
1383 | data->in_num = (sio_data->kind == w83627ehf) ? 10 : 9; | 1392 | data->in_num = (sio_data->kind == w83627ehf) ? 10 : 9; |
1384 | /* 667HG has 3 pwms */ | 1393 | /* 667HG has 3 pwms */ |
1385 | data->pwm_num = (sio_data->kind == w83667hg) ? 3 : 4; | 1394 | data->pwm_num = (sio_data->kind == w83667hg |
1395 | || sio_data->kind == w83667hg_b) ? 3 : 4; | ||
1386 | 1396 | ||
1387 | /* Check temp3 configuration bit for 667HG */ | 1397 | /* Check temp3 configuration bit for 667HG */ |
1388 | if (sio_data->kind == w83667hg) { | 1398 | if (sio_data->kind == w83667hg || sio_data->kind == w83667hg_b) { |
1389 | data->temp3_disable = w83627ehf_read_value(data, | 1399 | data->temp3_disable = w83627ehf_read_value(data, |
1390 | W83627EHF_REG_TEMP_CONFIG[1]) & 0x01; | 1400 | W83627EHF_REG_TEMP_CONFIG[1]) & 0x01; |
1391 | data->in6_skip = !data->temp3_disable; | 1401 | data->in6_skip = !data->temp3_disable; |
@@ -1393,8 +1403,17 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) | |||
1393 | 1403 | ||
1394 | data->REG_FAN_START_OUTPUT = W83627EHF_REG_FAN_START_OUTPUT; | 1404 | data->REG_FAN_START_OUTPUT = W83627EHF_REG_FAN_START_OUTPUT; |
1395 | data->REG_FAN_STOP_OUTPUT = W83627EHF_REG_FAN_STOP_OUTPUT; | 1405 | data->REG_FAN_STOP_OUTPUT = W83627EHF_REG_FAN_STOP_OUTPUT; |
1396 | data->REG_FAN_MAX_OUTPUT = W83627EHF_REG_FAN_MAX_OUTPUT; | 1406 | if (sio_data->kind == w83667hg_b) { |
1397 | data->REG_FAN_STEP_OUTPUT = W83627EHF_REG_FAN_STEP_OUTPUT; | 1407 | data->REG_FAN_MAX_OUTPUT = |
1408 | W83627EHF_REG_FAN_MAX_OUTPUT_W83667_B; | ||
1409 | data->REG_FAN_STEP_OUTPUT = | ||
1410 | W83627EHF_REG_FAN_STEP_OUTPUT_W83667_B; | ||
1411 | } else { | ||
1412 | data->REG_FAN_MAX_OUTPUT = | ||
1413 | W83627EHF_REG_FAN_MAX_OUTPUT_COMMON; | ||
1414 | data->REG_FAN_STEP_OUTPUT = | ||
1415 | W83627EHF_REG_FAN_STEP_OUTPUT_COMMON; | ||
1416 | } | ||
1398 | 1417 | ||
1399 | /* Initialize the chip */ | 1418 | /* Initialize the chip */ |
1400 | w83627ehf_init_device(data); | 1419 | w83627ehf_init_device(data); |
@@ -1402,7 +1421,7 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) | |||
1402 | data->vrm = vid_which_vrm(); | 1421 | data->vrm = vid_which_vrm(); |
1403 | superio_enter(sio_data->sioreg); | 1422 | superio_enter(sio_data->sioreg); |
1404 | /* Read VID value */ | 1423 | /* Read VID value */ |
1405 | if (sio_data->kind == w83667hg) { | 1424 | if (sio_data->kind == w83667hg || sio_data->kind == w83667hg_b) { |
1406 | /* W83667HG has different pins for VID input and output, so | 1425 | /* W83667HG has different pins for VID input and output, so |
1407 | we can get the VID input values directly at logical device D | 1426 | we can get the VID input values directly at logical device D |
1408 | 0xe3. */ | 1427 | 0xe3. */ |
@@ -1453,7 +1472,7 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) | |||
1453 | } | 1472 | } |
1454 | 1473 | ||
1455 | /* fan4 and fan5 share some pins with the GPIO and serial flash */ | 1474 | /* fan4 and fan5 share some pins with the GPIO and serial flash */ |
1456 | if (sio_data->kind == w83667hg) { | 1475 | if (sio_data->kind == w83667hg || sio_data->kind == w83667hg_b) { |
1457 | fan5pin = superio_inb(sio_data->sioreg, 0x27) & 0x20; | 1476 | fan5pin = superio_inb(sio_data->sioreg, 0x27) & 0x20; |
1458 | fan4pin = superio_inb(sio_data->sioreg, 0x27) & 0x40; | 1477 | fan4pin = superio_inb(sio_data->sioreg, 0x27) & 0x40; |
1459 | } else { | 1478 | } else { |
@@ -1609,6 +1628,7 @@ static int __init w83627ehf_find(int sioaddr, unsigned short *addr, | |||
1609 | static const char __initdata sio_name_W83627DHG[] = "W83627DHG"; | 1628 | static const char __initdata sio_name_W83627DHG[] = "W83627DHG"; |
1610 | static const char __initdata sio_name_W83627DHG_P[] = "W83627DHG-P"; | 1629 | static const char __initdata sio_name_W83627DHG_P[] = "W83627DHG-P"; |
1611 | static const char __initdata sio_name_W83667HG[] = "W83667HG"; | 1630 | static const char __initdata sio_name_W83667HG[] = "W83667HG"; |
1631 | static const char __initdata sio_name_W83667HG_B[] = "W83667HG-B"; | ||
1612 | 1632 | ||
1613 | u16 val; | 1633 | u16 val; |
1614 | const char *sio_name; | 1634 | const char *sio_name; |
@@ -1641,6 +1661,10 @@ static int __init w83627ehf_find(int sioaddr, unsigned short *addr, | |||
1641 | sio_data->kind = w83667hg; | 1661 | sio_data->kind = w83667hg; |
1642 | sio_name = sio_name_W83667HG; | 1662 | sio_name = sio_name_W83667HG; |
1643 | break; | 1663 | break; |
1664 | case SIO_W83667HG_B_ID: | ||
1665 | sio_data->kind = w83667hg_b; | ||
1666 | sio_name = sio_name_W83667HG_B; | ||
1667 | break; | ||
1644 | default: | 1668 | default: |
1645 | if (val != 0xffff) | 1669 | if (val != 0xffff) |
1646 | pr_debug(DRVNAME ": unsupported chip ID: 0x%04x\n", | 1670 | pr_debug(DRVNAME ": unsupported chip ID: 0x%04x\n", |