aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2016-03-31 09:48:42 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-04-26 13:12:28 -0400
commitbc19b9a81da009fd1d797d756d41b518ac7e5f14 (patch)
treee68ef8283d64efe4660807475fe251deccaaef75
parent02da2d72174c61988eb4456b53f405e3ebdebce4 (diff)
PM / AVS: rockchip-io: make io-domains a child of the GRF
IO-domain handling is part of the general register files, so should live under the grf directly. This change allows the grf to be a simple-mfd and the io-domains fetching the syscon regmap from that parent-node. The old binding is of course preserved, though deprecated. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Kevin Hilman <khilman@baylibre.com> Tested-by: David Wu <david.wu@rock-chips.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--Documentation/devicetree/bindings/power/rockchip-io-domain.txt4
-rw-r--r--drivers/power/avs/rockchip-io-domain.c10
2 files changed, 12 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/power/rockchip-io-domain.txt b/Documentation/devicetree/bindings/power/rockchip-io-domain.txt
index c84fb47265eb..d23dc002a87e 100644
--- a/Documentation/devicetree/bindings/power/rockchip-io-domain.txt
+++ b/Documentation/devicetree/bindings/power/rockchip-io-domain.txt
@@ -37,8 +37,10 @@ Required properties:
37 - "rockchip,rk3368-pmu-io-voltage-domain" for rk3368 pmu-domains 37 - "rockchip,rk3368-pmu-io-voltage-domain" for rk3368 pmu-domains
38 - "rockchip,rk3399-io-voltage-domain" for rk3399 38 - "rockchip,rk3399-io-voltage-domain" for rk3399
39 - "rockchip,rk3399-pmu-io-voltage-domain" for rk3399 pmu-domains 39 - "rockchip,rk3399-pmu-io-voltage-domain" for rk3399 pmu-domains
40- rockchip,grf: phandle to the syscon managing the "general register files"
41 40
41Deprecated properties:
42- rockchip,grf: phandle to the syscon managing the "general register files"
43 Systems should move the io-domains to a sub-node of the grf simple-mfd.
42 44
43You specify supplies using the standard regulator bindings by including 45You specify supplies using the standard regulator bindings by including
44a phandle the relevant regulator. All specified supplies must be able 46a phandle the relevant regulator. All specified supplies must be able
diff --git a/drivers/power/avs/rockchip-io-domain.c b/drivers/power/avs/rockchip-io-domain.c
index 8986382718dd..01b6d3f9b8fb 100644
--- a/drivers/power/avs/rockchip-io-domain.c
+++ b/drivers/power/avs/rockchip-io-domain.c
@@ -336,6 +336,7 @@ static int rockchip_iodomain_probe(struct platform_device *pdev)
336 struct device_node *np = pdev->dev.of_node; 336 struct device_node *np = pdev->dev.of_node;
337 const struct of_device_id *match; 337 const struct of_device_id *match;
338 struct rockchip_iodomain *iod; 338 struct rockchip_iodomain *iod;
339 struct device *parent;
339 int i, ret = 0; 340 int i, ret = 0;
340 341
341 if (!np) 342 if (!np)
@@ -351,7 +352,14 @@ static int rockchip_iodomain_probe(struct platform_device *pdev)
351 match = of_match_node(rockchip_iodomain_match, np); 352 match = of_match_node(rockchip_iodomain_match, np);
352 iod->soc_data = (struct rockchip_iodomain_soc_data *)match->data; 353 iod->soc_data = (struct rockchip_iodomain_soc_data *)match->data;
353 354
354 iod->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf"); 355 parent = pdev->dev.parent;
356 if (parent && parent->of_node) {
357 iod->grf = syscon_node_to_regmap(parent->of_node);
358 } else {
359 dev_dbg(&pdev->dev, "falling back to old binding\n");
360 iod->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
361 }
362
355 if (IS_ERR(iod->grf)) { 363 if (IS_ERR(iod->grf)) {
356 dev_err(&pdev->dev, "couldn't find grf regmap\n"); 364 dev_err(&pdev->dev, "couldn't find grf regmap\n");
357 return PTR_ERR(iod->grf); 365 return PTR_ERR(iod->grf);