Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1221005 > unrolled thread
| Started by | Geert Uytterhoeven <geert+renesas@glider.be> |
|---|---|
| First post | 2015-09-08 19:10 +0200 |
| Last post | 2015-09-09 02:50 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH v2] staging: board: Migrate away from __pm_genpd_name_add_device() Geert Uytterhoeven <geert+renesas@glider.be> - 2015-09-08 19:10 +0200
Re: [PATCH v2] staging: board: Migrate away from __pm_genpd_name_add_device() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-09-08 21:10 +0200
Re: [PATCH v2] staging: board: Migrate away from __pm_genpd_name_add_device() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-09-09 02:50 +0200
| From | Geert Uytterhoeven <geert+renesas@glider.be> |
|---|---|
| Date | 2015-09-08 19:10 +0200 |
| Subject | [PATCH v2] staging: board: Migrate away from __pm_genpd_name_add_device() |
| Message-ID | <q6uz7-26l-17@gated-at.bofh.it> |
The named genpd APIs are deprecated. Hence convert the board staging
code from using genpd names to DT node paths.
For now this supports PM domains with "#power-domain-cells = <0>" only.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
---
Rafael, Greg: If Greg provides his Acked-by, Rafael can apply this patch
to the linux-pm tree as a prerequisite for Ulf's patches to remove the
named genpd APIs.
Thanks!
v2:
- Add Reviewed-by.
---
drivers/staging/board/armadillo800eva.c | 2 +-
drivers/staging/board/board.c | 36 ++++++++++++++++++++++++++++++++-
2 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/board/armadillo800eva.c b/drivers/staging/board/armadillo800eva.c
index 81df77bd55cc9868..9c41652ee908b5e8 100644
--- a/drivers/staging/board/armadillo800eva.c
+++ b/drivers/staging/board/armadillo800eva.c
@@ -91,7 +91,7 @@ static const struct board_staging_dev armadillo800eva_devices[] __initconst = {
.pdev = &lcdc0_device,
.clocks = lcdc0_clocks,
.nclocks = ARRAY_SIZE(lcdc0_clocks),
- .domain = "a4lc",
+ .domain = "/system-controller@e6180000/pm-domains/c5/a4lc@1"
},
};
diff --git a/drivers/staging/board/board.c b/drivers/staging/board/board.c
index 29d456e29f38feac..3eb5eb8f069c236d 100644
--- a/drivers/staging/board/board.c
+++ b/drivers/staging/board/board.c
@@ -135,6 +135,40 @@ int __init board_staging_register_clock(const struct board_staging_clk *bsc)
return error;
}
+#ifdef CONFIG_PM_GENERIC_DOMAINS_OF
+static int board_staging_add_dev_domain(struct platform_device *pdev,
+ const char *domain)
+{
+ struct of_phandle_args pd_args;
+ struct generic_pm_domain *pd;
+ struct device_node *np;
+
+ np = of_find_node_by_path(domain);
+ if (!np) {
+ pr_err("Cannot find domain node %s\n", domain);
+ return -ENOENT;
+ }
+
+ pd_args.np = np;
+ pd_args.args_count = 0;
+ pd = of_genpd_get_from_provider(&pd_args);
+ if (IS_ERR(pd)) {
+ pr_err("Cannot find genpd %s (%ld)\n", domain, PTR_ERR(pd));
+ return PTR_ERR(pd);
+
+ }
+ pr_debug("Found genpd %s for device %s\n", pd->name, pdev->name);
+
+ return pm_genpd_add_device(pd, &pdev->dev);
+}
+#else
+static inline int board_staging_add_dev_domain(struct platform_device *pdev,
+ const char *domain)
+{
+ return 0;
+}
+#endif
+
int __init board_staging_register_device(const struct board_staging_dev *dev)
{
struct platform_device *pdev = dev->pdev;
@@ -161,7 +195,7 @@ int __init board_staging_register_device(const struct board_staging_dev *dev)
}
if (dev->domain)
- __pm_genpd_name_add_device(dev->domain, &pdev->dev, NULL);
+ board_staging_add_dev_domain(pdev, dev->domain);
return error;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2015-09-08 21:10 +0200 |
| Subject | Re: [PATCH v2] staging: board: Migrate away from __pm_genpd_name_add_device() |
| Message-ID | <q6wrh-4Ph-37@gated-at.bofh.it> |
| In reply to | #1221005 |
On Tue, Sep 08, 2015 at 07:06:03PM +0200, Geert Uytterhoeven wrote: > The named genpd APIs are deprecated. Hence convert the board staging > code from using genpd names to DT node paths. > > For now this supports PM domains with "#power-domain-cells = <0>" only. > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> > --- > Rafael, Greg: If Greg provides his Acked-by, Rafael can apply this patch > to the linux-pm tree as a prerequisite for Ulf's patches to remove the > named genpd APIs. > Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| Date | 2015-09-09 02:50 +0200 |
| Message-ID | <q6BKi-3RN-19@gated-at.bofh.it> |
| In reply to | #1221042 |
On Tuesday, September 08, 2015 12:06:53 PM Greg Kroah-Hartman wrote: > On Tue, Sep 08, 2015 at 07:06:03PM +0200, Geert Uytterhoeven wrote: > > The named genpd APIs are deprecated. Hence convert the board staging > > code from using genpd names to DT node paths. > > > > For now this supports PM domains with "#power-domain-cells = <0>" only. > > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > > Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> > > --- > > Rafael, Greg: If Greg provides his Acked-by, Rafael can apply this patch > > to the linux-pm tree as a prerequisite for Ulf's patches to remove the > > named genpd APIs. > > > > Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Queued up for the next PM pull request, thanks! Rafael -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web