initialize fan_mins in w83781d, asb100 and lm78
PATCH 1/1 initialize fan_mins in w83781d, asb100 and lm78
Quoting myself:
Quoted 4 lines
While testing, I found a corner case that isn't handled properly. It doesn't seem to be handled by the lm78 and the asb100 either. Setting
fanN_divbefore ever reading from the chip or settingfanN_minwill make use offanN_minwhile it was never initialized.
The following patch addesses the issue. Tested to work on my AS99127F rev.1 (which means that only the changes to the w83781d driver were actually tested). Testers welcome.
Mark, can you confirm it works for your ASB100 as well? Thanks.
Please apply,
Thanks.
drivers/i2c/chips/asb100.c renamed from drivers/i2c/chips.orig/asb100.c +5 -0
@@ -807,6 +807,11 @@/* Initialize the chip */ asb100_init_client (new_client); +/* A few vars need to be filled upon startup */ + data->fan_min[0 ] =asb100_read_value (new_client,ASB100_REG_FAN_MIN (0 )); + data->fan_min[1 ] =asb100_read_value (new_client,ASB100_REG_FAN_MIN (1 )); + data->fan_min[2 ] =asb100_read_value (new_client,ASB100_REG_FAN_MIN (2 )); +/* Register sysfs hooks */ device_create_file_in (new_client,0 );device_create_file_in (new_client,1 );
drivers/i2c/chips/lm78.c renamed from drivers/i2c/chips.orig/lm78.c +6 -0
@@ -625,6 +625,12 @@/* Initialize the LM78 chip */ lm78_init_client (new_client); +/* A few vars need to be filled upon startup */ +for (i =0 ; i <3 ; i++) { + data->fan_min[i] =lm78_read_value (new_client, +LM78_REG_FAN_MIN (i)); + } +/* Register sysfs hooks */ device_create_file (&new_client->dev, &dev_attr_in0_input);device_create_file (&new_client->dev, &dev_attr_in0_min);
drivers/i2c/chips/w83781d.c renamed from drivers/i2c/chips.orig/w83781d.c +6 -0
@@ -1252,6 +1252,12 @@/* Initialize the chip */ w83781d_init_client (new_client); +/* A few vars need to be filled upon startup */ +for (i =1 ; i <=3 ; i++) { + data->fan_min[i -1 ] =w83781d_read_value (new_client, +W83781D_REG_FAN_MIN (i)); + } +/* Register sysfs hooks */ device_create_file_in (new_client,0 );if (kind != w83783s && kind != w83697hf)
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
PATCH 1/1 initialize fan_mins in w83781d, asb100 and lm78
Quoted 10 lines · Jean Delvare
Quoting myself:
Quoted 4 lines
While testing, I found a corner case that isn't handled properly. It doesn't seem to be handled by the lm78 and the asb100 either. Setting
fanN_divbefore ever reading from the chip or settingfanN_minwill make use offanN_minwhile it was never initialized.The following patch addesses the issue. Tested to work on my AS99127F rev.1 (which means that only the changes to the w83781d driver were actually tested). Testers welcome.
Looks sane to me, applied, thanks.
greg k-h
PATCH 1/1 initialize fan_mins in w83781d, asb100 and lm78
In reply to Jean DelvareQuoted 7 lines · Jean Delvare
Quoting myself:
Quoted 4 lines
While testing, I found a corner case that isn't handled properly. It doesn't seem to be handled by the lm78 and the asb100 either. Setting
fanN_divbefore ever reading from the chip or settingfanN_minwill make use offanN_minwhile it was never initialized.
Quoted 5 lines
The following patch addesses the issue. Tested to work on my AS99127F rev.1 (which means that only the changes to the w83781d driver were actually tested). Testers welcome.
Mark, can you confirm it works for your ASB100 as well? Thanks.
Yes, this works. Here is what I did exactly, in case you had something else in mind:
modprobe asb100
echo "2000" > .../fan1_min
rmmod asb100
modprobe asb100
sensors -s (which sets fan1_div but not fan1_min)
sensors (which correctly shows fan1 min of 2000)
Regards,
Signature · 2 lines
Mark M. Hoffman [email protected]