Re: [PATCH] thermal: use device node to get thermal zone

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux