public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/5] ARM: rockchip: move io-domains under GRF
@ 2016-02-05 21:20 Heiko Stuebner
  2016-02-05 21:20 ` [PATCH 1/5] PM / AVS: rockchip-io: make io-domains a child of the GRF Heiko Stuebner
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Heiko Stuebner @ 2016-02-05 21:20 UTC (permalink / raw)
  To: linux-arm-kernel

The GRF contains both individual settings-bits as well as somewhat more
fully blocks like different phy-controls and also the io-voltage selection.
Similar to the power-domains living under the pmu, things like said
io-voltage selection should live under the grf instead of separate
nodes higher up.

This is even more important now that socs like the rk3368 and probably
more future socs seem to contain more than one GRF-area (a second one
under the PMU power-domain) with each containing a part of the voltage
selection. So having that in the correct place also prevents confusion.


Ideally patch1 would go into 4.6 through the power or avs tree and the
devicetree-related things should wait until after the next merge window
due to the updated binding, which I can then simply apply to my dts
branches.


Heiko Stuebner (5):
  PM / AVS: rockchip-io: make io-domains a child of the GRF
  ARM: dts: rockchip: make rk3288-grf a simple-mfd
  ARM: dts: rockchip: move rk3288 io-domain nodes to the grf
  arm64: dts: rockchip: make rk3368 grf syscons simple-mfds as well
  arm64: dts: rockchip: add rk3368 iodomains

 .../bindings/power/rockchip-io-domain.txt          |  4 ++-
 arch/arm/boot/dts/rk3288-firefly.dtsi              | 33 +++++++++++----------
 arch/arm/boot/dts/rk3288-popmetal.dts              | 34 ++++++++++++----------
 arch/arm/boot/dts/rk3288-rock2-som.dtsi            | 34 ++++++++++++----------
 arch/arm/boot/dts/rk3288-veyron.dtsi               | 28 +++++++++---------
 arch/arm/boot/dts/rk3288.dtsi                      |  2 +-
 arch/arm64/boot/dts/rockchip/rk3368-r88.dts        | 22 ++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3368.dtsi           |  4 +--
 drivers/power/avs/rockchip-io-domain.c             | 10 ++++++-
 9 files changed, 105 insertions(+), 66 deletions(-)

-- 
2.6.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/5] PM / AVS: rockchip-io: make io-domains a child of the GRF
  2016-02-05 21:20 [PATCH 0/5] ARM: rockchip: move io-domains under GRF Heiko Stuebner
@ 2016-02-05 21:20 ` Heiko Stuebner
  2016-02-05 22:47   ` Kevin Hilman
  2016-02-05 21:20 ` [PATCH 2/5] ARM: dts: rockchip: make rk3288-grf a simple-mfd Heiko Stuebner
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Heiko Stuebner @ 2016-02-05 21:20 UTC (permalink / raw)
  To: linux-arm-kernel

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>
---
 Documentation/devicetree/bindings/power/rockchip-io-domain.txt |  4 +++-
 drivers/power/avs/rockchip-io-domain.c                         | 10 +++++++++-
 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 b8627e7..7ed5518 100644
--- a/Documentation/devicetree/bindings/power/rockchip-io-domain.txt
+++ b/Documentation/devicetree/bindings/power/rockchip-io-domain.txt
@@ -35,8 +35,10 @@ Required properties:
   - "rockchip,rk3288-io-voltage-domain" for rk3288
   - "rockchip,rk3368-io-voltage-domain" for rk3368
   - "rockchip,rk3368-pmu-io-voltage-domain" for rk3368 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 8099456..a5a07d8 100644
