diff options
Diffstat (limited to 'drivers/hwmon/it87.c')
-rw-r--r-- | drivers/hwmon/it87.c | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index b74c95735f95..95a99c590da2 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
@@ -14,6 +14,7 @@ | |||
14 | IT8712F Super I/O chip w/LPC interface | 14 | IT8712F Super I/O chip w/LPC interface |
15 | IT8716F Super I/O chip w/LPC interface | 15 | IT8716F Super I/O chip w/LPC interface |
16 | IT8718F Super I/O chip w/LPC interface | 16 | IT8718F Super I/O chip w/LPC interface |
17 | IT8720F Super I/O chip w/LPC interface | ||
17 | IT8726F Super I/O chip w/LPC interface | 18 | IT8726F Super I/O chip w/LPC interface |
18 | Sis950 A clone of the IT8705F | 19 | Sis950 A clone of the IT8705F |
19 | 20 | ||
@@ -48,11 +49,12 @@ | |||
48 | #include <linux/sysfs.h> | 49 | #include <linux/sysfs.h> |
49 | #include <linux/string.h> | 50 | #include <linux/string.h> |
50 | #include <linux/dmi.h> | 51 | #include <linux/dmi.h> |
52 | #include <linux/acpi.h> | ||
51 | #include <asm/io.h> | 53 | #include <asm/io.h> |
52 | 54 | ||
53 | #define DRVNAME "it87" | 55 | #define DRVNAME "it87" |
54 | 56 | ||
55 | enum chips { it87, it8712, it8716, it8718 }; | 57 | enum chips { it87, it8712, it8716, it8718, it8720 }; |
56 | 58 | ||
57 | static unsigned short force_id; | 59 | static unsigned short force_id; |
58 | module_param(force_id, ushort, 0); | 60 | module_param(force_id, ushort, 0); |
@@ -64,7 +66,10 @@ static struct platform_device *pdev; | |||
64 | #define DEV 0x07 /* Register: Logical device select */ | 66 | #define DEV 0x07 /* Register: Logical device select */ |
65 | #define VAL 0x2f /* The value to read/write */ | 67 | #define VAL 0x2f /* The value to read/write */ |
66 | #define PME 0x04 /* The device with the fan registers in it */ | 68 | #define PME 0x04 /* The device with the fan registers in it */ |
67 | #define GPIO 0x07 /* The device with the IT8718F VID value in it */ | 69 | |
70 | /* The device with the IT8718F/IT8720F VID value in it */ | ||
71 | #define GPIO 0x07 | ||
72 | |||
68 | #define DEVID 0x20 /* Register: Device ID */ | 73 | #define DEVID 0x20 /* Register: Device ID */ |
69 | #define DEVREV 0x22 /* Register: Device Revision */ | 74 | #define DEVREV 0x22 /* Register: Device Revision */ |
70 | 75 | ||
@@ -113,6 +118,7 @@ superio_exit(void) | |||
113 | #define IT8705F_DEVID 0x8705 | 118 | #define IT8705F_DEVID 0x8705 |
114 | #define IT8716F_DEVID 0x8716 | 119 | #define IT8716F_DEVID 0x8716 |
115 | #define IT8718F_DEVID 0x8718 | 120 | #define IT8718F_DEVID 0x8718 |
121 | #define IT8720F_DEVID 0x8720 | ||
116 | #define IT8726F_DEVID 0x8726 | 122 | #define IT8726F_DEVID 0x8726 |
117 | #define IT87_ACT_REG 0x30 | 123 | #define IT87_ACT_REG 0x30 |
118 | #define IT87_BASE_REG 0x60 | 124 | #define IT87_BASE_REG 0x60 |
@@ -150,8 +156,8 @@ static int fix_pwm_polarity; | |||
150 | #define IT87_REG_ALARM2 0x02 | 156 | #define IT87_REG_ALARM2 0x02 |
151 | #define IT87_REG_ALARM3 0x03 | 157 | #define IT87_REG_ALARM3 0x03 |
152 | 158 | ||
153 | /* The IT8718F has the VID value in a different register, in Super-I/O | 159 | /* The IT8718F and IT8720F have the VID value in a different register, in |
154 | configuration space. */ | 160 | Super-I/O configuration space. */ |
155 | #define IT87_REG_VID 0x0a | 161 | #define IT87_REG_VID 0x0a |
156 | /* The IT8705F and IT8712F earlier than revision 0x08 use register 0x0b | 162 | /* The IT8705F and IT8712F earlier than revision 0x08 use register 0x0b |
157 | for fan divisors. Later IT8712F revisions must use 16-bit tachometer | 163 | for fan divisors. Later IT8712F revisions must use 16-bit tachometer |
@@ -282,7 +288,8 @@ static inline int has_16bit_fans(const struct it87_data *data) | |||
282 | return (data->type == it87 && data->revision >= 0x03) | 288 | return (data->type == it87 && data->revision >= 0x03) |
283 | || (data->type == it8712 && data->revision >= 0x08) | 289 | || (data->type == it8712 && data->revision >= 0x08) |
284 | || data->type == it8716 | 290 | || data->type == it8716 |
285 | || data->type == it8718; | 291 | || data->type == it8718 |
292 | || data->type == it8720; | ||
286 | } | 293 | } |
287 | 294 | ||
288 | static int it87_probe(struct platform_device *pdev); | 295 | static int it87_probe(struct platform_device *pdev); |
@@ -992,6 +999,9 @@ static int __init it87_find(unsigned short *address, | |||
992 | case IT8718F_DEVID: | 999 | case IT8718F_DEVID: |
993 | sio_data->type = it8718; | 1000 | sio_data->type = it8718; |
994 | break; | 1001 | break; |
1002 | case IT8720F_DEVID: | ||
1003 | sio_data->type = it8720; | ||
1004 | break; | ||
995 | case 0xffff: /* No device at all */ | 1005 | case 0xffff: /* No device at all */ |
996 | goto exit; | 1006 | goto exit; |
997 | default: | 1007 | default: |
@@ -1022,7 +1032,8 @@ static int __init it87_find(unsigned short *address, | |||
1022 | int reg; | 1032 | int reg; |
1023 | 1033 | ||
1024 | superio_select(GPIO); | 1034 | superio_select(GPIO); |
1025 | if (chip_type == it8718) | 1035 | if ((chip_type == it8718) || |
1036 | (chip_type == it8720)) | ||
1026 | sio_data->vid_value = superio_inb(IT87_SIO_VID_REG); | 1037 | sio_data->vid_value = superio_inb(IT87_SIO_VID_REG); |
1027 | 1038 | ||
1028 | reg = superio_inb(IT87_SIO_PINX2_REG); | 1039 | reg = superio_inb(IT87_SIO_PINX2_REG); |
@@ -1068,6 +1079,7 @@ static int __devinit it87_probe(struct platform_device *pdev) | |||
1068 | "it8712", | 1079 | "it8712", |
1069 | "it8716", | 1080 | "it8716", |
1070 | "it8718", | 1081 | "it8718", |
1082 | "it8720", | ||
1071 | }; | 1083 | }; |
1072 | 1084 | ||
1073 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); | 1085 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); |
@@ -1226,7 +1238,7 @@ static int __devinit it87_probe(struct platform_device *pdev) | |||
1226 | } | 1238 | } |
1227 | 1239 | ||
1228 | if (data->type == it8712 || data->type == it8716 | 1240 | if (data->type == it8712 || data->type == it8716 |
1229 | || data->type == it8718) { | 1241 | || data->type == it8718 || data->type == it8720) { |
1230 | data->vrm = vid_which_vrm(); | 1242 | data->vrm = vid_which_vrm(); |
1231 | /* VID reading from Super-I/O config space if available */ | 1243 | /* VID reading from Super-I/O config space if available */ |
1232 | data->vid = sio_data->vid_value; | 1244 | data->vid = sio_data->vid_value; |
@@ -1374,7 +1386,7 @@ static void __devinit it87_init_device(struct platform_device *pdev) | |||
1374 | it87_write_value(data, IT87_REG_TEMP_HIGH(i), 127); | 1386 | it87_write_value(data, IT87_REG_TEMP_HIGH(i), 127); |
1375 | } | 1387 | } |
1376 | 1388 | ||
1377 | /* Check if temperature channnels are reset manually or by some reason */ | 1389 | /* Check if temperature channels are reset manually or by some reason */ |
1378 | tmp = it87_read_value(data, IT87_REG_TEMP_ENABLE); | 1390 | tmp = it87_read_value(data, IT87_REG_TEMP_ENABLE); |
1379 | if ((tmp & 0x3f) == 0) { | 1391 | if ((tmp & 0x3f) == 0) { |
1380 | /* Temp1,Temp3=thermistor; Temp2=thermal diode */ | 1392 | /* Temp1,Temp3=thermistor; Temp2=thermal diode */ |
@@ -1513,7 +1525,8 @@ static struct it87_data *it87_update_device(struct device *dev) | |||
1513 | 1525 | ||
1514 | data->sensor = it87_read_value(data, IT87_REG_TEMP_ENABLE); | 1526 | data->sensor = it87_read_value(data, IT87_REG_TEMP_ENABLE); |
1515 | /* The 8705 does not have VID capability. | 1527 | /* The 8705 does not have VID capability. |
1516 | The 8718 does not use IT87_REG_VID for the same purpose. */ | 1528 | The 8718 and the 8720 don't use IT87_REG_VID for the |
1529 | same purpose. */ | ||
1517 | if (data->type == it8712 || data->type == it8716) { | 1530 | if (data->type == it8712 || data->type == it8716) { |
1518 | data->vid = it87_read_value(data, IT87_REG_VID); | 1531 | data->vid = it87_read_value(data, IT87_REG_VID); |
1519 | /* The older IT8712F revisions had only 5 VID pins, | 1532 | /* The older IT8712F revisions had only 5 VID pins, |
@@ -1540,6 +1553,10 @@ static int __init it87_device_add(unsigned short address, | |||
1540 | }; | 1553 | }; |
1541 | int err; | 1554 | int err; |
1542 | 1555 | ||
1556 | err = acpi_check_resource_conflict(&res); | ||
1557 | if (err) | ||
1558 | goto exit; | ||
1559 | |||
1543 | pdev = platform_device_alloc(DRVNAME, address); | 1560 | pdev = platform_device_alloc(DRVNAME, address); |
1544 | if (!pdev) { | 1561 | if (!pdev) { |
1545 | err = -ENOMEM; | 1562 | err = -ENOMEM; |
@@ -1608,7 +1625,7 @@ static void __exit sm_it87_exit(void) | |||
1608 | 1625 | ||
1609 | MODULE_AUTHOR("Chris Gauthron, " | 1626 | MODULE_AUTHOR("Chris Gauthron, " |
1610 | "Jean Delvare <khali@linux-fr.org>"); | 1627 | "Jean Delvare <khali@linux-fr.org>"); |
1611 | MODULE_DESCRIPTION("IT8705F/8712F/8716F/8718F/8726F, SiS950 driver"); | 1628 | MODULE_DESCRIPTION("IT8705F/8712F/8716F/8718F/8720F/8726F, SiS950 driver"); |
1612 | module_param(update_vbat, bool, 0); | 1629 | module_param(update_vbat, bool, 0); |
1613 | MODULE_PARM_DESC(update_vbat, "Update vbat if set else return powerup value"); | 1630 | MODULE_PARM_DESC(update_vbat, "Update vbat if set else return powerup value"); |
1614 | module_param(fix_pwm_polarity, bool, 0); | 1631 | module_param(fix_pwm_polarity, bool, 0); |