[PATCH linux dev-4.10] hwmon: (occ): Return power readings in micro-Watts
Andrew Jeffery
andrew at aj.id.au
Wed Aug 23 17:22:12 AEST 2017
On Mon, 2017-08-14 at 16:06 -0500, Eddie James wrote:
> > From: "Edward A. James" <eajames at us.ibm.com>
>
> hwmon expects -6 exponent.
>
> Signed-off-by: Edward A. James <eajames at us.ibm.com>
Thanks, applied to dev-4.10.
Andrew
> ---
> drivers/hwmon/occ/common.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/hwmon/occ/common.c b/drivers/hwmon/occ/common.c
> index 3f63467..34002fb 100644
> --- a/drivers/hwmon/occ/common.c
> +++ b/drivers/hwmon/occ/common.c
> @@ -470,7 +470,7 @@ static ssize_t occ_show_power_1(struct device *dev,
> > val = get_unaligned_be32(&power->accumulator);
> > break;
> > case 3:
> > - val = get_unaligned_be16(&power->value);
> > + val = get_unaligned_be16(&power->value) * 1000000;
> > break;
> > }
>
> @@ -504,7 +504,7 @@ static ssize_t occ_show_power_2(struct device *dev,
> > val = get_unaligned_be64(&power->accumulator);
> > break;
> > case 3:
> > - val = get_unaligned_be16(&power->value);
> > + val = get_unaligned_be16(&power->value) * 1000000;
> > break;
> > case 4:
> > val = power->function_id;
> @@ -541,7 +541,7 @@ static ssize_t occ_show_power_a0(struct device *dev,
> > val = get_unaligned_be16(&power->system.update_time);
> > break;
> > case 2:
> > - val = get_unaligned_be16(&power->system.value);
> > + val = get_unaligned_be16(&power->system.value) * 1000000;
> > break;
> > case 3:
> > val = get_unaligned_be32(&power->system.update_tag);
> @@ -553,7 +553,7 @@ static ssize_t occ_show_power_a0(struct device *dev,
> > val = get_unaligned_be16(&power->proc.update_time);
> > break;
> > case 6:
> > - val = get_unaligned_be16(&power->proc.value);
> > + val = get_unaligned_be16(&power->proc.value) * 1000000;
> > break;
> > case 7:
> > val = get_unaligned_be32(&power->proc.update_tag);
> @@ -562,7 +562,7 @@ static ssize_t occ_show_power_a0(struct device *dev,
> > val = get_unaligned_be64(&power->proc.accumulator);
> > break;
> > case 9:
> > - val = get_unaligned_be16(&power->vdd.value);
> > + val = get_unaligned_be16(&power->vdd.value) * 1000000;
> > break;
> > case 10:
> > val = get_unaligned_be32(&power->vdd.update_tag);
> @@ -571,7 +571,7 @@ static ssize_t occ_show_power_a0(struct device *dev,
> > val = get_unaligned_be64(&power->vdd.accumulator);
> > break;
> > case 12:
> > - val = get_unaligned_be16(&power->vdn.value);
> > + val = get_unaligned_be16(&power->vdn.value) * 1000000;
> > break;
> > case 13:
> > val = get_unaligned_be32(&power->vdn.update_tag);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20170823/0b0d1957/attachment.sig>
More information about the openbmc
mailing list