aboutsummaryrefslogtreecommitdiff
path: root/drivers/hwmon/ibmpex.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/ibmpex.c')
-rw-r--r--drivers/hwmon/ibmpex.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/hwmon/ibmpex.c b/drivers/hwmon/ibmpex.c
index 9c9cdb0685e..4e9b19c6732 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)
return 0;
}
-static int power_sensor_multiplier(const char *sensor_id, int len)
+static int power_sensor_multiplier(struct ibmpex_bmc_data *data,
+ const char *sensor_id, int len)
{
int i;
+ if (data->sensor_major == 2)
+ return 1000000;
+
for (i = PEX_SENSOR_TYPE_LEN; i < len - 1; i++)
if (!memcmp(&sensor_id[i], watt_sensor_sig, PEX_MULT_LEN))
return 1000000;
@@ -398,14 +402,15 @@ static int ibmpex_find_sensors(struct ibmpex_bmc_data *data)
num_power++;
sensor_counter = num_power;
data->sensors[i].multiplier =
- power_sensor_multiplier(data->rx_msg_data,
- data->rx_msg_len);
+ power_sensor_multiplier(data,
+ data->rx_msg_data,
+ data->rx_msg_len);
} else if (is_temp_sensor(data->rx_msg_data,
data->rx_msg_len)) {
sensor_type = TEMP_SENSOR;
num_temp++;
sensor_counter = num_temp;
- data->sensors[i].multiplier = 1;
+ data->sensors[i].multiplier = 1000;
} else
continue;