hwmon: (occ): Return power readings in micro-Watts
PATCH 1/1 hwmon: (occ): Return power readings in micro-Watts
From: "Edward A. James" <[email protected]>
hwmon expects -6 exponent.
Signed-off-by Edward A. James <[email protected]>
--- drivers/hwmon/occ/common.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/hwmon/occ/common.c +6 -6
@@ -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);
Signature · 1 line
1.8.3.1
Andrew Jeffery
AppliedQuoted 5 lines · Eddie James
Quoted 1 line
From: "Edward A. James" <[email protected]>
hwmon expects -6 exponent.
Signed-off-by Edward A. James <[email protected]>
Thanks, applied to dev-4.10.
Andrew
Quoted 62 lines
---
drivers/hwmon/occ/common.c | 12 ++++++------1 file changed, 6 insertions(+), 6 deletions(-)drivers/hwmon/occ/common.c +0
-0@@ -470,7 +470,7 @@ static ssize_t occ_show_power_1(struct device *dev, > val = get_unaligned_be32(&power->accumulator); > break;Quoted 5 lines
case 3:
(quoted diff) +1
-1- val = get_unaligned_be16(&power->value); + val = get_unaligned_be16(&power->value) * 1000000;break;
}drivers/hwmon/occ/common.c +0
-0@@ -504,7 +504,7 @@ static ssize_t occ_show_power_2(struct device *dev, > val = get_unaligned_be64(&power->accumulator); > break;Quoted 6 lines
case 3:
(quoted diff) +1
-1- val = get_unaligned_be16(&power->value); + val = get_unaligned_be16(&power->value) * 1000000;break;
case 4:
val =power->function_id;drivers/hwmon/occ/common.c +0
-0@@ -541,7 +541,7 @@ static ssize_t occ_show_power_a0(struct device *dev, > val = get_unaligned_be16(&power->system.update_time); > break;Quoted 6 lines
case 2:
drivers/hwmon/occ/common.c +1
-1- 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);drivers/hwmon/occ/common.c +0
-0@@ -553,7 +553,7 @@ static ssize_t occ_show_power_a0(struct device *dev, > val = get_unaligned_be16(&power->proc.update_time); > break;Quoted 6 lines
case 6:
drivers/hwmon/occ/common.c +1
-1- 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);drivers/hwmon/occ/common.c +0
-0@@ -562,7 +562,7 @@ static ssize_t occ_show_power_a0(struct device *dev, > val = get_unaligned_be64(&power->proc.accumulator); > break;Quoted 6 lines
case 9:
drivers/hwmon/occ/common.c +1
-1- 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);drivers/hwmon/occ/common.c +0
-0@@ -571,7 +571,7 @@ static ssize_t occ_show_power_a0(struct device *dev, > val = get_unaligned_be64(&power->vdd.accumulator); > break;Quoted 6 lines
case 12:
drivers/hwmon/occ/common.c +1
-1- 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);