From: "Heiko Stübner" <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
To: Eduardo Valentin <edubezval-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
Caesar Wang <caesar.wang-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
rui.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
huangtao-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
cf-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
dtor-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
addy.ke-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
zhaoyifeng <zyf-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH v3 1/4] thermal: rockchip: add driver for thermal
Date: Thu, 28 Aug 2014 18:11:43 +0200 [thread overview]
Message-ID: <3440260.edal29kzlR@diego> (raw)
In-Reply-To: <20140828143733.GA18084@developer>
Am Donnerstag, 28. August 2014, 10:37:35 schrieb Eduardo Valentin:
> Ceasar and Arnd,
>
> On Thu, Aug 28, 2014 at 10:48:23AM +0200, Arnd Bergmann wrote:
> > On Thursday 28 August 2014 08:59:19 Caesar Wang wrote:
> > > Thermal is TS-ADC Controller module supports user-defined mode and
> > > automatic mode.
> > >
> > > User-defined mode refers,TSADC all the control signals entirely by
> > > software
> > > writing to register for direct control.
> > >
> > > Automaic mode refers to the module automatically poll TSADC output,and
> > > the results Were checked.
> > >
> > > If you find that the temperature High in a period of time, an interrupt
> > > is generated to the processor down-measures taken;if the temperature
> > > over a period of time High, the resulting TSHUT gave CRU module,let it
> > > reset the entire chip, or via GPIO give PMIC.
> > >
> > > Signed-off-by: zhaoyifeng <zyf-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> > > Signed-off-by: Caesar Wang <caesar.wang-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> >
> > Hi Caesar,
> >
> > After looking at the driver (last time I only received the patch for
> > the binding), I have a more general comment:
> >
> > This looks like a general-purpose ADC device, not an IP block that is
> > specific to thermal management. The binding looks ok for that purpose
> > but should probably be moved into
> > Documentation/devicetree/bindings/iio/adc/ as a minor change.
>
> I agree with Arnd's point here. It makes sense to me to have this driver
> under the IIO umbrella.
interesting suggestion :-)
I've just taken another look at the registers of the ts-adc on the rk3066
which is completely different from the rk3288 one. Interestingly the rk3066 one
is "just" another saradc IP, so for this one it would really make sense.
> > 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.
Heiko
next prev parent reply other threads:[~2014-08-28 16:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-28 0:59 [PATCH v3 0/4] Rockchip soc theamal driver Caesar Wang
2014-08-28 0:59 ` [PATCH v3 1/4] thermal: rockchip: add driver for thermal Caesar Wang
2014-08-28 8:48 ` Arnd Bergmann
2014-08-28 14:37 ` Eduardo Valentin
2014-08-28 16:11 ` Heiko Stübner [this message]
2014-08-28 16:16 ` Arnd Bergmann
2014-08-28 19:36 ` Caesar Wang
2014-08-28 23:01 ` Heiko Stübner
2014-08-29 1:54 ` 赵仪峰
2014-08-29 11:39 ` edubezval
[not found] ` <CAC-25o-winy6jVjh9_hQ-t2VO2UfxG67pW5DpOve8A2o39EJSw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-29 12:08 ` Huang Tao
2014-08-30 9:30 ` Jonathan Cameron
2014-08-28 0:59 ` [PATCH v3 2/4] dt-bindings: document Rockchip thermal Caesar Wang
2014-08-28 0:59 ` [PATCH v3 3/4] ARM: dts: add main Thermal info to rk3288 Caesar Wang
2014-08-28 0:59 ` [PATCH v4 4/4] ARM: dts: enable Thermal on rk3288-evb board Caesar Wang
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=3440260.edal29kzlR@diego \
--to=heiko-4mtyjxux2i+zqb+pc5nmwq@public.gmane.org \
--cc=addy.ke-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=caesar.wang-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
--cc=cf-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=dtor-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=edubezval-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=huangtao-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
--cc=jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=rui.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=zyf-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
--cc=zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.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).