提交 3c8c049a 编写于 作者: S Shilpasri G Bhat 提交者: Michael Ellerman

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: NShilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
Acked-by: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 5cdcb01e
...@@ -101,9 +101,10 @@ static ssize_t show_sensor(struct device *dev, struct device_attribute *devattr, ...@@ -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, struct sensor_data *sdata = container_of(devattr, struct sensor_data,
dev_attr); dev_attr);
ssize_t ret; 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) if (ret)
return ret; return ret;
...@@ -114,7 +115,7 @@ static ssize_t show_sensor(struct device *dev, struct device_attribute *devattr, ...@@ -114,7 +115,7 @@ static ssize_t show_sensor(struct device *dev, struct device_attribute *devattr,
else if (sdata->type == POWER_INPUT) else if (sdata->type == POWER_INPUT)
x *= 1000000; 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, static ssize_t show_label(struct device *dev, struct device_attribute *devattr,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册