diff options
Diffstat (limited to 'drivers/hwmon/ibmpex.c')
-rw-r--r-- | drivers/hwmon/ibmpex.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/hwmon/ibmpex.c b/drivers/hwmon/ibmpex.c index 9c9cdb0685e4..4e9b19c6732f 100644 --- a/drivers/hwmon/ibmpex.c +++ b/drivers/hwmon/ibmpex.c | |||
@@ -327,10 +327,14 @@ static int is_temp_sensor(const char *sensor_id, int len) | |||
327 | return 0; | 327 | return 0; |
328 | } | 328 | } |
329 | 329 | ||
330 | static int power_sensor_multiplier(const char *sensor_id, int len) | 330 | static int power_sensor_multiplier(struct ibmpex_bmc_data *data, |
331 | const char *sensor_id, int len) | ||
331 | { | 332 | { |
332 | int i; | 333 | int i; |
333 | 334 | ||
335 | if (data->sensor_major == 2) | ||
336 | return 1000000; | ||
337 | |||
334 | for (i = PEX_SENSOR_TYPE_LEN; i < len - 1; i++) | 338 | for (i = PEX_SENSOR_TYPE_LEN; i < len - 1; i++) |
335 | if (!memcmp(&sensor_id[i], watt_sensor_sig, PEX_MULT_LEN)) | 339 | if (!memcmp(&sensor_id[i], watt_sensor_sig, PEX_MULT_LEN)) |
336 | return 1000000; | 340 | return 1000000; |
@@ -398,14 +402,15 @@ static int ibmpex_find_sensors(struct ibmpex_bmc_data *data) | |||
398 | num_power++; | 402 | num_power++; |
399 | sensor_counter = num_power; | 403 | sensor_counter = num_power; |
400 | data->sensors[i].multiplier = | 404 | data->sensors[i].multiplier = |
401 | power_sensor_multiplier(data->rx_msg_data, | 405 | power_sensor_multiplier(data, |
402 | data->rx_msg_len); | 406 | data->rx_msg_data, |
407 | data->rx_msg_len); | ||
403 | } else if (is_temp_sensor(data->rx_msg_data, | 408 | } else if (is_temp_sensor(data->rx_msg_data, |
404 | data->rx_msg_len)) { | 409 | data->rx_msg_len)) { |
405 | sensor_type = TEMP_SENSOR; | 410 | sensor_type = TEMP_SENSOR; |
406 | num_temp++; | 411 | num_temp++; |
407 | sensor_counter = num_temp; | 412 | sensor_counter = num_temp; |
408 | data->sensors[i].multiplier = 1; | 413 | data->sensors[i].multiplier = 1000; |
409 | } else | 414 | } else |
410 | continue; | 415 | continue; |
411 | 416 | ||