diff options
Diffstat (limited to 'drivers/hwmon/ibmpowernv.c')
-rw-r--r-- | drivers/hwmon/ibmpowernv.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c index 5ccdd0b52650..0298745d46e4 100644 --- a/drivers/hwmon/ibmpowernv.c +++ b/drivers/hwmon/ibmpowernv.c @@ -51,6 +51,7 @@ enum sensors { POWER_SUPPLY, POWER_INPUT, CURRENT, + ENERGY, MAX_SENSOR_TYPE, }; @@ -78,6 +79,7 @@ static struct sensor_group { { "in" }, { "power" }, { "curr" }, + { "energy" }, }; struct sensor_data { @@ -101,9 +103,10 @@ static ssize_t show_sensor(struct device *dev, struct device_attribute *devattr, struct sensor_data *sdata = container_of(devattr, struct sensor_data, dev_attr); ssize_t ret; - u32 x; + u64 x; + + ret = opal_get_sensor_data_u64(sdata->id, &x); - ret = opal_get_sensor_data(sdata->id, &x); if (ret) return ret; @@ -114,7 +117,7 @@ static ssize_t show_sensor(struct device *dev, struct device_attribute *devattr, else if (sdata->type == POWER_INPUT) x *= 1000000; - return sprintf(buf, "%u\n", x); + return sprintf(buf, "%llu\n", x); } static ssize_t show_label(struct device *dev, struct device_attribute *devattr, |