Commit df9cb033 authored by Darrick J. Wong's avatar Darrick J. Wong Committed by Linus Torvalds

ibmpex: correct power use multipliers for QS2x blade

The QS2x blades ships with v2.54 of the firmware, which use the same
multiplier for all power meters.
Signed-off-by: default avatarDarrick J. Wong <djwong@us.ibm.com>
Cc: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 87cb055b
...@@ -327,10 +327,14 @@ static int is_temp_sensor(const char *sensor_id, int len) ...@@ -327,10 +327,14 @@ static int is_temp_sensor(const char *sensor_id, int len)
return 0; 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; int i;
if (data->sensor_major == 2)
return 1000000;
for (i = PEX_SENSOR_TYPE_LEN; i < len - 1; i++) for (i = PEX_SENSOR_TYPE_LEN; i < len - 1; i++)
if (!memcmp(&sensor_id[i], watt_sensor_sig, PEX_MULT_LEN)) if (!memcmp(&sensor_id[i], watt_sensor_sig, PEX_MULT_LEN))
return 1000000; return 1000000;
...@@ -398,7 +402,8 @@ static int ibmpex_find_sensors(struct ibmpex_bmc_data *data) ...@@ -398,7 +402,8 @@ static int ibmpex_find_sensors(struct ibmpex_bmc_data *data)
num_power++; num_power++;
sensor_counter = num_power; sensor_counter = num_power;
data->sensors[i].multiplier = data->sensors[i].multiplier =
power_sensor_multiplier(data->rx_msg_data, power_sensor_multiplier(data,
data->rx_msg_data,
data->rx_msg_len); data->rx_msg_len);
} else if (is_temp_sensor(data->rx_msg_data, } else if (is_temp_sensor(data->rx_msg_data,
data->rx_msg_len)) { data->rx_msg_len)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment