aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2015-09-08 13:06:03 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-09-08 20:18:25 -0400
commitf33b77408a91d4427374010897b90af678dc47be (patch)
treeb165d4f45576166b02f2fed84a2591190f04c8a1
parent30e7a65b3fdb53cc49f85c965095e40aceea3961 (diff)
staging: board: Migrate away from __pm_genpd_name_add_device()
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> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/staging/board/armadillo800eva.c2
-rw-r--r--drivers/staging/board/board.c36
2 files changed, 36 insertions, 2 deletions
diff --git a/drivers/staging/board/armadillo800eva.c b/drivers/staging/board/armadillo800eva.c
index 81df77bd55cc..9c41652ee908 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 = {
91 .pdev = &lcdc0_device, 91 .pdev = &lcdc0_device,
92 .clocks = lcdc0_clocks, 92 .clocks = lcdc0_clocks,
93 .nclocks = ARRAY_SIZE(lcdc0_clocks), 93 .nclocks = ARRAY_SIZE(lcdc0_clocks),
94 .domain = "a4lc", 94 .domain = "/system-controller@e6180000/pm-domains/c5/a4lc@1"
95 }, 95 },
96}; 96};
97 97
diff --git a/drivers/staging/board/board.c b/drivers/staging/board/board.c
index 29d456e29f38..3eb5eb8f069c 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)
135 return error; 135 return error;
136} 136}
137 137
138#ifdef CONFIG_PM_GENERIC_DOMAINS_OF
139static int board_staging_add_dev_domain(struct platform_device *pdev,
140 const char *domain)
141{
142 struct of_phandle_args pd_args;
143 struct generic_pm_domain *pd;
144 struct device_node *np;
145
146 np = of_find_node_by_path(domain);
147 if (!np) {
148 pr_err("Cannot find domain node %s\n", domain);
149 return -ENOENT;
150 }
151
152 pd_args.np = np;
153 pd_args.args_count = 0;
154 pd = of_genpd_get_from_provider(&pd_args);
155 if (IS_ERR(pd)) {
156 pr_err("Cannot find genpd %s (%ld)\n", domain, PTR_ERR(pd));
157 return PTR_ERR(pd);
158
159 }
160 pr_debug("Found genpd %s for device %s\n", pd->name, pdev->name);
161
162 return pm_genpd_add_device(pd, &pdev->dev);
163}
164#else
165static inline int board_staging_add_dev_domain(struct platform_device *pdev,
166 const char *domain)
167{
168 return 0;
169}
170#endif
171
138int __init board_staging_register_device(const struct board_staging_dev *dev) 172int __init board_staging_register_device(const struct board_staging_dev *dev)
139{ 173{
140 struct platform_device *pdev = dev->pdev; 174 struct platform_device *pdev = dev->pdev;
@@ -161,7 +195,7 @@ int __init board_staging_register_device(const struct board_staging_dev *dev)
161 } 195 }
162 196
163 if (dev->domain) 197 if (dev->domain)
164 __pm_genpd_name_add_device(dev->domain, &pdev->dev, NULL); 198 board_staging_add_dev_domain(pdev, dev->domain);
165 199
166 return error; 200 return error;
167} 201}