forked from Minki/linux
Five patches since v3.3-rc7:
fecfb64
hwmon: (zl6100) Enable interval between chip accesses for all chipsc43524b
hwmon: (w83627ehf) Describe undocumented pwm attributesaacb6b0
hwmon: (w83627ehf) Fix temp2 source for W83627UHG32260d9
hwmon: (w83627ehf) Fix memory leak in probe function33fa9b6
hwmon: (w83627ehf) Fix writing into fan_stop_time for NCT6775F/NCT6776F -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAABAgAGBQJPYNeWAAoJEMsfJm/On5mBDYwP/RlQHZAQpars+Bw50A+MauP0 ifYNGAWYo9WE2J6spd9LST0ESycLW74Lg/PJMbq/zfbFS3OgaKfS5nKcHTOmhyyC dyDdekrcvQpYDBWnE+Ir3nKeJ/byHbnog7SOs+AEHmE8gc66jc1s/La93b669odA /cHN0FGST83b0qu+UEEkC8Xv1Y/rp52vF4GaZZEM7bA1tgWxY7u15d2A2lsj7il1 aiVCublpSHBhDs9W5SEaZKJOEkETX0CDnx95txIwl+4SFhL6XymqZmymlSIKT8rv FkxWckbI/qV4a7NQ3tI+QZw18YGn+kbIIkTfuhjxZiWrZB8Kd3VRbdyNcFEGDLCU h1dNAcBcE1eXf2GUe9wPxs11LbFEN5ZmDxX1Z32LfOxwi+9nd7C+MLoabxx1A/Hp aav6q8VA5NNKj4iDwbKx6+hjVkUkglzHw4QPGd+Htaq2htiZKYHQAG2qAIMGQHf2 aa2ATAajx+n7O4U3fcf5hDBx9+Swg8EkuwN787wQdyfB/6X95JiGpkJrgKWFYiyt 4ba7cOe/PhoGW6qFUEB+uVmiHTwJbI+WSS5RIXX/PZLvcxxqa4AhNd5L55tsghfd Ylh71Y5nL/NBt7JW/gkEeyuulD5dSYmfiabytb/KzrC3ek6Uj36mB78/eTJukESg PLMy0g9gtuuwmm7tjHxB =3+SR -----END PGP SIGNATURE----- Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck. * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (zl6100) Enable interval between chip accesses for all chips hwmon: (w83627ehf) Describe undocumented pwm attributes hwmon: (w83627ehf) Fix temp2 source for W83627UHG hwmon: (w83627ehf) Fix memory leak in probe function hwmon: (w83627ehf) Fix writing into fan_stop_time for NCT6775F/NCT6776F
This commit is contained in:
commit
538e7e96fd
|
@ -50,7 +50,7 @@ W83627DHG, W83627DHG-P, W83627UHG, W83667HG, W83667HG-B, W83667HG-I
|
||||||
(NCT6775F), and NCT6776F super I/O chips. We will refer to them collectively
|
(NCT6775F), and NCT6776F super I/O chips. We will refer to them collectively
|
||||||
as Winbond chips.
|
as Winbond chips.
|
||||||
|
|
||||||
The chips implement 2 to 4 temperature sensors (9 for NCT6775F and NCT6776F),
|
The chips implement 3 to 4 temperature sensors (9 for NCT6775F and NCT6776F),
|
||||||
2 to 5 fan rotation speed sensors, 8 to 10 analog voltage sensors, one VID
|
2 to 5 fan rotation speed sensors, 8 to 10 analog voltage sensors, one VID
|
||||||
(except for 627UHG), alarms with beep warnings (control unimplemented),
|
(except for 627UHG), alarms with beep warnings (control unimplemented),
|
||||||
and some automatic fan regulation strategies (plus manual fan control mode).
|
and some automatic fan regulation strategies (plus manual fan control mode).
|
||||||
|
@ -143,8 +143,13 @@ pwm[1-4]_min_output - minimum fan speed (range 1 - 255), when the temperature
|
||||||
pwm[1-4]_stop_time - how many milliseconds [ms] must elapse to switch
|
pwm[1-4]_stop_time - how many milliseconds [ms] must elapse to switch
|
||||||
corresponding fan off. (when the temperature was below
|
corresponding fan off. (when the temperature was below
|
||||||
defined range).
|
defined range).
|
||||||
|
pwm[1-4]_start_output-minimum fan speed (range 1 - 255) when spinning up
|
||||||
|
pwm[1-4]_step_output- rate of fan speed change (1 - 255)
|
||||||
|
pwm[1-4]_stop_output- minimum fan speed (range 1 - 255) when spinning down
|
||||||
|
pwm[1-4]_max_output - maximum fan speed (range 1 - 255), when the temperature
|
||||||
|
is above defined range.
|
||||||
|
|
||||||
Note: last two functions are influenced by other control bits, not yet exported
|
Note: last six functions are influenced by other control bits, not yet exported
|
||||||
by the driver, so a change might not have any effect.
|
by the driver, so a change might not have any effect.
|
||||||
|
|
||||||
Implementation Details
|
Implementation Details
|
||||||
|
|
|
@ -88,14 +88,12 @@ Module parameters
|
||||||
delay
|
delay
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Some Intersil/Zilker Labs DC-DC controllers require a minimum interval between
|
Intersil/Zilker Labs DC-DC controllers require a minimum interval between I2C
|
||||||
I2C bus accesses. According to Intersil, the minimum interval is 2 ms, though
|
bus accesses. According to Intersil, the minimum interval is 2 ms, though 1 ms
|
||||||
1 ms appears to be sufficient and has not caused any problems in testing.
|
appears to be sufficient and has not caused any problems in testing. The problem
|
||||||
The problem is known to affect ZL6100, ZL2105, and ZL2008. It is known not to
|
is known to affect all currently supported chips. For manual override, the
|
||||||
affect ZL2004 and ZL6105. The driver automatically sets the interval to 1 ms
|
driver provides a writeable module parameter, 'delay', which can be used to set
|
||||||
except for ZL2004 and ZL6105. To enable manual override, the driver provides a
|
the interval to a value between 0 and 65,535 microseconds.
|
||||||
writeable module parameter, 'delay', which can be used to set the interval to
|
|
||||||
a value between 0 and 65,535 microseconds.
|
|
||||||
|
|
||||||
|
|
||||||
Sysfs entries
|
Sysfs entries
|
||||||
|
|
|
@ -200,17 +200,11 @@ static int zl6100_probe(struct i2c_client *client,
|
||||||
data->id = mid->driver_data;
|
data->id = mid->driver_data;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ZL2005, ZL2008, ZL2105, and ZL6100 are known to require a wait time
|
* According to information from the chip vendor, all currently
|
||||||
* between I2C accesses. ZL2004 and ZL6105 are known to be safe.
|
* supported chips are known to require a wait time between I2C
|
||||||
* Other chips have not yet been tested.
|
* accesses.
|
||||||
*
|
|
||||||
* Only clear the wait time for chips known to be safe. The wait time
|
|
||||||
* can be cleared later for additional chips if tests show that it
|
|
||||||
* is not needed (in other words, better be safe than sorry).
|
|
||||||
*/
|
*/
|
||||||
data->delay = delay;
|
data->delay = delay;
|
||||||
if (data->id == zl2004 || data->id == zl6105)
|
|
||||||
data->delay = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Since there was a direct I2C device access above, wait before
|
* Since there was a direct I2C device access above, wait before
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
0x8860 0xa1
|
0x8860 0xa1
|
||||||
w83627dhg 9 5 4 3 0xa020 0xc1 0x5ca3
|
w83627dhg 9 5 4 3 0xa020 0xc1 0x5ca3
|
||||||
w83627dhg-p 9 5 4 3 0xb070 0xc1 0x5ca3
|
w83627dhg-p 9 5 4 3 0xb070 0xc1 0x5ca3
|
||||||
w83627uhg 8 2 2 2 0xa230 0xc1 0x5ca3
|
w83627uhg 8 2 2 3 0xa230 0xc1 0x5ca3
|
||||||
w83667hg 9 5 3 3 0xa510 0xc1 0x5ca3
|
w83667hg 9 5 3 3 0xa510 0xc1 0x5ca3
|
||||||
w83667hg-b 9 5 3 4 0xb350 0xc1 0x5ca3
|
w83667hg-b 9 5 3 4 0xb350 0xc1 0x5ca3
|
||||||
nct6775f 9 4 3 9 0xb470 0xc1 0x5ca3
|
nct6775f 9 4 3 9 0xb470 0xc1 0x5ca3
|
||||||
|
@ -1607,7 +1607,7 @@ store_##reg(struct device *dev, struct device_attribute *attr, \
|
||||||
val = step_time_to_reg(val, data->pwm_mode[nr]); \
|
val = step_time_to_reg(val, data->pwm_mode[nr]); \
|
||||||
mutex_lock(&data->update_lock); \
|
mutex_lock(&data->update_lock); \
|
||||||
data->reg[nr] = val; \
|
data->reg[nr] = val; \
|
||||||
w83627ehf_write_value(data, W83627EHF_REG_##REG[nr], val); \
|
w83627ehf_write_value(data, data->REG_##REG[nr], val); \
|
||||||
mutex_unlock(&data->update_lock); \
|
mutex_unlock(&data->update_lock); \
|
||||||
return count; \
|
return count; \
|
||||||
} \
|
} \
|
||||||
|
@ -2004,7 +2004,8 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev)
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
data = kzalloc(sizeof(struct w83627ehf_data), GFP_KERNEL);
|
data = devm_kzalloc(&pdev->dev, sizeof(struct w83627ehf_data),
|
||||||
|
GFP_KERNEL);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto exit_release;
|
goto exit_release;
|
||||||
|
@ -2157,16 +2158,16 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev)
|
||||||
w83627ehf_set_temp_reg_ehf(data, 3);
|
w83627ehf_set_temp_reg_ehf(data, 3);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Temperature sources for temp1 and temp2 are selected with
|
* Temperature sources for temp2 and temp3 are selected with
|
||||||
* bank 0, registers 0x49 and 0x4a.
|
* bank 0, registers 0x49 and 0x4a.
|
||||||
*/
|
*/
|
||||||
data->temp_src[0] = 0; /* SYSTIN */
|
data->temp_src[0] = 0; /* SYSTIN */
|
||||||
reg = w83627ehf_read_value(data, 0x49) & 0x07;
|
reg = w83627ehf_read_value(data, 0x49) & 0x07;
|
||||||
/* Adjust to have the same mapping as other source registers */
|
/* Adjust to have the same mapping as other source registers */
|
||||||
if (reg == 0)
|
if (reg == 0)
|
||||||
data->temp_src[1]++;
|
data->temp_src[1] = 1;
|
||||||
else if (reg >= 2 && reg <= 5)
|
else if (reg >= 2 && reg <= 5)
|
||||||
data->temp_src[1] += 2;
|
data->temp_src[1] = reg + 2;
|
||||||
else /* should never happen */
|
else /* should never happen */
|
||||||
data->have_temp &= ~(1 << 1);
|
data->have_temp &= ~(1 << 1);
|
||||||
reg = w83627ehf_read_value(data, 0x4a);
|
reg = w83627ehf_read_value(data, 0x4a);
|
||||||
|
@ -2493,9 +2494,8 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
exit_remove:
|
exit_remove:
|
||||||
w83627ehf_device_remove_files(dev);
|
w83627ehf_device_remove_files(dev);
|
||||||
kfree(data);
|
|
||||||
platform_set_drvdata(pdev, NULL);
|
|
||||||
exit_release:
|
exit_release:
|
||||||
|
platform_set_drvdata(pdev, NULL);
|
||||||
release_region(res->start, IOREGION_LENGTH);
|
release_region(res->start, IOREGION_LENGTH);
|
||||||
exit:
|
exit:
|
||||||
return err;
|
return err;
|
||||||
|
@ -2509,7 +2509,6 @@ static int __devexit w83627ehf_remove(struct platform_device *pdev)
|
||||||
w83627ehf_device_remove_files(&pdev->dev);
|
w83627ehf_device_remove_files(&pdev->dev);
|
||||||
release_region(data->addr, IOREGION_LENGTH);
|
release_region(data->addr, IOREGION_LENGTH);
|
||||||
platform_set_drvdata(pdev, NULL);
|
platform_set_drvdata(pdev, NULL);
|
||||||
kfree(data);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user