diff mbox

[v1] ACPI / Fan: Use bus id for non PNP0C0B (Fan) device

Message ID 1418170540-8349-2-git-send-email-srinivas.pandruvada@linux.intel.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

srinivas pandruvada Dec. 10, 2014, 12:15 a.m. UTC
The _ART (Active Cooling Relationship Table), specifies relationship
among heat generating sources to a target active cooling device like
fan. The _ART table refers to actual bus id name for specifying relationship.
Naming "Fan" is not enough as name in the _ART table can change on every
platform, to establish relationship for user space thermal controllers.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 drivers/acpi/fan.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Rafael J. Wysocki Dec. 10, 2014, 9:53 p.m. UTC | #1
On Tuesday, December 09, 2014 04:15:40 PM Srinivas Pandruvada wrote:
> The _ART (Active Cooling Relationship Table), specifies relationship
> among heat generating sources to a target active cooling device like
> fan. The _ART table refers to actual bus id name for specifying relationship.
> Naming "Fan" is not enough as name in the _ART table can change on every
> platform, to establish relationship for user space thermal controllers.
> 
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

I can apply this or do you have any thermal material depending on it?

> ---
>  drivers/acpi/fan.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
> index caf9b76..7a36f02 100644
> --- a/drivers/acpi/fan.c
> +++ b/drivers/acpi/fan.c
> @@ -325,6 +325,7 @@ static int acpi_fan_probe(struct platform_device *pdev)
>  	struct thermal_cooling_device *cdev;
>  	struct acpi_fan *fan;
>  	struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
> +	char *name;
>  
>  	fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL);
>  	if (!fan) {
> @@ -346,7 +347,12 @@ static int acpi_fan_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> -	cdev = thermal_cooling_device_register("Fan", device,
> +	if (!strncmp(pdev->name, "PNP0C0B", strlen("PNP0C0B")))
> +		name = "Fan";
> +	else
> +		name = acpi_device_bid(device);
> +
> +	cdev = thermal_cooling_device_register(name, device,
>  						&fan_cooling_ops);
>  	if (IS_ERR(cdev)) {
>  		result = PTR_ERR(cdev);
>
srinivas pandruvada Dec. 10, 2014, 11:18 p.m. UTC | #2
On Wed, 2014-12-10 at 22:53 +0100, Rafael J. Wysocki wrote: 
> On Tuesday, December 09, 2014 04:15:40 PM Srinivas Pandruvada wrote:
> > The _ART (Active Cooling Relationship Table), specifies relationship
> > among heat generating sources to a target active cooling device like
> > fan. The _ART table refers to actual bus id name for specifying relationship.
> > Naming "Fan" is not enough as name in the _ART table can change on every
> > platform, to establish relationship for user space thermal controllers.
> > 
> > Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> 
> I can apply this or do you have any thermal material depending on it?
This patch can go independently as no thermal patches depends on this.
Thanks,
Srinivas 
> 
> > ---
> >  drivers/acpi/fan.c | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
> > index caf9b76..7a36f02 100644
> > --- a/drivers/acpi/fan.c
> > +++ b/drivers/acpi/fan.c
> > @@ -325,6 +325,7 @@ static int acpi_fan_probe(struct platform_device *pdev)
> >  	struct thermal_cooling_device *cdev;
> >  	struct acpi_fan *fan;
> >  	struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
> > +	char *name;
> >  
> >  	fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL);
> >  	if (!fan) {
> > @@ -346,7 +347,12 @@ static int acpi_fan_probe(struct platform_device *pdev)
> >  		}
> >  	}
> >  
> > -	cdev = thermal_cooling_device_register("Fan", device,
> > +	if (!strncmp(pdev->name, "PNP0C0B", strlen("PNP0C0B")))
> > +		name = "Fan";
> > +	else
> > +		name = acpi_device_bid(device);
> > +
> > +	cdev = thermal_cooling_device_register(name, device,
> >  						&fan_cooling_ops);
> >  	if (IS_ERR(cdev)) {
> >  		result = PTR_ERR(cdev);
> > 
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafael J. Wysocki Dec. 11, 2014, 9:03 p.m. UTC | #3
On Wednesday, December 10, 2014 03:18:36 PM Srinivas Pandruvada wrote:
> On Wed, 2014-12-10 at 22:53 +0100, Rafael J. Wysocki wrote: 
> > On Tuesday, December 09, 2014 04:15:40 PM Srinivas Pandruvada wrote:
> > > The _ART (Active Cooling Relationship Table), specifies relationship
> > > among heat generating sources to a target active cooling device like
> > > fan. The _ART table refers to actual bus id name for specifying relationship.
> > > Naming "Fan" is not enough as name in the _ART table can change on every
> > > platform, to establish relationship for user space thermal controllers.
> > > 
> > > Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> > 
> > I can apply this or do you have any thermal material depending on it?
> This patch can go independently as no thermal patches depends on this.

OK, applied.  Thanks!
diff mbox

Patch

diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index caf9b76..7a36f02 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -325,6 +325,7 @@  static int acpi_fan_probe(struct platform_device *pdev)
 	struct thermal_cooling_device *cdev;
 	struct acpi_fan *fan;
 	struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
+	char *name;
 
 	fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL);
 	if (!fan) {
@@ -346,7 +347,12 @@  static int acpi_fan_probe(struct platform_device *pdev)
 		}
 	}
 
-	cdev = thermal_cooling_device_register("Fan", device,
+	if (!strncmp(pdev->name, "PNP0C0B", strlen("PNP0C0B")))
+		name = "Fan";
+	else
+		name = acpi_device_bid(device);
+
+	cdev = thermal_cooling_device_register(name, device,
 						&fan_cooling_ops);
 	if (IS_ERR(cdev)) {
 		result = PTR_ERR(cdev);