diff options
author | Darrick J. Wong <djwong@us.ibm.com> | 2008-03-19 17:00:47 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-03-19 18:53:35 -0700 |
commit | df9cb0339f2c213bea5480464fa669ed4add7445 (patch) | |
tree | 08227f5d1e007aceba678e0660ae0a3bc3db770f | |
parent | 87cb055bc10571522f953925c25bb1a0d1b17605 (diff) | |
download | linux-df9cb0339f2c213bea5480464fa669ed4add7445.tar.bz2 |
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: 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>
-rw-r--r-- | drivers/hwmon/ibmpex.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/hwmon/ibmpex.c b/drivers/hwmon/ibmpex.c index 9c9cdb0685e4..db551d869feb 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,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; |