From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] thermal: Add support for thermal sensor for Kirkwood SoC
Date: Sat, 8 Dec 2012 00:08:50 +0000 [thread overview]
Message-ID: <20121208000850.GZ14363@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20121207235904.GA15078@obsidianresearch.com>
On Fri, Dec 07, 2012 at 04:59:04PM -0700, Jason Gunthorpe wrote:
> On Fri, Dec 07, 2012 at 04:24:59PM -0700, Jason Gunthorpe wrote:
> > On Sat, Dec 08, 2012 at 08:15:50AM +0900, Nobuhiro Iwamatsu wrote:
> > > Some kirkwood SoC has thermal sensor.
> > > This patch adds support for 88F6282 and 88F6283.
> >
> > Thanks! I was just about to write this.. Looks good here.
>
> Ah, looking closer:
>
> $ cat /sys/class/thermal/thermal_zone0/temp
> 37
>
> That should be 37000, the value out of the driver should be in
> milli-Celsius.
>
> I'd use this equation instead:
>
> *temp = ((322 - reg) * 10000 * 1000) / 13625;
Be careful of math overflows... make sure you do this calculation using
unsigned arithmetic as temperatures above 157 degress will cause this
to look like a negative number using signed math... However, that
probably won't ever be noticed because at 157 degrees, you'll definitely
be outside the operating limits of the device.
next prev parent reply other threads:[~2012-12-08 0:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-07 23:15 [PATCH 1/2] thermal: Add support for thermal sensor for Kirkwood SoC Nobuhiro Iwamatsu
2012-12-07 23:15 ` [PATCH 2/2] ARM: Kirkwood: Add support thermal sensor for 88F6282 and 88F6283 Nobuhiro Iwamatsu
2012-12-07 23:24 ` [PATCH 1/2] thermal: Add support for thermal sensor for Kirkwood SoC Jason Gunthorpe
2012-12-07 23:59 ` Jason Gunthorpe
2012-12-08 0:08 ` Russell King - ARM Linux [this message]
2012-12-14 21:25 ` Nobuhiro Iwamatsu
2012-12-14 21:22 ` Nobuhiro Iwamatsu
2012-12-08 0:07 ` Thomas Petazzoni
2012-12-08 0:11 ` Russell King - ARM Linux
2012-12-09 13:54 ` Sebastian Hesselbarth
2012-12-14 21:31 ` Nobuhiro Iwamatsu
2012-12-14 21:24 ` Nobuhiro Iwamatsu
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=20121208000850.GZ14363@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--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).