aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/w83627ehf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/w83627ehf.c')
-rw-r--r--drivers/hwmon/w83627ehf.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index d5aa25ce5dbd..075164dd65a7 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -59,6 +59,10 @@ static const char * w83627ehf_device_names[] = {
59 "w83627dhg", 59 "w83627dhg",
60}; 60};
61 61
62static unsigned short force_id;
63module_param(force_id, ushort, 0);
64MODULE_PARM_DESC(force_id, "Override the detected device ID");
65
62#define DRVNAME "w83627ehf" 66#define DRVNAME "w83627ehf"
63 67
64/* 68/*
@@ -1198,8 +1202,7 @@ static void w83627ehf_device_remove_files(struct device *dev)
1198 device_remove_file(dev, &sda_temp[i].dev_attr); 1202 device_remove_file(dev, &sda_temp[i].dev_attr);
1199 1203
1200 device_remove_file(dev, &dev_attr_name); 1204 device_remove_file(dev, &dev_attr_name);
1201 if (data->vid != 0x3f) 1205 device_remove_file(dev, &dev_attr_cpu0_vid);
1202 device_remove_file(dev, &dev_attr_cpu0_vid);
1203} 1206}
1204 1207
1205/* Get the monitoring functions started */ 1208/* Get the monitoring functions started */
@@ -1299,11 +1302,16 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev)
1299 } 1302 }
1300 } 1303 }
1301 1304
1302 data->vid = superio_inb(sio_data->sioreg, SIO_REG_VID_DATA) & 0x3f; 1305 data->vid = superio_inb(sio_data->sioreg, SIO_REG_VID_DATA);
1306 if (sio_data->kind == w83627ehf) /* 6 VID pins only */
1307 data->vid &= 0x3f;
1308
1309 err = device_create_file(dev, &dev_attr_cpu0_vid);
1310 if (err)
1311 goto exit_release;
1303 } else { 1312 } else {
1304 dev_info(dev, "VID pins in output mode, CPU VID not " 1313 dev_info(dev, "VID pins in output mode, CPU VID not "
1305 "available\n"); 1314 "available\n");
1306 data->vid = 0x3f;
1307 } 1315 }
1308 1316
1309 /* fan4 and fan5 share some pins with the GPIO and serial flash */ 1317 /* fan4 and fan5 share some pins with the GPIO and serial flash */
@@ -1386,12 +1394,6 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev)
1386 if (err) 1394 if (err)
1387 goto exit_remove; 1395 goto exit_remove;
1388 1396
1389 if (data->vid != 0x3f) {
1390 err = device_create_file(dev, &dev_attr_cpu0_vid);
1391 if (err)
1392 goto exit_remove;
1393 }
1394
1395 data->hwmon_dev = hwmon_device_register(dev); 1397 data->hwmon_dev = hwmon_device_register(dev);
1396 if (IS_ERR(data->hwmon_dev)) { 1398 if (IS_ERR(data->hwmon_dev)) {
1397 err = PTR_ERR(data->hwmon_dev); 1399 err = PTR_ERR(data->hwmon_dev);
@@ -1445,8 +1447,11 @@ static int __init w83627ehf_find(int sioaddr, unsigned short *addr,
1445 1447
1446 superio_enter(sioaddr); 1448 superio_enter(sioaddr);
1447 1449
1448 val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) 1450 if (force_id)
1449 | superio_inb(sioaddr, SIO_REG_DEVID + 1); 1451 val = force_id;
1452 else
1453 val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8)
1454 | superio_inb(sioaddr, SIO_REG_DEVID + 1);
1450 switch (val & SIO_ID_MASK) { 1455 switch (val & SIO_ID_MASK) {
1451 case SIO_W83627EHF_ID: 1456 case SIO_W83627EHF_ID:
1452 sio_data->kind = w83627ehf; 1457 sio_data->kind = w83627ehf;