hwmon: (w83627ehf) The W83627DHG has 8 VID pins

While the W83627EHF/EHG has only 6 VID pins, the W83627DHG has 8 VID
pins, to support VRD 11.0. Add support for this.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>

authored by Jean Delvare and committed by Mark M. Hoffman cbe311f2 636866b9

+11 -12
+3 -2
Documentation/hwmon/w83627ehf
··· 23 23 24 24 The chips implement three temperature sensors, five fan rotation 25 25 speed sensors, ten analog voltage sensors (only nine for the 627DHG), one 26 - VID (6 pins), alarms with beep warnings (control unimplemented), and 27 - some automatic fan regulation strategies (plus manual fan control mode). 26 + VID (6 pins for the 627EHF/EHG, 8 pins for the 627DHG), alarms with beep 27 + warnings (control unimplemented), and some automatic fan regulation 28 + strategies (plus manual fan control mode). 28 29 29 30 Temperatures are measured in degrees Celsius and measurement resolution is 1 30 31 degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when
+8 -10
drivers/hwmon/w83627ehf.c
··· 1202 1202 device_remove_file(dev, &sda_temp[i].dev_attr); 1203 1203 1204 1204 device_remove_file(dev, &dev_attr_name); 1205 - if (data->vid != 0x3f) 1206 - device_remove_file(dev, &dev_attr_cpu0_vid); 1205 + device_remove_file(dev, &dev_attr_cpu0_vid); 1207 1206 } 1208 1207 1209 1208 /* Get the monitoring functions started */ ··· 1302 1303 } 1303 1304 } 1304 1305 1305 - data->vid = superio_inb(sio_data->sioreg, SIO_REG_VID_DATA) & 0x3f; 1306 + data->vid = superio_inb(sio_data->sioreg, SIO_REG_VID_DATA); 1307 + if (sio_data->kind == w83627ehf) /* 6 VID pins only */ 1308 + data->vid &= 0x3f; 1309 + 1310 + err = device_create_file(dev, &dev_attr_cpu0_vid); 1311 + if (err) 1312 + goto exit_release; 1306 1313 } else { 1307 1314 dev_info(dev, "VID pins in output mode, CPU VID not " 1308 1315 "available\n"); 1309 - data->vid = 0x3f; 1310 1316 } 1311 1317 1312 1318 /* fan4 and fan5 share some pins with the GPIO and serial flash */ ··· 1393 1389 err = device_create_file(dev, &dev_attr_name); 1394 1390 if (err) 1395 1391 goto exit_remove; 1396 - 1397 - if (data->vid != 0x3f) { 1398 - err = device_create_file(dev, &dev_attr_cpu0_vid); 1399 - if (err) 1400 - goto exit_remove; 1401 - } 1402 1392 1403 1393 data->hwmon_dev = hwmon_device_register(dev); 1404 1394 if (IS_ERR(data->hwmon_dev)) {