linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Wei Ni <wni@nvidia.com>,
	Eduardo Valentin <eduardo.valentin@ti.com>,
	"R, Durgadoss" <durgadoss.r@intel.com>
Cc: "Zhang, Rui" <rui.zhang@intel.com>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	Matthew Longnecker <MLongnecker@nvidia.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH] thermal: use device node to get thermal zone
Date: Tue, 14 Jan 2014 10:33:44 -0700	[thread overview]
Message-ID: <52D574F8.7020100@wwwdotorg.org> (raw)
In-Reply-To: <52CE5615.8040204@nvidia.com>

On 01/09/2014 12:56 AM, Wei Ni wrote:
...
> On the tegra board, it will use two or more sensors to estimate the skin
> temperature by reading temps from these sensors and calculate them.
> For example, we have two sensors: sensor1 and sensor2. We can register
> them to thermal framework by using DT, something like:
> thermal-zones {
>                 sensor1: lm90-local {
> 			...
>                         thermal-sensors = <&lm90 0>;
>                 };
> 
>                 sensor2: lm90-remote {
> 			...
>                         thermal-sensors = <&lm90 1>;
>                 };
> }
> 
> Then I will add a device node for my skin temperature driver, something
> like:
> skin_temp {
> 	...
> 	#thermal-sensor-cells = <0>;
> 
> 	sub-devs {
> 		dev@0 {
> 			dev = <&sensor1>;
> 		};
> 
> 		dev@1 {
> 			dev = <&sensor2>;
> 		};
> 	};
> };

I haven't read the rest of the thread, but surely that last chunk of DT
would be far simpler as:

skin_temp {
	sub-devs = <&sensor1 &sensor2>;
};

or:

skin_temp {
	sensors = <&sensor1 &sensor2>;
	sensor-names = "local", "remote";
};

> So I can parse the DT in the skin temperature driver to get the nodes of
> the sensor1 and sensor2, and can use .*get_by_node to get thermal zone
> device, then use .get_temp() and other callbacks to get temperature and
> other information. If use the *.get_by_name, it may not get the uniqu
> one, because I don't know if there has the same name thermal zone,
> because some other driver may not use DT to register thermal zone, it
> can define any name by itself.


      reply	other threads:[~2014-01-14 17:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-08  9:06 [PATCH] thermal: use device node to get thermal zone Wei Ni
     [not found] ` <1389172011-32107-1-git-send-email-wni-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-01-08 11:10   ` R, Durgadoss
     [not found]     ` <4D68720C2E767A4AA6A8796D42C8EB59E09ED1-yHIBzpp8AekElmVAvsQTrbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-01-08 12:31       ` Eduardo Valentin
     [not found]         ` <52CD452D.3080508-l0cyMroinI0@public.gmane.org>
2014-01-09  7:56           ` Wei Ni
2014-01-14 17:33             ` Stephen Warren [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=52D574F8.7020100@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=MLongnecker@nvidia.com \
    --cc=durgadoss.r@intel.com \
    --cc=eduardo.valentin@ti.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=rui.zhang@intel.com \
    --cc=wni@nvidia.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 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).