Skip to contentSkip to conversation

soc: fsl: enable acpi support

PATCH Superseded Ran Wang 2 participants 3 messages Aug 19, 2020 Freescale SoC drivers

v3 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

Ran Wang

author
#0 lore raw

PATCH v3 1/1 soc: fsl: enable acpi support

From: Peng Ma <[email protected]>

This patch enables ACPI support in RCPM driver.

---
Change in v3:
- Add #ifdef CONFIG_ACPI for acpi_device_id
- Rename rcpm_acpi_imx_ids to rcpm_acpi_ids

Change in v2:
- Update acpi_device_id to fix conflict with other driver

 drivers/soc/fsl/rcpm.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/soc/fsl/rcpm.c +12 -1
index a093dbe..55d1d73 100644
@@ -2,7 +2,7 @@
 //
 // rcpm.c - Freescale QorIQ RCPM driver
 //
-// Copyright 2019 NXP
+// Copyright 2019-2020 NXP
 //
 // Author: Ran Wang <[email protected]>
 
@@ -13,6 +13,7 @@
 #include <linux/slab.h>
 #include <linux/suspend.h>
 #include <linux/kernel.h>
+#include <linux/acpi.h>
 
 #define RCPM_WAKEUP_CELL_MAX_SIZE	7
 
@@ -125,6 +126,7 @@ static int rcpm_probe(struct platform_device *pdev)
 
 	ret = device_property_read_u32(&pdev->dev,
 			"#fsl,rcpm-wakeup-cells", &rcpm->wakeup_cells);
+
 	if (ret)
 		return ret;
 
