aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/it87.c
diff options
context:
space:
mode:
authorJean-Marc Spaggiari <jean-marc@spaggiari.org>2009-01-07 10:37:32 -0500
committerJean Delvare <khali@linux-fr.org>2009-01-07 10:37:32 -0500
commitb4da93e4b0ffc261c3530fe938aefd52854aa84c (patch)
tree2cc727f3d7050187bf4e83f1eee8136d1296f8b8 /drivers/hwmon/it87.c
parent3aed198c35567e5a721f52c0bde23167867e6af6 (diff)
hwmon: (it87) Add support for the ITE IT8720F
Allow it87.c to handle IT8720 chipset like IT8718 in order to retrieve voltage, temperatures and fans speed from sensors tools. Also updating the related documentation. Signed-off-by: Jean-Marc Spaggiari <jean-marc@spaggiari.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/it87.c')
-rw-r--r--drivers/hwmon/it87.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index b74c95735f95..0e0d692f0c9e 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
@@ -52,7 +53,7 @@
52 53
53#define DRVNAME "it87" 54#define DRVNAME "it87"
54 55
55enum chips { it87, it8712, it8716, it8718 }; 56enum chips { it87, it8712, it8716, it8718, it8720 };
56 57
57static unsigned short force_id; 58static unsigned short force_id;
58module_param(force_id, ushort, 0); 59module_param(force_id, ushort, 0);
@@ -64,7 +65,10 @@ static struct platform_device *pdev;
64#define DEV 0x07 /* Register: Logical device select */ 65#define DEV 0x07 /* Register: Logical device select */
65#define VAL 0x2f /* The value to read/write */ 66#define VAL 0x2f /* The value to read/write */
66#define PME 0x04 /* The device with the fan registers in it */ 67#define PME 0x04 /* The device with the fan registers in it */
67#define GPIO 0x07 /* The device with the IT8718F VID value in it */ 68
69/* The device with the IT8718F/IT8720F VID value in it */
70#define GPIO 0x07
71
68#define DEVID 0x20 /* Register: Device ID */ 72#define DEVID 0x20 /* Register: Device ID */
69#define DEVREV 0x22 /* Register: Device Revision */ 73#define DEVREV 0x22 /* Register: Device Revision */
70 74
@@ -113,6 +117,7 @@ superio_exit(void)
113#define IT8705F_DEVID 0x8705 117#define IT8705F_DEVID 0x8705
114#define IT8716F_DEVID 0x8716 118#define IT8716F_DEVID 0x8716
115#define IT8718F_DEVID 0x8718 119#define IT8718F_DEVID 0x8718
120#define IT8720F_DEVID 0x8720
116#define IT8726F_DEVID 0x8726 121#define IT8726F_DEVID 0x8726
117#define IT87_ACT_REG 0x30 122#define IT87_ACT_REG 0x30
118#define IT87_BASE_REG 0x60 123#define IT87_BASE_REG 0x60
@@ -150,8 +155,8 @@ static int fix_pwm_polarity;
150#define IT87_REG_ALARM2 0x02 155#define IT87_REG_ALARM2 0x02
151#define IT87_REG_ALARM3 0x03 156#define IT87_REG_ALARM3 0x03
152 157
153/* The IT8718F has the VID value in a different register, in Super-I/O 158/* The IT8718F and IT8720F have the VID value in a different register, in
154 configuration space. */ 159 Super-I/O configuration space. */
155#define IT87_REG_VID 0x0a 160#define IT87_REG_VID 0x0a
156/* The IT8705F and IT8712F earlier than revision 0x08 use register 0x0b 161/* The IT8705F and IT8712F earlier than revision 0x08 use register 0x0b
157 for fan divisors. Later IT8712F revisions must use 16-bit tachometer 162 for fan divisors. Later IT8712F revisions must use 16-bit tachometer
@@ -282,7 +287,8 @@ static inline int has_16bit_fans(const struct it87_data *data)
282 return (data->type == it87 && data->revision >= 0x03) 287 return (data->type == it87 && data->revision >= 0x03)
283 || (data->type == it8712 && data->revision >= 0x08) 288 || (data->type == it8712 && data->revision >= 0x08)
284 || data->type == it8716 289 || data->type == it8716
285 || data->type == it8718; 290 || data->type == it8718
291 || data->type == it8720;
286} 292}
287 293
288static int it87_probe(struct platform_device *pdev); 294static int it87_probe(struct platform_device *pdev);
@@ -992,6 +998,9 @@ static int __init it87_find(unsigned short *address,
992 case IT8718F_DEVID: 998 case IT8718F_DEVID:
993 sio_data->type = it8718; 999 sio_data->type = it8718;
994 break; 1000 break;
1001 case IT8720F_DEVID:
1002 sio_data->type = it8720;
1003 break;
995 case 0xffff: /* No device at all */ 1004 case 0xffff: /* No device at all */
996 goto exit; 1005 goto exit;
997 default: 1006 default:
@@ -1022,7 +1031,8 @@ static int __init it87_find(unsigned short *address,
1022 int reg; 1031 int reg;
1023 1032
1024 superio_select(GPIO); 1033 superio_select(GPIO);
1025 if (chip_type == it8718) 1034 if ((chip_type == it8718) ||
1035 (chip_type == it8720))
1026 sio_data->vid_value = superio_inb(IT87_SIO_VID_REG); 1036 sio_data->vid_value = superio_inb(IT87_SIO_VID_REG);
1027 1037
1028 reg = superio_inb(IT87_SIO_PINX2_REG); 1038 reg = superio_inb(IT87_SIO_PINX2_REG);
@@ -1068,6 +1078,7 @@ static int __devinit it87_probe(struct platform_device *pdev)
1068 "it8712", 1078 "it8712",
1069 "it8716", 1079 "it8716",
1070 "it8718", 1080 "it8718",
1081 "it8720",
1071 }; 1082 };
1072 1083
1073 res = platform_get_resource(pdev, IORESOURCE_IO, 0); 1084 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
@@ -1226,7 +1237,7 @@ static int __devinit it87_probe(struct platform_device *pdev)
1226 } 1237 }
1227 1238
1228 if (data->type == it8712 || data->type == it8716 1239 if (data->type == it8712 || data->type == it8716
1229 || data->type == it8718) { 1240 || data->type == it8718 || data->type == it8720) {
1230 data->vrm = vid_which_vrm(); 1241 data->vrm = vid_which_vrm();
1231 /* VID reading from Super-I/O config space if available */ 1242 /* VID reading from Super-I/O config space if available */
1232 data->vid = sio_data->vid_value; 1243 data->vid = sio_data->vid_value;
@@ -1513,7 +1524,8 @@ static struct it87_data *it87_update_device(struct device *dev)
1513 1524
1514 data->sensor = it87_read_value(data, IT87_REG_TEMP_ENABLE); 1525 data->sensor = it87_read_value(data, IT87_REG_TEMP_ENABLE);
1515 /* The 8705 does not have VID capability. 1526 /* The 8705 does not have VID capability.
1516 The 8718 does not use IT87_REG_VID for the same purpose. */ 1527 The 8718 and the 8720 don't use IT87_REG_VID for the
1528 same purpose. */
1517 if (data->type == it8712 || data->type == it8716) { 1529 if (data->type == it8712 || data->type == it8716) {
1518 data->vid = it87_read_value(data, IT87_REG_VID); 1530 data->vid = it87_read_value(data, IT87_REG_VID);
1519 /* The older IT8712F revisions had only 5 VID pins, 1531 /* The older IT8712F revisions had only 5 VID pins,
@@ -1608,7 +1620,7 @@ static void __exit sm_it87_exit(void)
1608 1620
1609MODULE_AUTHOR("Chris Gauthron, " 1621MODULE_AUTHOR("Chris Gauthron, "
1610 "Jean Delvare <khali@linux-fr.org>"); 1622 "Jean Delvare <khali@linux-fr.org>");
1611MODULE_DESCRIPTION("IT8705F/8712F/8716F/8718F/8726F, SiS950 driver"); 1623MODULE_DESCRIPTION("IT8705F/8712F/8716F/8718F/8720F/8726F, SiS950 driver");
1612module_param(update_vbat, bool, 0); 1624module_param(update_vbat, bool, 0);
1613MODULE_PARM_DESC(update_vbat, "Update vbat if set else return powerup value"); 1625MODULE_PARM_DESC(update_vbat, "Update vbat if set else return powerup value");
1614module_param(fix_pwm_polarity, bool, 0); 1626module_param(fix_pwm_polarity, bool, 0);