summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2016-03-31 15:48:42 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-04-26 19:12:28 +0200
commitbc19b9a81da009fd1d797d756d41b518ac7e5f14 (patch)
treee68ef8283d64efe4660807475fe251deccaaef75 /drivers/power
parent02da2d72174c61988eb4456b53f405e3ebdebce4 (diff)
downloadlinux-bc19b9a81da009fd1d797d756d41b518ac7e5f14.tar.bz2
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>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/avs/rockchip-io-domain.c10
1 files changed, 9 insertions, 1 deletions
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)
struct device_node *np = pdev->dev.of_node;
const struct of_device_id *match;
struct rockchip_iodomain *iod;
+ struct device *parent;
int i, ret = 0;
if (!np)
@@ -351,7 +352,14 @@ static int rockchip_iodomain_probe(struct platform_device *pdev)
match = of_match_node(rockchip_iodomain_match, np);
iod->soc_data = (struct rockchip_iodomain_soc_data *)match->data;
- iod->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
+ parent = pdev->dev.parent;
+ if (parent && parent->of_node) {
+ iod->grf = syscon_node_to_regmap(parent->of_node);
+ } else {
+ dev_dbg(&pdev->dev, "falling back to old binding\n");
+ iod->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
+ }
+
if (IS_ERR(iod->grf)) {
dev_err(&pdev->dev, "couldn't find grf regmap\n");
return PTR_ERR(iod->grf);