@@ -139,10 +141,19 @@ static const struct of_device_id rcpm_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, rcpm_of_match);
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id rcpm_acpi_ids[] = {
+	{"NXP0015",},
+	{ }
+};
+MODULE_DEVICE_TABLE(acpi, rcpm_acpi_ids);
+#endif
+
 static struct platform_driver rcpm_driver = {
 	.driver = {
 		.name = "rcpm",
 		.of_match_table = rcpm_of_match,
+		.acpi_match_table = ACPI_PTR(rcpm_acpi_ids),
 		.pm	= &rcpm_pm_ops,
 	},
 	.probe = rcpm_probe,
Signature · 1 line
2.7.4
#1 lore raw

Le 19/08/2020 à 06:00, Ran Wang a écrit :

Quoted 3 lines

From: Peng Ma <[email protected]>

This patch enables ACPI support in RCPM driver.

Can you change the subject to "soc: fsl: enable acpi support in RCPM driver" ?

Quoted 36 lines

---
Change in v3:
- Add #ifdef CONFIG_ACPI for acpi_device_id
- Rename rcpm_acpi_imx_ids to rcpm_acpi_ids

Change in v2:
- Update acpi_device_id to fix conflict with other driver

  drivers/soc/fsl/rcpm.c | 13 ++++++++++++-
  1 file changed, 12 insertions(+), 1 deletion(-)
drivers/soc/fsl/rcpm.c +2 -1
index a093dbe..55d1d73 100644
@@ -2,7 +2,7 @@
  //
  // rcpm.c - Freescale QorIQ RCPM driver
  //
-// Copyright 2019 NXP
+// Copyright 2019-2020 NXP
  //
  // Author: Ran Wang <[email protected]>
 
@@ -13,6 +13,7 @@
  #include <linux/slab.h>
  #include <linux/suspend.h>
  #include <linux/kernel.h>
+#include <linux/acpi.h>
 
  #define RCPM_WAKEUP_CELL_MAX_SIZE	7
 

drivers/soc/fsl/rcpm.c static int rcpm_probe(struct platform_device *pdev) · line 129

Quoted 4 lines
drivers/soc/fsl/rcpm.c +1 -0
@@ -125,6 +126,7 @@ static int rcpm_probe(struct platform_device *pdev)
 
  	ret = device_property_read_u32(&pdev->dev,
  			"#fsl,rcpm-wakeup-cells", &rcpm->wakeup_cells);
+

This blank line addition is unrelated to the patch and shouldn't be there.

Christophe

Quoted 24 lines
drivers/soc/fsl/rcpm.c +9 -0
  	if (ret)
  		return ret;
 
@@ -139,10 +141,19 @@ static const struct of_device_id rcpm_of_match[] = {
  };
  MODULE_DEVICE_TABLE(of, rcpm_of_match);
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id rcpm_acpi_ids[] = {
+	{"NXP0015",},
+	{ }
+};
+MODULE_DEVICE_TABLE(acpi, rcpm_acpi_ids);
+#endif
+
  static struct platform_driver rcpm_driver = {
  	.driver = {
  		.name = "rcpm",
  		.of_match_table = rcpm_of_match,
+		.acpi_match_table = ACPI_PTR(rcpm_acpi_ids),
  		.pm	= &rcpm_pm_ops,
  	},
  	.probe = rcpm_probe,
author
#2 lore raw

Hi Christophe

Quoted 9 lines · Christophe Leroy

Le 19/08/2020 à 06:00, Ran Wang a écrit :

Quoted 3 lines

From: Peng Ma <[email protected]>

This patch enables ACPI support in RCPM driver.

Can you change the subject to "soc: fsl: enable acpi support in RCPM driver" ?

Sure.

Quoted 35 lines
Quoted 35 lines

---
Change in v3:
- Add #ifdef CONFIG_ACPI for acpi_device_id
- Rename rcpm_acpi_imx_ids to rcpm_acpi_ids

Change in v2:
- Update acpi_device_id to fix conflict with other driver

  drivers/soc/fsl/rcpm.c | 13 ++++++++++++-
  1 file changed, 12 insertions(+), 1 deletion(-)
drivers/soc/fsl/rcpm.c index renamed from drivers/soc/fsl/rcpm.c +0 -0

a093dbe..55d1d73 100644

drivers/soc/fsl/rcpm.c +2 -1
@@ -2,7 +2,7 @@
  //
  // rcpm.c - Freescale QorIQ RCPM driver
  //
-// Copyright 2019 NXP
+// Copyright 2019-2020 NXP
  //
  // Author: Ran Wang <[email protected]>
 
@@ -13,6 +13,7 @@
  #include <linux/slab.h>
  #include <linux/suspend.h>
  #include <linux/kernel.h>
+#include <linux/acpi.h>
 
  #define RCPM_WAKEUP_CELL_MAX_SIZE	7
 
Quoted 8 lines

drivers/soc/fsl/rcpm.c static int rcpm_probe(struct platform_device · line 130

Quoted 6 lines
drivers/soc/fsl/rcpm.c +1 -0
@@ -125,6 +126,7 @@ static int rcpm_probe(struct platform_device
 *pdev)
 
  	ret = device_property_read_u32(&pdev->dev,
  			"#fsl,rcpm-wakeup-cells", &rcpm->wakeup_cells);
+

This blank line addition is unrelated to the patch and shouldn't be there.

Got it, will remove this in v4, thanks.

Regards,
Ran

Quoted 26 lines

Christophe

drivers/soc/fsl/rcpm.c static const struct of_device_id rcpm_of_match[]

Quoted 4 lines
drivers/soc/fsl/rcpm.c +0 -0
  	if (ret)
  		return ret;
@@ -139,10 +141,19 @@ static const struct of_device_id rcpm_of_match[]

= {

Quoted 19 lines
drivers/soc/fsl/rcpm.c +8 -0
  };
  MODULE_DEVICE_TABLE(of, rcpm_of_match);
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id rcpm_acpi_ids[] = {
+	{"NXP0015",},
+	{ }
+};
+MODULE_DEVICE_TABLE(acpi, rcpm_acpi_ids); #endif
+
  static struct platform_driver rcpm_driver = {
  	.driver = {
  		.name = "rcpm",
  		.of_match_table = rcpm_of_match,
+		.acpi_match_table = ACPI_PTR(rcpm_acpi_ids),
  		.pm	= &rcpm_pm_ops,
  	},
  	.probe = rcpm_probe,