RE: How to use the generic thermal sysfs.

From: R, Durgadoss
Date: Thu Jul 12 2012 - 06:54:50 EST


Hi,

> -----Original Message-----
> From: Wei Ni [mailto:wni@xxxxxxxxxx]
> Sent: Thursday, July 12, 2012 3:53 PM
> To: Zhang, Rui; Brown, Len; akpm@xxxxxxxxxxxxxxxxxxxx; khali@xxxxxxxxxxxx;
> joe@xxxxxxxxxxx; R, Durgadoss
> Cc: linux-kernel@xxxxxxxxxxxxxxx; linux-tegra@xxxxxxxxxxxxxx;
> acourbot@xxxxxxxxxx
> Subject: How to use the generic thermal sysfs.
>
> Hi, all
> I'm working on the tegra thermal throttling upstream issue.
> The tegra30 board use the nct1008 as the thermal sensor, and the lm90 is
> the sensor driver. We want to use the generic thermal sysfs.
>
> My question is where should we register the thermal zone device? We may
> have two place to do it:
> 1. register it in the sensor driver, such as lm90.c
> In this way, the sensor driver doesn't need to export any APIs, such as
> get_temp.

This approach is preferred.

> 2. register in my tegra thermal framework.
> In this way, the sensor driver need to export some APIs, which are used
> to register the ops and do any other things.

What do you mean by "my tegra thermal framework" ? Where does the source
file for this sit in the mainline kernel ?

>
> How should I do it?
>
> And in current codes, there have the event notification, in the form of
> a netlink event. But it's difficult to be used in the kernel, it's
> normally for the communication with user-space. How about to add a
> notify call chain for it? So when the sensor has irq alert, it can send
> a notify to my thermal framework in kernel.

We are working on a notification API from any generic sensor driver to
the thermal framework.
Please have a look at the 'notify_thermal_framework' API in the patch here:
http://www.spinics.net/lists/linux-acpi/msg36049.html

Thanks,
Durga

èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébëæìr¸›zX§»®w¥Š{ayºÊÚë,j­¢f£¢·hš‹àz¹®w¥¢¸ ¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾«‘êçzZ+ƒùšŽŠÝj"ú!¶iO•æ¬z·švØ^¶m§ÿðà nÆàþY&—