--- a/drivers/power/avs/rockchip-io-domain.c
+++ b/drivers/power/avs/rockchip-io-domain.c
@@ -278,6 +278,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)
@@ -293,7 +294,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);
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/5] ARM: dts: rockchip: make rk3288-grf a simple-mfd
  2016-02-05 21:20 [PATCH 0/5] ARM: rockchip: move io-domains under GRF Heiko Stuebner
  2016-02-05 21:20 ` [PATCH 1/5] PM / AVS: rockchip-io: make io-domains a child of the GRF Heiko Stuebner
@ 2016-02-05 21:20 ` Heiko Stuebner
  2016-02-05 21:20 ` [PATCH 3/5] ARM: dts: rockchip: move rk3288 io-domain nodes to the grf Heiko Stuebner
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Heiko Stuebner @ 2016-02-05 21:20 UTC (permalink / raw)
  To: linux-arm-kernel

Similar to the pmu, the general register files contain a lot of different
setting bits grouped into general registers, but also some somewhat special
entities like the controls for some phy-blocks or the io-voltage control.
To be able to move these blocks under the grf node where they actually
belong, make it a simple-mfd.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 arch/arm/boot/dts/rk3288.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 3d46327..8e49c17 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -748,7 +748,7 @@
 	};
 
 	grf: syscon at ff770000 {
-		compatible = "rockchip,rk3288-grf", "syscon";
+		compatible = "rockchip,rk3288-grf", "syscon", "simple-mfd";
 		reg = <0xff770000 0x1000>;
 	};
 
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/5] ARM: dts: rockchip: move rk3288 io-domain nodes to the grf
  2016-02-05 21:20 [PATCH 0/5] ARM: rockchip: move io-domains under GRF Heiko Stuebner
  2016-02-05 21:20 ` [PATCH 1/5] PM / AVS: rockchip-io: make io-domains a child of the GRF Heiko Stuebner
  2016-02-05 21:20 ` [PATCH 2/5] ARM: dts: rockchip: make rk3288-grf a simple-mfd Heiko Stuebner
@ 2016-02-05 21:20 ` Heiko Stuebner
  2016-02-05 21:20 ` [PATCH 4/5] arm64: dts: rockchip: make rk3368 grf syscons simple-mfds as well Heiko Stuebner
  2016-02-05 21:20 ` [PATCH 5/5] arm64: dts: rockchip: add rk3368 iodomains Heiko Stuebner
  4 siblings, 0 replies; 8+ messages in thread
From: Heiko Stuebner @ 2016-02-05 21:20 UTC (permalink / raw)
  To: linux-arm-kernel

io-voltage control is actually part of the grf, so move the node under the
newly available grf simple-mfd.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 arch/arm/boot/dts/rk3288-firefly.dtsi   | 33 ++++++++++++++++----------------
 arch/arm/boot/dts/rk3288-popmetal.dts   | 34 +++++++++++++++++----------------
 arch/arm/boot/dts/rk3288-rock2-som.dtsi | 34 +++++++++++++++++----------------
 arch/arm/boot/dts/rk3288-veyron.dtsi    | 28 ++++++++++++++-------------
 4 files changed, 68 insertions(+), 61 deletions(-)

diff --git a/arch/arm/boot/dts/rk3288-firefly.dtsi b/arch/arm/boot/dts/rk3288-firefly.dtsi
index 49ec20d..f219389 100644
--- a/arch/arm/boot/dts/rk3288-firefly.dtsi
+++ b/arch/arm/boot/dts/rk3288-firefly.dtsi
@@ -63,22 +63,6 @@
 		clock-output-names = "ext_gmac";
 	};
 
-	io_domains: io-domains {
-		compatible = "rockchip,rk3288-io-voltage-domain";
-		rockchip,grf = <&grf>;
-
-		audio-supply = <&vcca_33>;
-		bb-supply = <&vcc_io>;
-		dvp-supply = <&dovdd_1v8>;
-		flash0-supply = <&vcc_flash>;
-		flash1-supply = <&vcc_lan>;
-		gpio30-supply = <&vcc_io>;
-		gpio1830-supply = <&vcc_io>;
-		lcdc-supply = <&vcc_io>;
-		sdcard-supply = <&vccio_sd>;
-		wifi-supply = <&vccio_wl>;
-	};
-
 	ir: ir-receiver {
 		compatible = "gpio-ir-receiver";
 		pinctrl-names = "default";
@@ -237,6 +221,23 @@
 	status = "ok";
 };
 
+&grf {
+	io_domains: io-domains {
+		compatible = "rockchip,rk3288-io-voltage-domain";
+
+		audio-supply = <&vcca_33>;
+		bb-supply = <&vcc_io>;
+		dvp-supply = <&dovdd_1v8>;
+		flash0-supply = <&vcc_flash>;
+		flash1-supply = <&vcc_lan>;
+		gpio30-supply = <&vcc_io>;
+		gpio1830-supply = <&vcc_io>;
+		lcdc-supply = <&vcc_io>;
+		sdcard-supply = <&vccio_sd>;
+		wifi-supply = <&vccio_wl>;
+	};
+};
+
 &hdmi {
 	ddc-i2c-bus = <&i2c5>;
 	status = "okay";
diff --git a/arch/arm/boot/dts/rk3288-popmetal.dts b/arch/arm/boot/dts/rk3288-popmetal.dts
index 65c4756..4d434f7 100644
--- a/arch/arm/boot/dts/rk3288-popmetal.dts
+++ b/arch/arm/boot/dts/rk3288-popmetal.dts
@@ -79,22 +79,6 @@
 		};
 	};
 
