diff mbox

PM / AVS: rockchip-io: add GRF and PMUGRF types to distinguish

Message ID 5354361.hQXgJ7cEGx@diego (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Heiko Stuebner Feb. 1, 2016, 9:17 p.m. UTC
Hi David,

Am Montag, 1. Februar 2016, 16:54:38 schrieb David.Wu:
> ? 2016/1/30 20:39, Heiko Stuebner ??:
> > Am Samstag, 30. Januar 2016, 20:01:45 schrieb David Wu:
> >> As rk3368 contained two separated iodomain areas, this was
> >> determined to use which regmap base address.
> >> 
> >> Signed-off-by: David Wu <david.wu@rock-chips.com>
> > 
> > I don't think we need to specify this on a driver level. Both GRF areas
> > are
> > "General register files" only located in two separate power-domains.
> > So the rockchip,grf property should work for both. Especially as nothing
> > keeps designers from introducing yet another GRF-area somewhere else ;-)
> > 
> > >From when I started working on the rk3368, I still have a preliminary
> > 
> > patches for that sitting here, so I've attached on how I envisoned that to
> > work.
> 
> Okay, i agree to you, but it make someone a little confused just from
> the drive code,
> not DT file,  about  pmugrf regmap base address.:-)
> 
> How do you feel about intergating GRF and PMU drivers in one driver?
> Thanks!

I will very strongly disagree here ;-) .
Similar to the power-domains being part of the pmu, the io-domains are
part of their individual GRFs. So if you want it really clean and tidy the way 
to go foward will be the attached patches. Compile-tested only.

Other things like the usbphy control should move there as well in the long 
run. But that's not immediate necessary.


Heiko

Comments

David Wu Feb. 2, 2016, 9:38 a.m. UTC | #1
Hi Heiko,

? 2016/2/2 5:17, Heiko Stübner ??:
> Hi David,
>
> Am Montag, 1. Februar 2016, 16:54:38 schrieb David.Wu:
>> ? 2016/1/30 20:39, Heiko Stuebner ??:
>>> Am Samstag, 30. Januar 2016, 20:01:45 schrieb David Wu:
>>>> As rk3368 contained two separated iodomain areas, this was
>>>> determined to use which regmap base address.
>>>>
>>>> Signed-off-by: David Wu <david.wu@rock-chips.com>
>>> I don't think we need to specify this on a driver level. Both GRF areas
>>> are
>>> "General register files" only located in two separate power-domains.
>>> So the rockchip,grf property should work for both. Especially as nothing
>>> keeps designers from introducing yet another GRF-area somewhere else ;-)
>>>
>>> >From when I started working on the rk3368, I still have a preliminary
>>>
>>> patches for that sitting here, so I've attached on how I envisoned that to
>>> work.
>> Okay, i agree to you, but it make someone a little confused just from
>> the drive code,
>> not DT file,  about  pmugrf regmap base address.:-)
>>
>> How do you feel about intergating GRF and PMU drivers in one driver?
>> Thanks!
> I will very strongly disagree here ;-) .
> Similar to the power-domains being part of the pmu, the io-domains are
> part of their individual GRFs. So if you want it really clean and tidy the way
> to go foward will be the attached patches. Compile-tested only.

Thanks for your reply, the patchs look better than mine.
I have tested them on sdk board and i found something may be wrong.
"parent->of_node" instead of "parent", as the parent is not null if 
parent-node not used.
         if (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");
         }

> Other things like the usbphy control should move there as well in the long
> run. But that's not immediate necessary.
>
>
> Heiko


--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

From 116217957ec3910b9dc05420441848f3343e450e Mon Sep 17 00:00:00 2001
From: Heiko Stuebner <heiko@sntech.de>
Date: Mon, 1 Feb 2016 22:09:03 +0100
Subject: [PATCH 2/3] arm64: dts: rockchip: make grf syscons simple-mfds

The general register files do contain a lot of separate functions and
while some really are only registers with a lot of different 1-bit
settings, there are also a lot of them containing some bigger function
blocks. To be able to define these as sub-devices, make them simple-mfds.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3368.dtsi b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
index 122777b..4fc28e9 100644
--- a/arch/arm64/boot/dts/rockchip/rk3368.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
@@ -554,7 +554,7 @@ 
 	};
 
 	pmugrf: syscon@ff738000 {
-		compatible = "rockchip,rk3368-pmugrf", "syscon";
+		compatible = "rockchip,rk3368-pmugrf", "syscon", "simple-mfd";
 		reg = <0x0 0xff738000 0x0 0x1000>;
 	};
 
@@ -567,7 +567,7 @@ 
 	};
 
 	grf: syscon@ff770000 {
-		compatible = "rockchip,rk3368-grf", "syscon";
+		compatible = "rockchip,rk3368-grf", "syscon", "simple-mfd";
 		reg = <0x0 0xff770000 0x0 0x1000>;
 	};
 
-- 
2.6.4