aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/it87.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index 6a182e14cf5..ad6c8a31990 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -2,6 +2,14 @@
2 it87.c - Part of lm_sensors, Linux kernel modules for hardware 2 it87.c - Part of lm_sensors, Linux kernel modules for hardware
3 monitoring. 3 monitoring.
4 4
5 The IT8705F is an LPC-based Super I/O part that contains UARTs, a
6 parallel port, an IR port, a MIDI port, a floppy controller, etc., in
7 addition to an Environment Controller (Enhanced Hardware Monitor and
8 Fan Controller)
9
10 This driver supports only the Environment Controller in the IT8705F and
11 similar parts. The other devices are supported by different drivers.
12
5 Supports: IT8705F Super I/O chip w/LPC interface 13 Supports: IT8705F Super I/O chip w/LPC interface
6 IT8712F Super I/O chip w/LPC interface 14 IT8712F Super I/O chip w/LPC interface
7 IT8716F Super I/O chip w/LPC interface 15 IT8716F Super I/O chip w/LPC interface
@@ -118,9 +126,15 @@ static int fix_pwm_polarity;
118/* Length of ISA address segment */ 126/* Length of ISA address segment */
119#define IT87_EXTENT 8 127#define IT87_EXTENT 8
120 128
121/* Where are the ISA address/data registers relative to the base address */ 129/* Length of ISA address segment for Environmental Controller */
122#define IT87_ADDR_REG_OFFSET 5 130#define IT87_EC_EXTENT 2
123#define IT87_DATA_REG_OFFSET 6 131
132/* Offset of EC registers from ISA base address */
133#define IT87_EC_OFFSET 5
134
135/* Where are the ISA address/data registers relative to the EC base address */
136#define IT87_ADDR_REG_OFFSET 0
137#define IT87_DATA_REG_OFFSET 1
124 138
125/*----- The IT87 registers -----*/ 139/*----- The IT87 registers -----*/
126 140
@@ -968,10 +982,10 @@ static int __devinit it87_probe(struct platform_device *pdev)
968 }; 982 };
969 983
970 res = platform_get_resource(pdev, IORESOURCE_IO, 0); 984 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
971 if (!request_region(res->start, IT87_EXTENT, DRVNAME)) { 985 if (!request_region(res->start, IT87_EC_EXTENT, DRVNAME)) {
972 dev_err(dev, "Failed to request region 0x%lx-0x%lx\n", 986 dev_err(dev, "Failed to request region 0x%lx-0x%lx\n",
973 (unsigned long)res->start, 987 (unsigned long)res->start,
974 (unsigned long)(res->start + IT87_EXTENT - 1)); 988 (unsigned long)(res->start + IT87_EC_EXTENT - 1));
975 err = -EBUSY; 989 err = -EBUSY;
976 goto ERROR0; 990 goto ERROR0;
977 } 991 }
@@ -1124,7 +1138,7 @@ ERROR2:
1124 platform_set_drvdata(pdev, NULL); 1138 platform_set_drvdata(pdev, NULL);
1125 kfree(data); 1139 kfree(data);
1126ERROR1: 1140ERROR1:
1127 release_region(res->start, IT87_EXTENT); 1141 release_region(res->start, IT87_EC_EXTENT);
1128ERROR0: 1142ERROR0:
1129 return err; 1143 return err;
1130} 1144}
@@ -1137,7 +1151,7 @@ static int __devexit it87_remove(struct platform_device *pdev)
1137 sysfs_remove_group(&pdev->dev.kobj, &it87_group); 1151 sysfs_remove_group(&pdev->dev.kobj, &it87_group);
1138 sysfs_remove_group(&pdev->dev.kobj, &it87_group_opt); 1152 sysfs_remove_group(&pdev->dev.kobj, &it87_group_opt);
1139 1153
1140 release_region(data->addr, IT87_EXTENT); 1154 release_region(data->addr, IT87_EC_EXTENT);
1141 platform_set_drvdata(pdev, NULL); 1155 platform_set_drvdata(pdev, NULL);
1142 kfree(data); 1156 kfree(data);
1143 1157
@@ -1402,8 +1416,8 @@ static int __init it87_device_add(unsigned short address,
1402 const struct it87_sio_data *sio_data) 1416 const struct it87_sio_data *sio_data)
1403{ 1417{
1404 struct resource res = { 1418 struct resource res = {
1405 .start = address , 1419 .start = address + IT87_EC_OFFSET,
1406 .end = address + IT87_EXTENT - 1, 1420 .end = address + IT87_EC_OFFSET + IT87_EC_EXTENT - 1,
1407 .name = DRVNAME, 1421 .name = DRVNAME,
1408 .flags = IORESOURCE_IO, 1422 .flags = IORESOURCE_IO,
1409 }; 1423 };