aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/w83627hf.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c
index bbb3dcde146b..27cfde1cd023 100644
--- a/drivers/hwmon/w83627hf.c
+++ b/drivers/hwmon/w83627hf.c
@@ -1122,11 +1122,10 @@ static int w83627hf_detect(struct i2c_adapter *adapter)
1122 if (kind != w83697hf) 1122 if (kind != w83697hf)
1123 device_create_file_temp(new_client, 3); 1123 device_create_file_temp(new_client, 3);
1124 1124
1125 if (kind != w83697hf) 1125 if (kind != w83697hf && data->vid != 0xff) {
1126 device_create_file_vid(new_client); 1126 device_create_file_vid(new_client);
1127
1128 if (kind != w83697hf)
1129 device_create_file_vrm(new_client); 1127 device_create_file_vrm(new_client);
1128 }
1130 1129
1131 device_create_file_fan_div(new_client, 1); 1130 device_create_file_fan_div(new_client, 1);
1132 device_create_file_fan_div(new_client, 2); 1131 device_create_file_fan_div(new_client, 2);
@@ -1232,7 +1231,7 @@ static int w83627thf_read_gpio5(struct i2c_client *client)
1232 1231
1233 /* Make sure the pins are configured for input 1232 /* Make sure the pins are configured for input
1234 There must be at least five (VRM 9), and possibly 6 (VRM 10) */ 1233 There must be at least five (VRM 9), and possibly 6 (VRM 10) */
1235 sel = superio_inb(W83627THF_GPIO5_IOSR); 1234 sel = superio_inb(W83627THF_GPIO5_IOSR) & 0x3f;
1236 if ((sel & 0x1f) != 0x1f) { 1235 if ((sel & 0x1f) != 0x1f) {
1237 dev_dbg(&client->dev, "GPIO5 not configured for VID " 1236 dev_dbg(&client->dev, "GPIO5 not configured for VID "
1238 "function\n"); 1237 "function\n");
@@ -1323,19 +1322,18 @@ static void w83627hf_init_client(struct i2c_client *client)
1323 int hi = w83627hf_read_value(client, W83781D_REG_CHIPID); 1322 int hi = w83627hf_read_value(client, W83781D_REG_CHIPID);
1324 data->vid = (lo & 0x0f) | ((hi & 0x01) << 4); 1323 data->vid = (lo & 0x0f) | ((hi & 0x01) << 4);
1325 } else if (w83627thf == data->type) { 1324 } else if (w83627thf == data->type) {
1326 data->vid = w83627thf_read_gpio5(client) & 0x3f; 1325 data->vid = w83627thf_read_gpio5(client);
1327 } 1326 }
1328 1327
1329 /* Read VRM & OVT Config only once */ 1328 /* Read VRM & OVT Config only once */
1330 if (w83627thf == data->type || w83637hf == data->type) { 1329 if (w83627thf == data->type || w83637hf == data->type) {
1331 data->vrm_ovt = 1330 data->vrm_ovt =
1332 w83627hf_read_value(client, W83627THF_REG_VRM_OVT_CFG); 1331 w83627hf_read_value(client, W83627THF_REG_VRM_OVT_CFG);
1333 data->vrm = (data->vrm_ovt & 0x01) ? 90 : 82;
1334 } else {
1335 /* Convert VID to voltage based on default VRM */
1336 data->vrm = vid_which_vrm();
1337 } 1332 }
1338 1333
1334 /* Convert VID to voltage based on VRM */
1335 data->vrm = vid_which_vrm();
1336
1339 tmp = w83627hf_read_value(client, W83781D_REG_SCFG1); 1337 tmp = w83627hf_read_value(client, W83781D_REG_SCFG1);
1340 for (i = 1; i <= 3; i++) { 1338 for (i = 1; i <= 3; i++) {
1341 if (!(tmp & BIT_SCFG1[i - 1])) { 1339 if (!(tmp & BIT_SCFG1[i - 1])) {