Skip to content

Commit

Permalink
ibmpex: correct power use multipliers for QS2x blade
Browse files Browse the repository at this point in the history
The QS2x blades ships with v2.54 of the firmware, which use the same
multiplier for all power meters.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Cc: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Darrick J. Wong authored and Linus Torvalds committed Mar 20, 2008
1 parent 87cb055 commit df9cb03
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions drivers/hwmon/ibmpex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -398,8 +402,9 @@ 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;
Expand Down

0 comments on commit df9cb03

Please sign in to comment.