aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/ibmpex.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@us.ibm.com>2008-03-19 20:00:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-03-19 21:53:35 -0400
commitdf9cb0339f2c213bea5480464fa669ed4add7445 (patch)
tree08227f5d1e007aceba678e0660ae0a3bc3db770f /drivers/hwmon/ibmpex.c
parent87cb055bc10571522f953925c25bb1a0d1b17605 (diff)
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>
Diffstat (limited to 'drivers/hwmon/ibmpex.c')
-rw-r--r--drivers/hwmon/ibmpex.c11
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)
327 return 0; 327 return 0;
328} 328}
329 329
330static int power_sensor_multiplier(const char *sensor_id, int len) 330static 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,8 +402,9 @@ 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;