2013-03-28 16:43:30

by Pali Rohár

[permalink] [raw]
Subject: [PATCH] power: rx51_battery: Fix reporting temperature

This patch fixing units (1/10 °C) in which is temperature reported.

Signed-off-by: Pali Rohár <[email protected]>
---
drivers/power/rx51_battery.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/rx51_battery.c b/drivers/power/rx51_battery.c
index 8208888..527d256 100644
--- a/drivers/power/rx51_battery.c
+++ b/drivers/power/rx51_battery.c
@@ -119,7 +119,7 @@ static int rx51_battery_read_temperature(struct rx51_device_info *di)

/* First check for temperature in first direct table */
if (raw < ARRAY_SIZE(rx51_temp_table1))
- return rx51_temp_table1[raw] * 100;
+ return rx51_temp_table1[raw] * 10;

/* Binary search RAW value in second inverse table */
while (max - min > 1) {
@@ -132,7 +132,7 @@ static int rx51_battery_read_temperature(struct rx51_device_info *di)
break;
}

- return (rx51_temp_table2_first - min) * 100;
+ return (rx51_temp_table2_first - min) * 10;
}

/*
--
1.7.10.4


2013-04-08 10:50:46

by Pali Rohár

[permalink] [raw]
Subject: Re: [PATCH] power: rx51_battery: Fix reporting temperature

On Thursday 28 March 2013 17:42:23 Pali Rohár wrote:
> This patch fixing units (1/10 °C) in which is temperature
> reported.
>
> Signed-off-by: Pali Rohár <[email protected]>
> ---
> drivers/power/rx51_battery.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/power/rx51_battery.c
> b/drivers/power/rx51_battery.c index 8208888..527d256 100644
> --- a/drivers/power/rx51_battery.c
> +++ b/drivers/power/rx51_battery.c
> @@ -119,7 +119,7 @@ static int
> rx51_battery_read_temperature(struct rx51_device_info *di)
>
> /* First check for temperature in first direct table */
> if (raw < ARRAY_SIZE(rx51_temp_table1))
> - return rx51_temp_table1[raw] * 100;
> + return rx51_temp_table1[raw] * 10;
>
> /* Binary search RAW value in second inverse table */
> while (max - min > 1) {
> @@ -132,7 +132,7 @@ static int
> rx51_battery_read_temperature(struct rx51_device_info *di)
> break;
> }
>
> - return (rx51_temp_table2_first - min) * 100;
> + return (rx51_temp_table2_first - min) * 10;
> }
>
> /*

Hi Anton, please include this patch into your battery tree.

--
Pali Rohár
[email protected]


Attachments:
signature.asc (198.00 B)
This is a digitally signed message part.

2013-04-17 01:37:57

by Anton Vorontsov

[permalink] [raw]
Subject: Re: [PATCH] power: rx51_battery: Fix reporting temperature

On Thu, Mar 28, 2013 at 05:42:23PM +0100, Pali Rohár wrote:
> This patch fixing units (1/10 °C) in which is temperature reported.
>
> Signed-off-by: Pali Rohár <[email protected]>
> ---

Applied, thanks!

> drivers/power/rx51_battery.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/power/rx51_battery.c b/drivers/power/rx51_battery.c
> index 8208888..527d256 100644
> --- a/drivers/power/rx51_battery.c
> +++ b/drivers/power/rx51_battery.c
> @@ -119,7 +119,7 @@ static int rx51_battery_read_temperature(struct rx51_device_info *di)
>
> /* First check for temperature in first direct table */
> if (raw < ARRAY_SIZE(rx51_temp_table1))
> - return rx51_temp_table1[raw] * 100;
> + return rx51_temp_table1[raw] * 10;
>
> /* Binary search RAW value in second inverse table */
> while (max - min > 1) {
> @@ -132,7 +132,7 @@ static int rx51_battery_read_temperature(struct rx51_device_info *di)
> break;
> }
>
> - return (rx51_temp_table2_first - min) * 100;
> + return (rx51_temp_table2_first - min) * 10;
> }
>
> /*
> --
> 1.7.10.4