diff options
Diffstat (limited to 'drivers/hwmon/w83627ehf.c')
-rw-r--r-- | drivers/hwmon/w83627ehf.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c index 2dfae7d7cc5b..5276d1933dbc 100644 --- a/drivers/hwmon/w83627ehf.c +++ b/drivers/hwmon/w83627ehf.c | |||
@@ -1920,9 +1920,26 @@ w83627ehf_check_fan_inputs(const struct w83627ehf_sio_data *sio_data, | |||
1920 | fan4min = 0; | 1920 | fan4min = 0; |
1921 | fan5pin = 0; | 1921 | fan5pin = 0; |
1922 | } else if (sio_data->kind == nct6776) { | 1922 | } else if (sio_data->kind == nct6776) { |
1923 | fan3pin = !(superio_inb(sio_data->sioreg, 0x24) & 0x40); | 1923 | bool gpok = superio_inb(sio_data->sioreg, 0x27) & 0x80; |
1924 | fan4pin = !!(superio_inb(sio_data->sioreg, 0x1C) & 0x01); | 1924 | |
1925 | fan5pin = !!(superio_inb(sio_data->sioreg, 0x1C) & 0x02); | 1925 | superio_select(sio_data->sioreg, W83627EHF_LD_HWM); |
1926 | regval = superio_inb(sio_data->sioreg, SIO_REG_ENABLE); | ||
1927 | |||
1928 | if (regval & 0x80) | ||
1929 | fan3pin = gpok; | ||
1930 | else | ||
1931 | fan3pin = !(superio_inb(sio_data->sioreg, 0x24) & 0x40); | ||
1932 | |||
1933 | if (regval & 0x40) | ||
1934 | fan4pin = gpok; | ||
1935 | else | ||
1936 | fan4pin = !!(superio_inb(sio_data->sioreg, 0x1C) & 0x01); | ||
1937 | |||
1938 | if (regval & 0x20) | ||
1939 | fan5pin = gpok; | ||
1940 | else | ||
1941 | fan5pin = !!(superio_inb(sio_data->sioreg, 0x1C) & 0x02); | ||
1942 | |||
1926 | fan4min = fan4pin; | 1943 | fan4min = fan4pin; |
1927 | } else if (sio_data->kind == w83667hg || sio_data->kind == w83667hg_b) { | 1944 | } else if (sio_data->kind == w83667hg || sio_data->kind == w83667hg_b) { |
1928 | fan3pin = 1; | 1945 | fan3pin = 1; |
@@ -2337,11 +2354,6 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) | |||
2337 | for (i = 0; i < data->pwm_num; i++) | 2354 | for (i = 0; i < data->pwm_num; i++) |
2338 | data->pwm_enable_orig[i] = data->pwm_enable[i]; | 2355 | data->pwm_enable_orig[i] = data->pwm_enable[i]; |
2339 | 2356 | ||
2340 | /* Read pwm data to save original values */ | ||
2341 | w83627ehf_update_pwm_common(dev, data); | ||
2342 | for (i = 0; i < data->pwm_num; i++) | ||
2343 | data->pwm_enable_orig[i] = data->pwm_enable[i]; | ||
2344 | |||
2345 | /* Register sysfs hooks */ | 2357 | /* Register sysfs hooks */ |
2346 | for (i = 0; i < ARRAY_SIZE(sda_sf3_arrays); i++) { | 2358 | for (i = 0; i < ARRAY_SIZE(sda_sf3_arrays); i++) { |
2347 | err = device_create_file(dev, &sda_sf3_arrays[i].dev_attr); | 2359 | err = device_create_file(dev, &sda_sf3_arrays[i].dev_attr); |