-	io_domains: io-domains {
-		compatible = "rockchip,rk3288-io-voltage-domain";
-		rockchip,grf = <&grf>;
-
-		audio-supply = <&vcca_33>;
-		bb-supply = <&vcc_io>;
-		dvp-supply = <&vcc18_dvp>;
-		flash0-supply = <&vcc_flash>;
-		flash1-supply = <&vcc_lan>;
-		gpio30-supply = <&vcc_io>;
-		gpio1830-supply = <&vcc_io>;
-		lcdc-supply = <&vcc_io>;
-		sdcard-supply = <&vccio_sd>;
-		wifi-supply = <&vccio_wl>;
-	};
-
 	ir: ir-receiver {
 		compatible = "gpio-ir-receiver";
 		gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
@@ -205,6 +189,24 @@
 	status = "ok";
 };
 
+&grf {
+	io_domains: io-domains {
+		compatible = "rockchip,rk3288-io-voltage-domain";
+		rockchip,grf = <&grf>;
+
+		audio-supply = <&vcca_33>;
+		bb-supply = <&vcc_io>;
+		dvp-supply = <&vcc18_dvp>;
+		flash0-supply = <&vcc_flash>;
+		flash1-supply = <&vcc_lan>;
+		gpio30-supply = <&vcc_io>;
+		gpio1830-supply = <&vcc_io>;
+		lcdc-supply = <&vcc_io>;
+		sdcard-supply = <&vccio_sd>;
+		wifi-supply = <&vccio_wl>;
+	};
+};
+
 &hdmi {
 	ddc-i2c-bus = <&i2c5>;
 	status = "okay";
diff --git a/arch/arm/boot/dts/rk3288-rock2-som.dtsi b/arch/arm/boot/dts/rk3288-rock2-som.dtsi
index e1ee9f9..8660b8a 100644
--- a/arch/arm/boot/dts/rk3288-rock2-som.dtsi
+++ b/arch/arm/boot/dts/rk3288-rock2-som.dtsi
@@ -61,22 +61,6 @@
 		clock-output-names = "ext_gmac";
 	};
 
-	io_domains: io-domains {
-		compatible = "rockchip,rk3288-io-voltage-domain";
-		rockchip,grf = <&grf>;
-
-		audio-supply = <&vcc_io>;
-		bb-supply = <&vcc_io>;
-		dvp-supply = <&vcc_18>;
-		flash0-supply = <&vcc_flash>;
-		flash1-supply = <&vccio_pmu>;
-		gpio30-supply = <&vccio_pmu>;
-		gpio1830 = <&vcc_io>;
-		lcdc-supply = <&vcc_io>;
-		sdcard-supply = <&vccio_sd>;
-		wifi-supply = <&vcc_18>;
-	};
-
 	vcc_flash: flash-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc_sys";
@@ -129,6 +113,24 @@
 	tx_delay = <0x30>;
 };
 
+&grf {
+	io_domains: io-domains {
+		compatible = "rockchip,rk3288-io-voltage-domain";
+		rockchip,grf = <&grf>;
+
+		audio-supply = <&vcc_io>;
+		bb-supply = <&vcc_io>;
+		dvp-supply = <&vcc_18>;
+		flash0-supply = <&vcc_flash>;
+		flash1-supply = <&vccio_pmu>;
+		gpio30-supply = <&vccio_pmu>;
+		gpio1830 = <&vcc_io>;
+		lcdc-supply = <&vcc_io>;
+		sdcard-supply = <&vccio_sd>;
+		wifi-supply = <&vcc_18>;
+	};
+};
+
 &i2c0 {
 	status = "okay";
 
diff --git a/arch/arm/boot/dts/rk3288-veyron.dtsi b/arch/arm/boot/dts/rk3288-veyron.dtsi
index 0a43e21..fd55697 100644
--- a/arch/arm/boot/dts/rk3288-veyron.dtsi
+++ b/arch/arm/boot/dts/rk3288-veyron.dtsi
@@ -83,19 +83,6 @@
 		reset-gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>;
 	};
 
