diff options
author | Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> | 2018-05-07 12:25:37 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-05-21 06:48:03 +0200 |
commit | 3c8c049aa7bdffaab2e53401fd5270a3acc32631 (patch) | |
tree | 1cb48a7ed2b6b46b7fcbe56a95538e83e3b59473 /drivers/hwmon/ibmpowernv.c | |
parent | powernv: opal-sensor: Add support to read 64bit sensor values (diff) | |
download | linux-3c8c049aa7bdffaab2e53401fd5270a3acc32631.tar.xz linux-3c8c049aa7bdffaab2e53401fd5270a3acc32631.zip |
hwmon: (ibmpowernv): Add support to read 64 bit sensors
The firmware has supported for reading sensor values of size u32.
This patch adds support to use newer firmware functions which allows
to read the sensors of size u64.
Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/hwmon/ibmpowernv.c')
-rw-r--r-- | drivers/hwmon/ibmpowernv.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c index 5ccdd0b52650..74d9b5ae55ec 100644 --- a/drivers/hwmon/ibmpowernv.c +++ b/drivers/hwmon/ibmpowernv.c @@ -101,9 +101,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 +115,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, |