From: Eduardo Valentin <edubezval@gmail.com>
To: Mason <slash.tmp@free.fr>
Cc: linux-pm <linux-pm@vger.kernel.org>,
Zhang Rui <rui.zhang@intel.com>,
Javi Merino <javi.merino@arm.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
Arnd Bergmann <arnd@arndb.de>, Mans Rullgard <mans@mansr.com>,
Rob Herring <robh@kernel.org>
Subject: Re: [PATCH v5] thermal: add temperature sensor support for tango SoC
Date: Thu, 31 Mar 2016 18:48:14 -0700 [thread overview]
Message-ID: <20160401014812.GA19409@localhost.localdomain> (raw)
In-Reply-To: <56FBEE4F.3060106@free.fr>
Hello Mason,
>
> The SMP8758 has the 3. The next SoC has 5, in different HW blocks.
> HW team likes to move them around, apparently.
>
> > So, what to expect from this driver ?
>
> One should expect this device driver to support the temperature sensor
> used in Tango chips since the SMP8758, by using the "sigma,smp8758-thermal"
> compatible string in DT nodes.
Ok, I see. Then, following the design you chose to use (of-thermal
based), determining what each sensor represents is typically solved by
describing them in device tree.
You did already a good job for the sensor part, but your patch (even v6)
do not include any thermal zone definition. So, what to do from here?
whenever possible, it is common that, together with your driver code,
you also do the device tree changes. Typically, for thermal zones,
people have been adding them on .dtsi files, so that they can be reused
on board files (dts).
You should be able to get examples from
Documentation/devicetree/bindings/thermal/thermal.txt
or do a git grep thermal-zone arch/arm/boot/dts/, and you should be able
to see how people are doing this, consistently. But some chips can get
several zones though.
>
> >> Nit: we don't spin, we sleep.
> >
> > Well, we are using timers, you are right, but we are still using the CPU
> > to check the hardware status. Is there a better way to do this? If it is
> > threshold based, does the hardware produces IRQs?
>
> That I know for sure: there are no IRQ lines coming out of the
> HW block.
Ok.
>
> > Does this hardware support reading temperature in a different way? I
> > must say this is an awkward way of doing this, even worst blindly without
> > documentation.
>
> The documentation states:
>
> "The temp sensor uses a bandgap type of circuit to compare a voltage which
> has a negative temperature coefficient with a voltage that is proportional
> to absolute temperature. A resistor bank allows 40 different temperature
> thresholds to be selected and the logic output 'out_temperature' will then
> indicate whether the actual die temperature lies above or below the selected
> threshold."
>
> [NB: there are, in fact, 41 thresholds. The data sheet is inaccurate in a few places. ]
>
> Characteristics
>
> Symbol Parameter Min Typ Max Unit
>
> (Operating conditions)
> Tjunc Junction temperature -40 25 125 °C
> Vdd Supply voltage 1.0 1.1 1.26 V
>
> (Normal operating mode)
> Idd Supply current 50 60 μA
> Vbandgapref Ref output voltage 0.72 0.8 0.88 V
> ∆outtemp Absolute Temp ±2 ±10 °C
> threshold error
> T_res Temp resolution 3 4.5 7 °C
>
> I think the expected use-case was to program a "critical" threshold,
> and have the 1-bit output signal "Oh no, we are melting down!".
> But the HW guys thought "Hey, let's use this as a thermometer."
I see.
>
> > I am just attempting to understand this code and if it makes sense at
> > all. Of course, without hardware doc all this is just guessing.
>
> This is what the HW guys recommend:
>
> 1) Set the thresh to the desired value
> 2) Wait unknown amount of time
> 3) Read the 1-bit result
>
> I will try to address most of your comments in a v6 in the next few days.
>
> Thanks for your reviews, by the way.
No problem.
>
> Regards.
>
prev parent reply other threads:[~2016-04-01 1:48 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-01 16:49 [RFC] Temperature sensor driver (tango) Mason
2016-03-04 15:52 ` [PATCH v2] thermal: add temperature sensor support for tango SoC Mason
2016-03-08 21:48 ` Eduardo Valentin
2016-03-21 10:31 ` Mason
2016-03-24 12:18 ` [PATCH v3] " Mason
2016-03-24 17:56 ` Mason
2016-03-27 20:35 ` [PATCH v4] " Mason
2016-03-28 11:49 ` [PATCH v5] " Mason
2016-03-29 2:00 ` Eduardo Valentin
2016-03-29 18:48 ` Mason
2016-03-30 0:05 ` Eduardo Valentin
2016-03-30 15:18 ` Mason
2016-03-31 20:16 ` [PATCH v6] " Mason
2016-04-01 1:52 ` Eduardo Valentin
2016-04-04 11:48 ` Mason
2016-04-04 11:49 ` [PATCH v7] " Mason
2016-04-05 2:05 ` Eduardo Valentin
2016-04-05 14:58 ` Mason
2016-04-06 15:48 ` Eduardo Valentin
2016-04-06 15:51 ` Eduardo Valentin
2016-04-13 20:28 ` Mason
2016-04-19 14:21 ` [PATCH v8 1/2] " Mason
2016-04-19 14:49 ` Mason
2016-04-19 14:32 ` [PATCH v8 2/2] ARM: dts: tango4: Initial thermal support Mason
2016-04-20 22:45 ` Eduardo Valentin
2016-04-01 1:48 ` Eduardo Valentin [this message]
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=20160401014812.GA19409@localhost.localdomain \
--to=edubezval@gmail.com \
--cc=arnd@arndb.de \
--cc=javi.merino@arm.com \
--cc=linux-pm@vger.kernel.org \
--cc=mans@mansr.com \
--cc=robh@kernel.org \
--cc=rui.zhang@intel.com \
--cc=slash.tmp@free.fr \
--cc=viresh.kumar@linaro.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).