-	io_domains: io-domains {
-		compatible = "rockchip,rk3288-io-voltage-domain";
-		rockchip,grf = <&grf>;
-
-		bb-supply = <&vcc33_io>;
-		dvp-supply = <&vcc_18>;
-		flash0-supply = <&vcc18_flashio>;
-		gpio1830-supply = <&vcc33_io>;
-		gpio30-supply = <&vcc33_io>;
-		lcdc-supply = <&vcc33_lcd>;
-		wifi-supply = <&vcc18_wl>;
-	};
-
 	sdio_pwrseq: sdio-pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		clocks = <&rk808 RK808_CLKOUT1>;
@@ -159,6 +146,21 @@
 	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
 };
 
+&grf {
+	io_domains: io-domains {
+		compatible = "rockchip,rk3288-io-voltage-domain";
+		rockchip,grf = <&grf>;
+
+		bb-supply = <&vcc33_io>;
+		dvp-supply = <&vcc_18>;
+		flash0-supply = <&vcc18_flashio>;
+		gpio1830-supply = <&vcc33_io>;
+		gpio30-supply = <&vcc33_io>;
+		lcdc-supply = <&vcc33_lcd>;
+		wifi-supply = <&vcc18_wl>;
+	};
+};
+
 &hdmi {
 	ddc-i2c-bus = <&i2c5>;
 	status = "okay";
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/5] arm64: dts: rockchip: make rk3368 grf syscons simple-mfds as well
  2016-02-05 21:20 [PATCH 0/5] ARM: rockchip: move io-domains under GRF Heiko Stuebner
                   ` (2 preceding siblings ...)
  2016-02-05 21:20 ` [PATCH 3/5] ARM: dts: rockchip: move rk3288 io-domain nodes to the grf Heiko Stuebner
@ 2016-02-05 21:20 ` Heiko Stuebner
  2016-02-05 21:20 ` [PATCH 5/5] arm64: dts: rockchip: add rk3368 iodomains Heiko Stuebner
  4 siblings, 0 replies; 8+ messages in thread
From: Heiko Stuebner @ 2016-02-05 21:20 UTC (permalink / raw)
  To: linux-arm-kernel

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 49d1191..6029310 100644
--- a/arch/arm64/boot/dts/rockchip/rk3368.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
@@ -556,7 +556,7 @@
 	};
 
 	pmugrf: syscon at ff738000 {
-		compatible = "rockchip,rk3368-pmugrf", "syscon";
+		compatible = "rockchip,rk3368-pmugrf", "syscon", "simple-mfd";
 		reg = <0x0 0xff738000 0x0 0x1000>;
 	};
 
@@ -569,7 +569,7 @@
 	};
 
 	grf: syscon at ff770000 {
-		compatible = "rockchip,rk3368-grf", "syscon";
+		compatible = "rockchip,rk3368-grf", "syscon", "simple-mfd";
 		reg = <0x0 0xff770000 0x0 0x1000>;
 	};
 
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/5] arm64: dts: rockchip: add rk3368 iodomains
  2016-02-05 21:20 [PATCH 0/5] ARM: rockchip: move io-domains under GRF Heiko Stuebner
                   ` (3 preceding siblings ...)
  2016-02-05 21:20 ` [PATCH 4/5] arm64: dts: rockchip: make rk3368 grf syscons simple-mfds as well Heiko Stuebner
@ 2016-02-05 21:20 ` Heiko Stuebner
  4 siblings, 0 replies; 8+ messages in thread
From: Heiko Stuebner @ 2016-02-05 21:20 UTC (permalink / raw)
  To: linux-arm-kernel

Add the supply-links according to the R88 schematics.

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

diff --git a/arch/arm64/boot/dts/rockchip/rk3368-r88.dts b/arch/arm64/boot/dts/rockchip/rk3368-r88.dts
index 104cbee..e6e2a1f 100644
--- a/arch/arm64/boot/dts/rockchip/rk3368-r88.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3368-r88.dts
@@ -211,6 +211,18 @@
 	status = "ok";
 };
 
+&grf {
+	io-domains {
+		compatible = "rockchip,rk3368-io-voltage-domain";
+
+		audio-supply = <&vcc_io>;
+		gpio30-supply = <&vcc_io>;
+		gpio1830-supply = <&vcc_io>;
+		sdcard-supply = <&vccio_sd>;
+		wifi-supply = <&vccio_wl>;
+	};
+};
+
 &i2c0 {
 	status = "okay";
 
@@ -331,6 +343,16 @@
 	};
 };
 
+&pmugrf {
+	io-domains {
+		compatible = "rockchip,rk3368-pmu-io-voltage-domain";
+		rockchip,grf = <&pmugrf>;
+
+		pmu-supply = <&vcc_io>;
+		vop-supply = <&vcc_io>;
+	};
+};
+
 &saradc {
 	vref-supply = <&vcc_18>;
 	status = "okay";
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 1/5] PM / AVS: rockchip-io: make io-domains a child of the GRF
  2016-02-05 21:20 ` [PATCH 1/5] PM / AVS: rockchip-io: make io-domains a child of the GRF Heiko Stuebner
