aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/hwmon/it8733
-rw-r--r--drivers/hwmon/Kconfig4
-rw-r--r--drivers/hwmon/it87.c61
3 files changed, 74 insertions, 24 deletions
diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87
index aff680784222..a45044e82662 100644
--- a/Documentation/hwmon/it87
+++ b/Documentation/hwmon/it87
@@ -18,6 +18,12 @@ Supported chips:
18 Addresses scanned: from Super I/O config space (8 I/O ports) 18 Addresses scanned: from Super I/O config space (8 I/O ports)
19 Datasheet: Publicly available at the ITE website 19 Datasheet: Publicly available at the ITE website
20 http://www.ite.com.tw/product_info/file/pc/IT8716F_V0.3.ZIP 20 http://www.ite.com.tw/product_info/file/pc/IT8716F_V0.3.ZIP
21 * IT8718F
22 Prefix: 'it8718'
23 Addresses scanned: from Super I/O config space (8 I/O ports)
24 Datasheet: Publicly available at the ITE website
25 http://www.ite.com.tw/product_info/file/pc/IT8718F_V0.2.zip
26 http://www.ite.com.tw/product_info/file/pc/IT8718F_V0%203_(for%20C%20version).zip
21 * SiS950 [clone of IT8705F] 27 * SiS950 [clone of IT8705F]
22 Prefix: 'it87' 28 Prefix: 'it87'
23 Addresses scanned: from Super I/O config space (8 I/O ports) 29 Addresses scanned: from Super I/O config space (8 I/O ports)
@@ -48,8 +54,8 @@ Module Parameters
48Description 54Description
49----------- 55-----------
50 56
51This driver implements support for the IT8705F, IT8712F, IT8716F and 57This driver implements support for the IT8705F, IT8712F, IT8716F,
52SiS950 chips. 58IT8718F and SiS950 chips.
53 59
54These chips are 'Super I/O chips', supporting floppy disks, infrared ports, 60These chips are 'Super I/O chips', supporting floppy disks, infrared ports,
55joysticks and other miscellaneous stuff. For hardware monitoring, they 61joysticks and other miscellaneous stuff. For hardware monitoring, they
@@ -62,14 +68,21 @@ the IT8716F and late IT8712F have 6. They are shared with other functions
62though, so the functionality may not be available on a given system. 68though, so the functionality may not be available on a given system.
63The driver dumbly assume it is there. 69The driver dumbly assume it is there.
64 70
65The IT8716F and later IT8712F revisions have support for 2 additional 71The IT8718F also features VID inputs (up to 8 pins) but the value is
66fans. They are not yet supported by the driver. 72stored in the Super-I/O configuration space. Due to technical limitations,
73this value can currently only be read once at initialization time, so
74the driver won't notice and report changes in the VID value. The two
75upper VID bits share their pins with voltage inputs (in5 and in6) so you
76can't have both on a given board.
77
78The IT8716F, IT8718F and later IT8712F revisions have support for
792 additional fans. They are not yet supported by the driver.
67 80
68The IT8716F and late IT8712F and IT8705F also have optional 16-bit 81The IT8716F and IT8718F, and late IT8712F and IT8705F also have optional
69tachometer counters for fans 1 to 3. This is better (no more fan 8216-bit tachometer counters for fans 1 to 3. This is better (no more fan
70clock divider mess) but not compatible with the older chips and 83clock divider mess) but not compatible with the older chips and
71revisions. For now, the driver only uses the 16-bit mode on the 84revisions. For now, the driver only uses the 16-bit mode on the
72IT8716F. 85IT8716F and IT8718F.
73 86
74Temperatures are measured in degrees Celsius. An alarm is triggered once 87Temperatures are measured in degrees Celsius. An alarm is triggered once
75when the Overtemperature Shutdown limit is crossed. 88when the Overtemperature Shutdown limit is crossed.
@@ -89,9 +102,9 @@ zero'; this is important for negative voltage measurements. All voltage
89inputs can measure voltages between 0 and 4.08 volts, with a resolution of 102inputs can measure voltages between 0 and 4.08 volts, with a resolution of
900.016 volt. The battery voltage in8 does not have limit registers. 1030.016 volt. The battery voltage in8 does not have limit registers.
91 104
92The VID lines (IT8712F/IT8716F) encode the core voltage value: the voltage 105The VID lines (IT8712F/IT8716F/IT8718F) encode the core voltage value:
93level your processor should work with. This is hardcoded by the mainboard 106the voltage level your processor should work with. This is hardcoded by
94and/or processor itself. It is a value in volts. 107the mainboard and/or processor itself. It is a value in volts.
95 108
96If an alarm triggers, it will remain triggered until the hardware register 109If an alarm triggers, it will remain triggered until the hardware register
97is read at least once. This means that the cause for the alarm may already 110is read at least once. This means that the cause for the alarm may already
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index cefb1adf4534..78c237f8fa0a 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -186,8 +186,8 @@ config SENSORS_IT87
186 select I2C_ISA 186 select I2C_ISA
187 select HWMON_VID 187 select HWMON_VID
188 help 188 help
189 If you say yes here you get support for ITE IT8705F, IT8712F and 189 If you say yes here you get support for ITE IT8705F, IT8712F,
190 IT8716F sensor chips, and the SiS960 clone. 190 IT8716F and IT8718F sensor chips, and the SiS960 clone.
191 191
192 This driver can also be built as a module. If so, the module 192 This driver can also be built as a module. If so, the module
193 will be called it87. 193 will be called it87.
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index e9ab8a32903b..956cd553c711 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -5,6 +5,7 @@
5 Supports: IT8705F Super I/O chip w/LPC interface 5 Supports: IT8705F Super I/O chip w/LPC interface
6 IT8712F Super I/O chip w/LPC interface & SMBus 6 IT8712F Super I/O chip w/LPC interface & SMBus
7 IT8716F Super I/O chip w/LPC interface 7 IT8716F Super I/O chip w/LPC interface
8 IT8718F Super I/O chip w/LPC interface
8 Sis950 A clone of the IT8705F 9 Sis950 A clone of the IT8705F
9 10
10 Copyright (C) 2001 Chris Gauthron <chrisg@0-in.com> 11 Copyright (C) 2001 Chris Gauthron <chrisg@0-in.com>
@@ -51,12 +52,13 @@ static unsigned short normal_i2c[] = { 0x2d, I2C_CLIENT_END };
51static unsigned short isa_address; 52static unsigned short isa_address;
52 53
53/* Insmod parameters */ 54/* Insmod parameters */
54I2C_CLIENT_INSMOD_3(it87, it8712, it8716); 55I2C_CLIENT_INSMOD_4(it87, it8712, it8716, it8718);
55 56
56#define REG 0x2e /* The register to read/write */ 57#define REG 0x2e /* The register to read/write */
57#define DEV 0x07 /* Register: Logical device select */ 58#define DEV 0x07 /* Register: Logical device select */
58#define VAL 0x2f /* The value to read/write */ 59#define VAL 0x2f /* The value to read/write */
59#define PME 0x04 /* The device with the fan registers in it */ 60#define PME 0x04 /* The device with the fan registers in it */
61#define GPIO 0x07 /* The device with the IT8718F VID value in it */
60#define DEVID 0x20 /* Register: Device ID */ 62#define DEVID 0x20 /* Register: Device ID */
61#define DEVREV 0x22 /* Register: Device Revision */ 63#define DEVREV 0x22 /* Register: Device Revision */
62 64
@@ -78,10 +80,10 @@ static int superio_inw(int reg)
78} 80}
79 81
80static inline void 82static inline void
81superio_select(void) 83superio_select(int ldn)
82{ 84{
83 outb(DEV, REG); 85 outb(DEV, REG);
84 outb(PME, VAL); 86 outb(ldn, VAL);
85} 87}
86 88
87static inline void 89static inline void
@@ -100,21 +102,27 @@ superio_exit(void)
100 outb(0x02, VAL); 102 outb(0x02, VAL);
101} 103}
102 104
105/* Logical device 4 registers */
103#define IT8712F_DEVID 0x8712 106#define IT8712F_DEVID 0x8712
104#define IT8705F_DEVID 0x8705 107#define IT8705F_DEVID 0x8705
105#define IT8716F_DEVID 0x8716 108#define IT8716F_DEVID 0x8716
109#define IT8718F_DEVID 0x8718
106#define IT87_ACT_REG 0x30 110#define IT87_ACT_REG 0x30
107#define IT87_BASE_REG 0x60 111#define IT87_BASE_REG 0x60
108 112
113/* Logical device 7 registers (IT8712F and later) */
114#define IT87_SIO_PINX2_REG 0x2c /* Pin selection */
115#define IT87_SIO_VID_REG 0xfc /* VID value */
116
109/* Update battery voltage after every reading if true */ 117/* Update battery voltage after every reading if true */
110static int update_vbat; 118static int update_vbat;
111 119
112/* Not all BIOSes properly configure the PWM registers */ 120/* Not all BIOSes properly configure the PWM registers */
113static int fix_pwm_polarity; 121static int fix_pwm_polarity;
114 122
115/* Chip Type */ 123/* Values read from Super-I/O config space */
116
117static u16 chip_type; 124static u16 chip_type;
125static u8 vid_value;
118 126
119/* Many IT87 constants specified below */ 127/* Many IT87 constants specified below */
120 128
@@ -133,6 +141,8 @@ static u16 chip_type;
133#define IT87_REG_ALARM2 0x02 141#define IT87_REG_ALARM2 0x02
134#define IT87_REG_ALARM3 0x03 142#define IT87_REG_ALARM3 0x03
135 143
144/* The IT8718F has the VID value in a different register, in Super-I/O
145 configuration space. */
136#define IT87_REG_VID 0x0a 146#define IT87_REG_VID 0x0a
137/* Warning: register 0x0b is used for something completely different in 147/* Warning: register 0x0b is used for something completely different in
138 new chips/revisions. I suspect only 16-bit tachometer mode will work 148 new chips/revisions. I suspect only 16-bit tachometer mode will work
@@ -793,10 +803,11 @@ static int __init it87_find(unsigned short *address)
793 chip_type = superio_inw(DEVID); 803 chip_type = superio_inw(DEVID);
794 if (chip_type != IT8712F_DEVID 804 if (chip_type != IT8712F_DEVID
795 && chip_type != IT8716F_DEVID 805 && chip_type != IT8716F_DEVID
806 && chip_type != IT8718F_DEVID
796 && chip_type != IT8705F_DEVID) 807 && chip_type != IT8705F_DEVID)
797 goto exit; 808 goto exit;
798 809
799 superio_select(); 810 superio_select(PME);
800 if (!(superio_inb(IT87_ACT_REG) & 0x01)) { 811 if (!(superio_inb(IT87_ACT_REG) & 0x01)) {
801 pr_info("it87: Device not activated, skipping\n"); 812 pr_info("it87: Device not activated, skipping\n");
802 goto exit; 813 goto exit;
@@ -812,6 +823,21 @@ static int __init it87_find(unsigned short *address)
812 pr_info("it87: Found IT%04xF chip at 0x%x, revision %d\n", 823 pr_info("it87: Found IT%04xF chip at 0x%x, revision %d\n",
813 chip_type, *address, superio_inb(DEVREV) & 0x0f); 824 chip_type, *address, superio_inb(DEVREV) & 0x0f);
814 825
826 /* Read GPIO config and VID value from LDN 7 (GPIO) */
827 if (chip_type != IT8705F_DEVID) {
828 int reg;
829
830 superio_select(GPIO);
831 if (chip_type == it8718)
832 vid_value = superio_inb(IT87_SIO_VID_REG);
833
834 reg = superio_inb(IT87_SIO_PINX2_REG);
835 if (reg & (1 << 0))
836 pr_info("it87: in3 is VCC (+5V)\n");
837 if (reg & (1 << 1))
838 pr_info("it87: in7 is VCCH (+5V Stand-By)\n");
839 }
840
815exit: 841exit:
816 superio_exit(); 842 superio_exit();
817 return err; 843 return err;
@@ -880,6 +906,9 @@ static int it87_detect(struct i2c_adapter *adapter, int address, int kind)
880 case IT8716F_DEVID: 906 case IT8716F_DEVID:
881 kind = it8716; 907 kind = it8716;
882 break; 908 break;
909 case IT8718F_DEVID:
910 kind = it8718;
911 break;
883 } 912 }
884 } 913 }
885 } 914 }
@@ -900,6 +929,8 @@ static int it87_detect(struct i2c_adapter *adapter, int address, int kind)
900 name = "it8712"; 929 name = "it8712";
901 } else if (kind == it8716) { 930 } else if (kind == it8716) {
902 name = "it8716"; 931 name = "it8716";
932 } else if (kind == it8718) {
933 name = "it8718";
903 } 934 }
904 935
905 /* Fill in the remaining client fields and put it into the global list */ 936 /* Fill in the remaining client fields and put it into the global list */
@@ -969,7 +1000,8 @@ static int it87_detect(struct i2c_adapter *adapter, int address, int kind)
969 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_type.dev_attr); 1000 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_type.dev_attr);
970 1001
971 /* Do not create fan files for disabled fans */ 1002 /* Do not create fan files for disabled fans */
972 if (data->type == it8716) { /* 16-bit tachometers */ 1003 if (data->type == it8716 || data->type == it8718) {
1004 /* 16-bit tachometers */
973 if (data->has_fan & (1 << 0)) { 1005 if (data->has_fan & (1 << 0)) {
974 device_create_file(&new_client->dev, 1006 device_create_file(&new_client->dev,
975 &sensor_dev_attr_fan1_input16.dev_attr); 1007 &sensor_dev_attr_fan1_input16.dev_attr);
@@ -989,6 +1021,7 @@ static int it87_detect(struct i2c_adapter *adapter, int address, int kind)
989 &sensor_dev_attr_fan3_min16.dev_attr); 1021 &sensor_dev_attr_fan3_min16.dev_attr);
990 } 1022 }
991 } else { 1023 } else {
1024 /* 8-bit tachometers with clock divider */
992 if (data->has_fan & (1 << 0)) { 1025 if (data->has_fan & (1 << 0)) {
993 device_create_file(&new_client->dev, 1026 device_create_file(&new_client->dev,
994 &sensor_dev_attr_fan1_input.dev_attr); 1027 &sensor_dev_attr_fan1_input.dev_attr);
@@ -1025,8 +1058,11 @@ static int it87_detect(struct i2c_adapter *adapter, int address, int kind)
1025 device_create_file(&new_client->dev, &sensor_dev_attr_pwm3.dev_attr); 1058 device_create_file(&new_client->dev, &sensor_dev_attr_pwm3.dev_attr);
1026 } 1059 }
1027 1060
1028 if (data->type == it8712 || data->type == it8716) { 1061 if (data->type == it8712 || data->type == it8716
1062 || data->type == it8718) {
1029 data->vrm = vid_which_vrm(); 1063 data->vrm = vid_which_vrm();
1064 /* VID reading from Super-I/O config space if available */
1065 data->vid = vid_value;
1030 device_create_file_vrm(new_client); 1066 device_create_file_vrm(new_client);
1031 device_create_file_vid(new_client); 1067 device_create_file_vid(new_client);
1032 } 1068 }
@@ -1192,7 +1228,7 @@ static void it87_init_client(struct i2c_client *client, struct it87_data *data)
1192 data->has_fan = (data->fan_main_ctrl >> 4) & 0x07; 1228 data->has_fan = (data->fan_main_ctrl >> 4) & 0x07;
1193 1229
1194 /* Set tachometers to 16-bit mode if needed */ 1230 /* Set tachometers to 16-bit mode if needed */
1195 if (data->type == it8716) { 1231 if (data->type == it8716 || data->type == it8718) {
1196 tmp = it87_read_value(client, IT87_REG_FAN_16BIT); 1232 tmp = it87_read_value(client, IT87_REG_FAN_16BIT);
1197 if (~tmp & 0x07 & data->has_fan) { 1233 if (~tmp & 0x07 & data->has_fan) {
1198 dev_dbg(&client->dev, 1234 dev_dbg(&client->dev,
@@ -1265,7 +1301,7 @@ static struct it87_data *it87_update_device(struct device *dev)
1265 data->fan[i] = it87_read_value(client, 1301 data->fan[i] = it87_read_value(client,
1266 IT87_REG_FAN(i)); 1302 IT87_REG_FAN(i));
1267 /* Add high byte if in 16-bit mode */ 1303 /* Add high byte if in 16-bit mode */
1268 if (data->type == it8716) { 1304 if (data->type == it8716 || data->type == it8718) {
1269 data->fan[i] |= it87_read_value(client, 1305 data->fan[i] |= it87_read_value(client,
1270 IT87_REG_FANX(i)) << 8; 1306 IT87_REG_FANX(i)) << 8;
1271 data->fan_min[i] |= it87_read_value(client, 1307 data->fan_min[i] |= it87_read_value(client,
@@ -1282,7 +1318,8 @@ static struct it87_data *it87_update_device(struct device *dev)
1282 } 1318 }
1283 1319
1284 /* Newer chips don't have clock dividers */ 1320 /* Newer chips don't have clock dividers */
1285 if ((data->has_fan & 0x07) && data->type != it8716) { 1321 if ((data->has_fan & 0x07) && data->type != it8716
1322 && data->type != it8718) {
1286 i = it87_read_value(client, IT87_REG_FAN_DIV); 1323 i = it87_read_value(client, IT87_REG_FAN_DIV);
1287 data->fan_div[0] = i & 0x07; 1324 data->fan_div[0] = i & 0x07;
1288 data->fan_div[1] = (i >> 3) & 0x07; 1325 data->fan_div[1] = (i >> 3) & 0x07;
@@ -1340,7 +1377,7 @@ static void __exit sm_it87_exit(void)
1340 1377
1341 1378
1342MODULE_AUTHOR("Chris Gauthron <chrisg@0-in.com>"); 1379MODULE_AUTHOR("Chris Gauthron <chrisg@0-in.com>");
1343MODULE_DESCRIPTION("IT8705F/8712F/8716F, SiS950 driver"); 1380MODULE_DESCRIPTION("IT8705F/8712F/8716F/8718F, SiS950 driver");
1344module_param(update_vbat, bool, 0); 1381module_param(update_vbat, bool, 0);
1345MODULE_PARM_DESC(update_vbat, "Update vbat if set else return powerup value"); 1382MODULE_PARM_DESC(update_vbat, "Update vbat if set else return powerup value");
1346module_param(fix_pwm_polarity, bool, 0); 1383module_param(fix_pwm_polarity, bool, 0);