From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
rui.zhang@intel.com, jason@lakedaemon.net,
linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH 1/2] thermal: Add support for thermal sensor for Kirkwood SoC
Date: Sat, 15 Dec 2012 06:25:39 +0900 [thread overview]
Message-ID: <CABMQnVJHyfzJaDeMM20Hg=G4R8r2HfGO_pVJ+scZMwUeTKfJYg@mail.gmail.com> (raw)
In-Reply-To: <20121208000850.GZ14363@n2100.arm.linux.org.uk>
Hi,
On Sat, Dec 8, 2012 at 9:08 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> 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.
Oh, OK. I would like to thank you pointed out.
I will fix.
Best regards,
Nobuhiro
--
Nobuhiro Iwamatsu
iwamatsu at {nigauri.org / debian.org}
GPG ID: 40AD1FA6
WARNING: multiple messages have this Message-ID (diff)
From: iwamatsu@nigauri.org (Nobuhiro Iwamatsu)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] thermal: Add support for thermal sensor for Kirkwood SoC
Date: Sat, 15 Dec 2012 06:25:39 +0900 [thread overview]
Message-ID: <CABMQnVJHyfzJaDeMM20Hg=G4R8r2HfGO_pVJ+scZMwUeTKfJYg@mail.gmail.com> (raw)
In-Reply-To: <20121208000850.GZ14363@n2100.arm.linux.org.uk>
Hi,
On Sat, Dec 8, 2012 at 9:08 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> 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.
Oh, OK. I would like to thank you pointed out.
I will fix.
Best regards,
Nobuhiro
--
Nobuhiro Iwamatsu
iwamatsu at {nigauri.org / debian.org}
GPG ID: 40AD1FA6
next prev parent reply other threads:[~2012-12-14 21:26 UTC|newest]
Thread overview: 24+ 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 ` 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:15 ` 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:24 ` Jason Gunthorpe
2012-12-07 23:59 ` Jason Gunthorpe
2012-12-07 23:59 ` Jason Gunthorpe
2012-12-08 0:08 ` Russell King - ARM Linux
2012-12-08 0:08 ` Russell King - ARM Linux
2012-12-14 21:25 ` Nobuhiro Iwamatsu [this message]
2012-12-14 21:25 ` Nobuhiro Iwamatsu
2012-12-14 21:22 ` Nobuhiro Iwamatsu
2012-12-14 21:22 ` Nobuhiro Iwamatsu
2012-12-08 0:07 ` Thomas Petazzoni
2012-12-08 0:07 ` Thomas Petazzoni
2012-12-08 0:11 ` Russell King - ARM Linux
2012-12-08 0:11 ` Russell King - ARM Linux
2012-12-09 13:54 ` Sebastian Hesselbarth
2012-12-09 13:54 ` Sebastian Hesselbarth
2012-12-14 21:31 ` Nobuhiro Iwamatsu
2012-12-14 21:31 ` Nobuhiro Iwamatsu
2012-12-14 21:24 ` 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='CABMQnVJHyfzJaDeMM20Hg=G4R8r2HfGO_pVJ+scZMwUeTKfJYg@mail.gmail.com' \
--to=iwamatsu@nigauri.org \
--cc=jason@lakedaemon.net \
--cc=jgunthorpe@obsidianresearch.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=rui.zhang@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.