diff mbox

[v2,1/5] PM / AVS: rockchip-io: make io-domains a child of the GRF

Message ID 1459432126-6395-2-git-send-email-heiko@sntech.de (mailing list archive)
State New, archived
Headers show

Commit Message

Heiko Stuebner March 31, 2016, 1:48 p.m. UTC
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>
---
 Documentation/devicetree/bindings/power/rockchip-io-domain.txt |  4 +++-
 drivers/power/avs/rockchip-io-domain.c                         | 10 +++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

Comments

Heiko Stuebner April 12, 2016, 2:23 a.m. UTC | #1
Hi Rafael,

Am Donnerstag, 31. März 2016, 15:48:42 schrieb Heiko Stuebner:
> 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>

could you look into picking up this patch 1/5 please?

The others are to much interwined into other devicetree changes, so I'll 
apply them for 4.8, but it would be nice if you could pick up this one for 
4.7 so the code change becomes available at 4.8-rc1


Thanks
Heiko
Rafael J. Wysocki April 13, 2016, 4:55 a.m. UTC | #2
On Tue, Apr 12, 2016 at 4:23 AM, Heiko Stuebner <heiko@sntech.de> wrote:
> Hi Rafael,
>
> Am Donnerstag, 31. März 2016, 15:48:42 schrieb Heiko Stuebner:
>> 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>
>
> could you look into picking up this patch 1/5 please?
>
> The others are to much interwined into other devicetree changes, so I'll
> apply them for 4.8, but it would be nice if you could pick up this one for
> 4.7 so the code change becomes available at 4.8-rc1

OK, I'll pick it up, but I'm traveling this week, so that'll take a
few days more.

Thanks,
Rafael
Heiko Stuebner April 26, 2016, 4:25 p.m. UTC | #3
Hi Rafael,

Am Mittwoch, 13. April 2016, 06:55:03 schrieb Rafael J. Wysocki:
> On Tue, Apr 12, 2016 at 4:23 AM, Heiko Stuebner <heiko@sntech.de> wrote:
> > Am Donnerstag, 31. März 2016, 15:48:42 schrieb Heiko Stuebner:
> >> 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>
> > 
> > could you look into picking up this patch 1/5 please?
> > 
> > The others are to much interwined into other devicetree changes, so I'll
> > apply them for 4.8, but it would be nice if you could pick up this one for
> > 4.7 so the code change becomes available at 4.8-rc1
> 
> OK, I'll pick it up, but I'm traveling this week, so that'll take a
> few days more.

I just checked kernel/git/rafael/linux-pm.git and didn't find this patch there, 
so I guess it might be time for a ping ;-) .


Thanks
Heiko
Rafael J. Wysocki April 26, 2016, 5:13 p.m. UTC | #4
On Tue, Apr 26, 2016 at 6:25 PM, Heiko Stübner <heiko@sntech.de> wrote:
> Hi Rafael,
>
> Am Mittwoch, 13. April 2016, 06:55:03 schrieb Rafael J. Wysocki:
>> On Tue, Apr 12, 2016 at 4:23 AM, Heiko Stuebner <heiko@sntech.de> wrote:
>> > Am Donnerstag, 31. März 2016, 15:48:42 schrieb Heiko Stuebner:
>> >> 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>
>> >
>> > could you look into picking up this patch 1/5 please?
>> >
>> > The others are to much interwined into other devicetree changes, so I'll
>> > apply them for 4.8, but it would be nice if you could pick up this one for
>> > 4.7 so the code change becomes available at 4.8-rc1
>>
>> OK, I'll pick it up, but I'm traveling this week, so that'll take a
>> few days more.
>
> I just checked kernel/git/rafael/linux-pm.git and didn't find this patch there,
> so I guess it might be time for a ping ;-) .

My bad, sorry.

Queued up for 4.7 now, will show up in linux-next in the next few days.
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/power/rockchip-io-domain.txt b/Documentation/devicetree/bindings/power/rockchip-io-domain.txt
index c84fb47..d23dc00 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:
   - "rockchip,rk3368-pmu-io-voltage-domain" for rk3368 pmu-domains
   - "rockchip,rk3399-io-voltage-domain" for rk3399
   - "rockchip,rk3399-pmu-io-voltage-domain" for rk3399 pmu-domains
-- rockchip,grf: phandle to the syscon managing the "general register files"
 
+Deprecated properties:
+- rockchip,grf: phandle to the syscon managing the "general register files"
+    Systems should move the io-domains to a sub-node of the grf simple-mfd.
 
 You specify supplies using the standard regulator bindings by including
 a 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 8986382..01b6d3f 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);