@ 2016-02-05 22:47   ` Kevin Hilman
  2016-03-02 21:16     ` Heiko Stübner
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Hilman @ 2016-02-05 22:47 UTC (permalink / raw)
  To: linux-arm-kernel

Heiko Stuebner <heiko@sntech.de> writes:

> 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>

> ---
>  Documentation/devicetree/bindings/power/rockchip-io-domain.txt |  4 +++-
>  drivers/power/avs/rockchip-io-domain.c                         | 10 +++++++++-
>  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 b8627e7..7ed5518 100644
> --- a/Documentation/devicetree/bindings/power/rockchip-io-domain.txt
> +++ b/Documentation/devicetree/bindings/power/rockchip-io-domain.txt
> @@ -35,8 +35,10 @@ Required properties:
>    - "rockchip,rk3288-io-voltage-domain" for rk3288
>    - "rockchip,rk3368-io-voltage-domain" for rk3368
>    - "rockchip,rk3368-pmu-io-voltage-domain" for rk3368 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 8099456..a5a07d8 100644
> --- a/drivers/power/avs/rockchip-io-domain.c
> +++ b/drivers/power/avs/rockchip-io-domain.c
> @@ -278,6 +278,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)
> @@ -293,7 +294,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);

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/5] PM / AVS: rockchip-io: make io-domains a child of the GRF
  2016-02-05 22:47   ` Kevin Hilman
@ 2016-03-02 21:16     ` Heiko Stübner
  0 siblings, 0 replies; 8+ messages in thread
From: Heiko Stübner @ 2016-03-02 21:16 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Rafael,

Am Freitag, 5. Februar 2016, 14:47:08 schrieb Kevin Hilman:
> Heiko Stuebner <heiko@sntech.de> writes:
> > 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>

As before, I guess that means you could apply that patch directly, as nothing 
else is pending from Kevin's side.


Thanks
Heiko

> > ---
> > 
> >  Documentation/devicetree/bindings/power/rockchip-io-domain.txt |  4 +++-
> >  drivers/power/avs/rockchip-io-domain.c                         | 10
> >  +++++++++- 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
> > b8627e7..7ed5518 100644
> > --- a/Documentation/devicetree/bindings/power/rockchip-io-domain.txt
> > +++ b/Documentation/devicetree/bindings/power/rockchip-io-domain.txt
> > 
> > @@ -35,8 +35,10 @@ Required properties:
> >    - "rockchip,rk3288-io-voltage-domain" for rk3288
> >    - "rockchip,rk3368-io-voltage-domain" for rk3368
> >    - "rockchip,rk3368-pmu-io-voltage-domain" for rk3368 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 8099456..a5a07d8 100644
> > --- a/drivers/power/avs/rockchip-io-domain.c
> > +++ b/drivers/power/avs/rockchip-io-domain.c
> > @@ -278,6 +278,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)
> > 
> > @@ -293,7 +294,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);

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-03-02 21:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-05 21:20 [PATCH 0/5] ARM: rockchip: move io-domains under GRF Heiko Stuebner
2016-02-05 21:20 ` [PATCH 1/5] PM / AVS: rockchip-io: make io-domains a child of the GRF Heiko Stuebner
2016-02-05 22:47   ` Kevin Hilman
2016-03-02 21:16     ` Heiko Stübner
2016-02-05 21:20 ` [PATCH 2/5] ARM: dts: rockchip: make rk3288-grf a simple-mfd Heiko Stuebner
2016-02-05 21:20 ` [PATCH 3/5] ARM: dts: rockchip: move rk3288 io-domain nodes to the grf Heiko Stuebner
2016-02-05 21:20 ` [PATCH 4/5] arm64: dts: rockchip: make rk3368 grf syscons simple-mfds as well Heiko Stuebner
2016-02-05 21:20 ` [PATCH 5/5] arm64: dts: rockchip: add rk3368 iodomains Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox