From: rui.zhang@intel.com (Zhang Rui)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] thermal: kirkwood: Fix thermal sensor formula
Date: Tue, 26 Mar 2013 22:24:33 +0800 [thread overview]
Message-ID: <1364307873.2821.23.camel@rzhang1-mobl4> (raw)
In-Reply-To: <1363954983-30822-2-git-send-email-ezequiel.garcia@free-electrons.com>
On Fri, 2013-03-22 at 09:23 -0300, Ezequiel Garcia wrote:
> The currently formula has been taken from the 88AP510 SoC datasheet,
> which is not exactly correct. The correct value for the temperature
> in Celcius of the sensor present in this SoC is:
>
> Celsius = (322-reg)/1.3625
>
> Signed-off-by: Lior Amsalem <alior@marvell.com>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
applied to thermal -next.
thanks,
rui
> ---
> drivers/thermal/kirkwood_thermal.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
> index 65cb4f0..84b331f 100644
> --- a/drivers/thermal/kirkwood_thermal.c
> +++ b/drivers/thermal/kirkwood_thermal.c
> @@ -49,13 +49,13 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal,
> }
>
> /*
> - * Calculate temperature. See Section 8.10.1 of the 88AP510,
> - * datasheet, which has the same sensor.
> - * Documentation/arm/Marvell/README
> + * Calculate temperature. According to Marvell internal
> + * documentation the formula for this is:
> + * Celsius = (322-reg)/1.3625
> */
> reg = (reg >> KIRKWOOD_THERMAL_TEMP_OFFSET) &
> KIRKWOOD_THERMAL_TEMP_MASK;
> - *temp = ((2281638UL - (7298*reg)) / 10);
> + *temp = ((3220000000UL - (10000000UL * reg)) / 13625);
>
> return 0;
> }
next prev parent reply other threads:[~2013-03-26 14:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-22 12:23 [PATCH for 3.9 0/2] thermal: Marvell SoC thermal formula fixes Ezequiel Garcia
2013-03-22 12:23 ` [PATCH 1/2] thermal: kirkwood: Fix thermal sensor formula Ezequiel Garcia
2013-03-26 14:24 ` Zhang Rui [this message]
2013-03-22 12:23 ` [PATCH 2/2] thermal: dove: " Ezequiel Garcia
2013-03-26 14:24 ` Zhang Rui
2013-03-25 8:17 ` [PATCH for 3.9 0/2] thermal: Marvell SoC thermal formula fixes Zhang Rui
2013-03-25 8:50 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1364307873.2821.23.camel@rzhang1-mobl4 \
--to=rui.zhang@intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).