Skip to contentSkip to conversation

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

PATCH New Srinivas Pandruvada 2 participants 5 messages Dec 10, 2014 – Dec 11, 2014 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI / Fan: Use bus id for non PNP0C0B (Fan) device

v1
Except for PNP0C0B Fan device, use ACPI bus id.

v0
Explicit comparison with INT3404 for using acpi bus id.

Srinivas Pandruvada (1):
ACPI / Fan: Use bus id for non PNP0C0B (Fan) device

 drivers/acpi/fan.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 ACPI / Fan: Use bus id for non PNP0C0B (Fan) device

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.

---
 drivers/acpi/fan.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/acpi/fan.c +7 -1
index caf9b76..7a36f02 100644
@@ -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);
Signature · 1 line
1.9.1
#2 lore raw
Quoted 7 lines · Srinivas Pandruvada

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.

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

Quoted 31 lines
---
 drivers/acpi/fan.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/acpi/fan.c +7 -1
index caf9b76..7a36f02 100644
@@ -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);
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#3 lore raw
Quoted 10 lines · Rafael J. Wysocki
Quoted 7 lines · Srinivas Pandruvada

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.

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

Quoted 33 lines
Quoted 32 lines
---
 drivers/acpi/fan.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/acpi/fan.c +7 -1
index caf9b76..7a36f02 100644
@@ -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);
#4 lore raw
Quoted 8 lines · Srinivas Pandruvada
Quoted 7 lines · Rafael J. Wysocki
Quoted 6 lines · Srinivas Pandruvada

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.

Quoted 4 lines
Quoted 3 lines
Quoted 1 line

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!

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.