hwmon: (pmbus/ltc2978) Fix temperature reporting
Guenter Roeck
maintainerPATCH v3 1/4 hwmon: (pmbus/ltc2978) Fix temperature reporting
On LTC2978, only READ_TEMPERATURE is supported. It reports the internal junction temperature. This register is unpaged.
On LTC3880, READ_TEMPERATURE and READ_TEMPERATURE2 are supported. READ_TEMPERATURE is paged and reports external temperatures. READ_TEMPERATURE2 is unpaged and reports the internal junction temperature.
---
Candidate for -stable.
v3: Reduce to strictly fixes only
v2: v1 converted temp2_max from an array to a scalar.
This is now done in an earlier patch.
drivers/hwmon/pmbus/ltc2978.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/hwmon/pmbus/ltc2978.c +8 -6
@@ -59,7 +59,7 @@ enum chips { ltc2978, ltc3880 };struct ltc2978_data {enum chips id;int vin_min, vin_max; -int temp_min, temp_max; +int temp_min, temp_max[2 ];int vout_min[8 ], vout_max[8 ];int iout_max[2 ];int temp2_max;
@@ -113,9 +113,10 @@ static int ltc2978_read_word_data_common(struct i2c_client *client, int page, ret =pmbus_read_word_data (client, page,LTC2978_MFR_TEMPERATURE_PEAK );if (ret >=0 ) { -if (lin11_to_val (ret) >lin11_to_val (data->temp_max)) - data->temp_max = ret; - ret = data->temp_max; +if (lin11_to_val (ret) + >lin11_to_val (data->temp_max[page])) + data->temp_max[page] = ret; + ret = data->temp_max[page]; }break ;case PMBUS_VIRT_RESET_VOUT_HISTORY :
@@ -266,7 +267,7 @@ static int ltc2978_write_word_data(struct i2c_client *client, int page,break ;case PMBUS_VIRT_RESET_TEMP_HISTORY : data->temp_min =0x7bff ; - data->temp_max =0x7c00 ; + data->temp_max[page] =0x7c00 ; ret =ltc2978_clear_peaks (client, page, data->id);break ;default :
@@ -323,7 +324,8 @@ static int ltc2978_probe(struct i2c_client *client, data->vin_min =0x7bff ; data->vin_max =0x7c00 ; data->temp_min =0x7bff ; - data->temp_max =0x7c00 ; +for (i =0 ; i <ARRAY_SIZE (data->temp_max); i++) + data->temp_max[i] =0x7c00 ; data->temp2_max =0x7c00 ;switch (data->id) {
Signature · 7 lines
1.7.9.7 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 9 lines · Guenter Roeck
On LTC2978, only
READ_TEMPERATUREis supported. It reports the internal junction temperature. This register is unpaged.On LTC3880,
READ_TEMPERATUREandREAD_TEMPERATURE2are supported.READ_TEMPERATUREis paged and reports external temperatures.READ_TEMPERATURE2is unpaged and reports the internal junction temperature.Signed-off-by Guenter Roeck <[email protected]>
Hi Jean,
I know I take way too much of your time, but do you have any feedback on this one ?
Thanks,
Guenter
Quoted 61 lines
---
Candidate for -stable.v3: Reduce to strictly fixes only
v2: v1 converted
temp2_maxfrom an array to a scalar.
This is now done in an earlier patch.drivers/hwmon/pmbus/ltc2978.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)drivers/hwmon/pmbus/ltc2978.c +8
-6@@ -59,7 +59,7 @@ enum chips { ltc2978, ltc3880 };struct ltc2978_data {enum chips id;int vin_min, vin_max; -int temp_min, temp_max; +int temp_min, temp_max[2 ];int vout_min[8 ], vout_max[8 ];int iout_max[2 ];int temp2_max;@@ -113,9 +113,10 @@ static int ltc2978_read_word_data_common(struct i2c_client *client, int page, ret =pmbus_read_word_data (client, page,LTC2978_MFR_TEMPERATURE_PEAK );if (ret >=0 ) { -if (lin11_to_val (ret) >lin11_to_val (data->temp_max)) - data->temp_max = ret; - ret = data->temp_max; +if (lin11_to_val (ret) + >lin11_to_val (data->temp_max[page])) + data->temp_max[page] = ret; + ret = data->temp_max[page]; }break ;case PMBUS_VIRT_RESET_VOUT_HISTORY :@@ -266,7 +267,7 @@ static int ltc2978_write_word_data(struct i2c_client *client, int page,break ;case PMBUS_VIRT_RESET_TEMP_HISTORY : data->temp_min =0x7bff ; - data->temp_max =0x7c00 ; + data->temp_max[page] =0x7c00 ; ret =ltc2978_clear_peaks (client, page, data->id);break ;default :@@ -323,7 +324,8 @@ static int ltc2978_probe(struct i2c_client *client, data->vin_min =0x7bff ; data->vin_max =0x7c00 ; data->temp_min =0x7bff ; - data->temp_max =0x7c00 ; +for (i =0 ; i <ARRAY_SIZE (data->temp_max); i++) + data->temp_max[i] =0x7c00 ; data->temp2_max =0x7c00 ;switch (data->id) {Signature · 1 line
1.7.9.7
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 9 lines · Guenter Roeck
Quoted 8 lines · Guenter Roeck
On LTC2978, only
READ_TEMPERATUREis supported. It reports the internal junction temperature. This register is unpaged.On LTC3880,
READ_TEMPERATUREandREAD_TEMPERATURE2are supported.READ_TEMPERATUREis paged and reports external temperatures.READ_TEMPERATURE2is unpaged and reports the internal junction temperature.
Quoted 6 lines
Quoted 1 line
Signed-off-by Guenter Roeck <[email protected]>Hi Jean,
I know I take way too much of your time, but do you have any feedback on this one ?
Reviewing the end of this series is on my todo list, but after my daily work and after my openSUSE 12.3 bug reports (will be released next week.)
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 11 lines · Guenter Roeck
On LTC2978, only
READ_TEMPERATUREis supported. It reports the internal junction temperature. This register is unpaged.On LTC3880,
READ_TEMPERATUREandREAD_TEMPERATURE2are supported.READ_TEMPERATUREis paged and reports external temperatures.READ_TEMPERATURE2is unpaged and reports the internal junction temperature.Signed-off-by Guenter Roeck <[email protected]>---
Candidate for -stable.
Agreed.
Quoted 3 lines
v3: Reduce to strictly fixes only
(...)
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors