diff options
-rw-r--r-- | drivers/hwmon/pmbus/ltc2978.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/hwmon/pmbus/ltc2978.c b/drivers/hwmon/pmbus/ltc2978.c index a58de38e23d8..6d6130752f94 100644 --- a/drivers/hwmon/pmbus/ltc2978.c +++ b/drivers/hwmon/pmbus/ltc2978.c | |||
@@ -59,7 +59,7 @@ enum chips { ltc2978, ltc3880 }; | |||
59 | struct ltc2978_data { | 59 | struct ltc2978_data { |
60 | enum chips id; | 60 | enum chips id; |
61 | int vin_min, vin_max; | 61 | int vin_min, vin_max; |
62 | int temp_min, temp_max; | 62 | int temp_min, temp_max[2]; |
63 | int vout_min[8], vout_max[8]; | 63 | int vout_min[8], vout_max[8]; |
64 | int iout_max[2]; | 64 | int iout_max[2]; |
65 | int temp2_max; | 65 | int temp2_max; |
@@ -113,9 +113,10 @@ static int ltc2978_read_word_data_common(struct i2c_client *client, int page, | |||
113 | ret = pmbus_read_word_data(client, page, | 113 | ret = pmbus_read_word_data(client, page, |
114 | LTC2978_MFR_TEMPERATURE_PEAK); | 114 | LTC2978_MFR_TEMPERATURE_PEAK); |
115 | if (ret >= 0) { | 115 | if (ret >= 0) { |
116 | if (lin11_to_val(ret) > lin11_to_val(data->temp_max)) | 116 | if (lin11_to_val(ret) |
117 | data->temp_max = ret; | 117 | > lin11_to_val(data->temp_max[page])) |
118 | ret = data->temp_max; | 118 | data->temp_max[page] = ret; |
119 | ret = data->temp_max[page]; | ||
119 | } | 120 | } |
120 | break; | 121 | break; |
121 | case PMBUS_VIRT_RESET_VOUT_HISTORY: | 122 | case PMBUS_VIRT_RESET_VOUT_HISTORY: |
@@ -266,7 +267,7 @@ static int ltc2978_write_word_data(struct i2c_client *client, int page, | |||
266 | break; | 267 | break; |
267 | case PMBUS_VIRT_RESET_TEMP_HISTORY: | 268 | case PMBUS_VIRT_RESET_TEMP_HISTORY: |
268 | data->temp_min = 0x7bff; | 269 | data->temp_min = 0x7bff; |
269 | data->temp_max = 0x7c00; | 270 | data->temp_max[page] = 0x7c00; |
270 | ret = ltc2978_clear_peaks(client, page, data->id); | 271 | ret = ltc2978_clear_peaks(client, page, data->id); |
271 | break; | 272 | break; |
272 | default: | 273 | default: |
@@ -323,7 +324,8 @@ static int ltc2978_probe(struct i2c_client *client, | |||
323 | data->vin_min = 0x7bff; | 324 | data->vin_min = 0x7bff; |
324 | data->vin_max = 0x7c00; | 325 | data->vin_max = 0x7c00; |
325 | data->temp_min = 0x7bff; | 326 | data->temp_min = 0x7bff; |
326 | data->temp_max = 0x7c00; | 327 | for (i = 0; i < ARRAY_SIZE(data->temp_max); i++) |
328 | data->temp_max[i] = 0x7c00; | ||
327 | data->temp2_max = 0x7c00; | 329 | data->temp2_max = 0x7c00; |
328 | 330 | ||
329 | switch (data->id) { | 331 | switch (data->id) { |