[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4669530.jbaGRecGMH@diego>
Date: Fri, 29 Aug 2014 01:01:40 +0200
From: Heiko Stübner <heiko@...ech.de>
To: Caesar Wang <caesar.wang@...k-chips.com>,
Eduardo Valentin <edubezval@...il.com>,
Jonathan Cameron <jic23@...nel.org>
Cc: Arnd Bergmann <arnd@...db.de>, rui.zhang@...el.com,
grant.likely@...aro.org, robh+dt@...nel.org,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
linux-doc@...r.kernel.org, huangtao@...k-chips.com,
cf@...k-chips.com, dianders@...omium.org, dtor@...omium.org,
zyw@...k-chips.com, addy.ke@...k-chips.com,
dmitry.torokhov@...il.com, zhaoyifeng <zyf@...k-chips.com>,
linux-iio@...r.kernel.org,
Courtney Cavin <courtney.cavin@...ymobile.com>
Subject: Re: [PATCH v3 1/4] thermal: rockchip: add driver for thermal
Hi Caesar,
Am Freitag, 29. August 2014, 03:36:36 schrieb Caesar Wang:
> Arnd & Heiko & Eduardo,
>
> OK. Maybe you are right.
>
> This driver should be put into drivers/iio/adc/* ,
> Anyway,I will re-edit it ASAP.
I pieced together an example on how this could look, if you need inspiration.
As I've written, the tsadc on the rk3066 is simply another saradc, so it was
easy to build a usable example with it, which you can find in my
devel/workbench branch [0].
Things to note, the adc values are converted to voltages instead of the
"code"-values listed in the TRM [formula: (code * vref_mv) >> 12)] and the
temperatures are listed in millikelvin (C+273150) as expected by the pending
iio-thermal driver.
@Courtney: (not sure how to reply to the old thread from february)
the only issue I found was the unit of the voltages. The binding doc lists
them as uV, while iio (and the driver itself) expect to use mV.
Otherwise the iio-thermal driver:
Tested-by: Heiko Stuebner <heiko@...ech.de>
Heiko
[0] https://github.com/mmind/linux-rockchip/commits/devel/workbench
(recent commits till "thermal: add generic IIO channel thermal sensor driver")
> 在 2014/8/29 0:16, Arnd Bergmann 写道:
> > On Thursday 28 August 2014 18:11:43 Heiko Stübner wrote:
> >> Am Donnerstag, 28. August 2014, 10:37:35 schrieb Eduardo Valentin:
> >>>> On the driver side, I believe the correct way to deal with this setup
> >>>> is to split your driver into a generic
> >>>> drivers/iio/adc/rockchips-tsadc.c
> >>>> file, and a smaller thermal driver that uses the iio in-kernel
> >>>> interfaces,
> >>>> ideally one that is independent of the underlying hardware and can
> >>>> work on any ADC implementation.
> >>>
> >>> Agreed. If you can write such interface and make your driver to work in
> >>> such way, that would be great.
> >>
> >> But I currently don't see how you would model the temperature handling
> >> parts from a generic thermal driver to a generic adc driver for the
> >> rk3288-tsadc.
> >>
> >> I guess the general temperature irq handling would use iio-triggers? But
> >> how does the target temperature get into the TSADC_COMP1_INT register.
> >>
> >> Also when getting the temperature, Caesar's driver compares it to its
> >> trip
> >> points and sets the next trip point depending on the current temperature
> >> (passive <-> critical) in rockchip_get_temp.
> >>
> >> Maybe there is some completely easy way for this, but currently I don't
> >> see
> >> it.
> >
> > Eduardo earlier today replied to an email about a generic driver for
> > thermal, which was posted in February but hasn't been merged.
> > See https://lkml.org/lkml/2014/2/5/810
> >
> > There may be a newer version of this patch, which I haven't found.
> >
> > Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists