linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-REPOST] thermal: of: look for sensor driver parent node if device node missing
@ 2014-07-25  9:19 Laxman Dewangan
  2014-07-25  9:30 ` Javi Merino
  2014-07-29 14:12 ` Eduardo Valentin
  0 siblings, 2 replies; 5+ messages in thread
From: Laxman Dewangan @ 2014-07-25  9:19 UTC (permalink / raw)
  To: rui.zhang, eduardo.valentin
  Cc: linux-pm, linux-kernel, javi.merino, Laxman Dewangan

There are some mfd devices which supports junction thermal interrupt
like ams,AS3722. The DT binding of these devices are defined as the
flat and drivers for sub module of such devices are registered as
the mfd_add_devices. In this method, the sub devices registered as
platform driver and these do not have the of_node pointer on their
device structure. In this case, use the parent of_node pointer to
get the required of_node pointer.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
I typed differnet email ID for Eduardo and so it did not reach to him.
Resending the patch with correct ID.

 drivers/thermal/of-thermal.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index 04b1be7..85a7d71 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -396,6 +396,8 @@ thermal_zone_of_sensor_register(struct device *dev, int sensor_id,
 		return ERR_PTR(-EINVAL);
 
 	sensor_np = dev->of_node;
+	if (!sensor_np && dev->parent)
+		sensor_np = dev->parent->of_node;
 
 	for_each_child_of_node(np, child) {
 		struct of_phandle_args sensor_specs;
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH-REPOST] thermal: of: look for sensor driver parent node if device node missing
  2014-07-25  9:19 [PATCH-REPOST] thermal: of: look for sensor driver parent node if device node missing Laxman Dewangan
@ 2014-07-25  9:30 ` Javi Merino
  2014-07-29 14:12 ` Eduardo Valentin
  1 sibling, 0 replies; 5+ messages in thread
From: Javi Merino @ 2014-07-25  9:30 UTC (permalink / raw)
  To: Laxman Dewangan
  Cc: rui.zhang@intel.com, Eduardo Valentin, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org

[Fixed Eduardo's email *again*]

On Fri, Jul 25, 2014 at 10:19:31AM +0100, Laxman Dewangan wrote:
> There are some mfd devices which supports junction thermal interrupt
> like ams,AS3722. The DT binding of these devices are defined as the
> flat and drivers for sub module of such devices are registered as
> the mfd_add_devices. In this method, the sub devices registered as
> platform driver and these do not have the of_node pointer on their
> device structure. In this case, use the parent of_node pointer to
> get the required of_node pointer.
> 
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> ---
> I typed differnet email ID for Eduardo and so it did not reach to him.
> Resending the patch with correct ID.
> 
>  drivers/thermal/of-thermal.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
> index 04b1be7..85a7d71 100644
> --- a/drivers/thermal/of-thermal.c
> +++ b/drivers/thermal/of-thermal.c
> @@ -396,6 +396,8 @@ thermal_zone_of_sensor_register(struct device *dev, int sensor_id,
>  		return ERR_PTR(-EINVAL);
>  
>  	sensor_np = dev->of_node;
> +	if (!sensor_np && dev->parent)
> +		sensor_np = dev->parent->of_node;
>  
>  	for_each_child_of_node(np, child) {
>  		struct of_phandle_args sensor_specs;
> -- 
> 1.8.1.5
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH-REPOST] thermal: of: look for sensor driver parent node if device node missing
  2014-07-25  9:19 [PATCH-REPOST] thermal: of: look for sensor driver parent node if device node missing Laxman Dewangan
  2014-07-25  9:30 ` Javi Merino
@ 2014-07-29 14:12 ` Eduardo Valentin
  2014-07-29 14:23   ` Laxman Dewangan
  1 sibling, 1 reply; 5+ messages in thread
From: Eduardo Valentin @ 2014-07-29 14:12 UTC (permalink / raw)
  To: Laxman Dewangan
  Cc: rui.zhang, eduardo.valentin, linux-pm, linux-kernel, javi.merino

Hello Laxman,

On Fri, Jul 25, 2014 at 02:49:31PM +0530, Laxman Dewangan wrote:
> There are some mfd devices which supports junction thermal interrupt
> like ams,AS3722. The DT binding of these devices are defined as the
> flat and drivers for sub module of such devices are registered as
> the mfd_add_devices. In this method, the sub devices registered as
> platform driver and these do not have the of_node pointer on their
> device structure. In this case, use the parent of_node pointer to
> get the required of_node pointer.
> 

Can you please elaborate a bit more on your proposal? So, you would
append the thermal zones on the DT node of the MFD device?

To me looks like MFD becomes sowhat obsolete with DT.

Besides, to what I could see from past iterations, MFD with DT seams to
be a controvertial subject. That is, we have people that agree to have
it, and people that are not fan of it.

> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> ---
> I typed differnet email ID for Eduardo and so it did not reach to him.
> Resending the patch with correct ID.
> 
>  drivers/thermal/of-thermal.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
> index 04b1be7..85a7d71 100644
> --- a/drivers/thermal/of-thermal.c
> +++ b/drivers/thermal/of-thermal.c
> @@ -396,6 +396,8 @@ thermal_zone_of_sensor_register(struct device *dev, int sensor_id,
>  		return ERR_PTR(-EINVAL);
>  
>  	sensor_np = dev->of_node;
> +	if (!sensor_np && dev->parent)
> +		sensor_np = dev->parent->of_node;
>  
>  	for_each_child_of_node(np, child) {
>  		struct of_phandle_args sensor_specs;
> -- 
> 1.8.1.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH-REPOST] thermal: of: look for sensor driver parent node if device node missing
  2014-07-29 14:12 ` Eduardo Valentin
@ 2014-07-29 14:23   ` Laxman Dewangan
  2014-07-30 13:20     ` Eduardo Valentin
  0 siblings, 1 reply; 5+ messages in thread
From: Laxman Dewangan @ 2014-07-29 14:23 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: rui.zhang@intel.com, eduardo.valentin@gmail.com,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	javi.merino@arm.com

On Tuesday 29 July 2014 07:42 PM, Eduardo Valentin wrote:
> Hello Laxman,
>
> On Fri, Jul 25, 2014 at 02:49:31PM +0530, Laxman Dewangan wrote:
>> There are some mfd devices which supports junction thermal interrupt
>> like ams,AS3722. The DT binding of these devices are defined as the
>> flat and drivers for sub module of such devices are registered as
>> the mfd_add_devices. In this method, the sub devices registered as
>> platform driver and these do not have the of_node pointer on their
>> device structure. In this case, use the parent of_node pointer to
>> get the required of_node pointer.
>>
> Can you please elaborate a bit more on your proposal? So, you would
> append the thermal zones on the DT node of the MFD device?

Yes, mfd node for ams,as3722 is flat node, almost all sub-module driver 
have their property on this node only. Regulator have their own sub node 
under this node.

as3722 {
         compatible = "ams,as3722";
         #gpio-contorller;
         #gpio-cells = <2>;
     ::::::::::
         regulator {
                 ::::
         };
};


So in this, the thermal sensor driver's property is on the as3722 node 
only and thermal zone need to refer this node for sensor.

However, as3722 thermal sensor driver is register as sub mfd devices 
through mfd_add_devices() and thermal sensor drivers pdev->dev.of_node 
does not have any valid pointer.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH-REPOST] thermal: of: look for sensor driver parent node if device node missing
  2014-07-29 14:23   ` Laxman Dewangan
@ 2014-07-30 13:20     ` Eduardo Valentin
  0 siblings, 0 replies; 5+ messages in thread
From: Eduardo Valentin @ 2014-07-30 13:20 UTC (permalink / raw)
  To: Laxman Dewangan
  Cc: rui.zhang@intel.com, eduardo.valentin@gmail.com,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	javi.merino@arm.com

Laxman,

On Tue, Jul 29, 2014 at 07:53:58PM +0530, Laxman Dewangan wrote:
> On Tuesday 29 July 2014 07:42 PM, Eduardo Valentin wrote:
> > Hello Laxman,
> >
> > On Fri, Jul 25, 2014 at 02:49:31PM +0530, Laxman Dewangan wrote:
> >> There are some mfd devices which supports junction thermal interrupt
> >> like ams,AS3722. The DT binding of these devices are defined as the
> >> flat and drivers for sub module of such devices are registered as
> >> the mfd_add_devices. In this method, the sub devices registered as
> >> platform driver and these do not have the of_node pointer on their
> >> device structure. In this case, use the parent of_node pointer to
> >> get the required of_node pointer.
> >>
> > Can you please elaborate a bit more on your proposal? So, you would
> > append the thermal zones on the DT node of the MFD device?
> 
> Yes, mfd node for ams,as3722 is flat node, almost all sub-module driver 
> have their property on this node only. Regulator have their own sub node 
> under this node.
> 
> as3722 {
>          compatible = "ams,as3722";
>          #gpio-contorller;
>          #gpio-cells = <2>;
>      ::::::::::
>          regulator {
>                  ::::
>          };
> };
> 
> 
> So in this, the thermal sensor driver's property is on the as3722 node 
> only and thermal zone need to refer this node for sensor.
> 
> However, as3722 thermal sensor driver is register as sub mfd devices 
> through mfd_add_devices() and thermal sensor drivers pdev->dev.of_node 
> does not have any valid pointer.

In such case, the MFD driver shall populate the required data while
creating the sub device, right?


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-30 13:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-25  9:19 [PATCH-REPOST] thermal: of: look for sensor driver parent node if device node missing Laxman Dewangan
2014-07-25  9:30 ` Javi Merino
2014-07-29 14:12 ` Eduardo Valentin
2014-07-29 14:23   ` Laxman Dewangan
2014-07-30 13:20     ` Eduardo Valentin

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).