diff mbox

[v2,4/4] ARM: dts: r8a7790: lager: use demuxer for IIC3/I2C3

Message ID 1465370066-8450-5-git-send-email-horms+renesas@verge.net.au (mailing list archive)
State New, archived
Headers show

Commit Message

Simon Horman June 8, 2016, 7:14 a.m. UTC
Create a separate bus for dla98063 PMIC and da9210 regulator
related I2C slaves.

Based on similar work for HDMI by Wolfram Sang.

Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/r8a7790-lager.dts | 80 +++++++++++++++++++++++--------------
 1 file changed, 49 insertions(+), 31 deletions(-)

Comments

Wolfram Sang June 8, 2016, 8:05 a.m. UTC | #1
On Wed, Jun 08, 2016 at 04:14:26PM +0900, Simon Horman wrote:
> Create a separate bus for dla98063 PMIC and da9210 regulator
> related I2C slaves.
> 
> Based on similar work for HDMI by Wolfram Sang.
> 
> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

Maybe add a word that PFC doesn't allow I2C0/I2C3 to be muxed as GPIO?
Simon Horman June 9, 2016, 12:55 a.m. UTC | #2
On Wed, Jun 08, 2016 at 10:05:16AM +0200, Wolfram Sang wrote:
> On Wed, Jun 08, 2016 at 04:14:26PM +0900, Simon Horman wrote:
> > Create a separate bus for dla98063 PMIC and da9210 regulator
> > related I2C slaves.
> > 
> > Based on similar work for HDMI by Wolfram Sang.
> > 
> > Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> 
> Maybe add a word that PFC doesn't allow I2C0/I2C3 to be muxed as GPIO?

Sure, will do.
Wolfram Sang June 13, 2016, 2:35 p.m. UTC | #3
>  		i2c9 = "i2cexio1";
>  		i2c10 = "i2chdmi";
>  		i2c11 = "gpioi2c";
> +		i2c12 = "i2cpwr";

To make it easier for users, we should maybe group them?

i2c8+9: additional gpio busses
i2c10-13: i2cexioX

?
Simon Horman June 15, 2016, 4:29 a.m. UTC | #4
On Mon, Jun 13, 2016 at 04:35:21PM +0200, Wolfram Sang wrote:
> 
> >  		i2c9 = "i2cexio1";
> >  		i2c10 = "i2chdmi";
> >  		i2c11 = "gpioi2c";
> > +		i2c12 = "i2cpwr";
> 
> To make it easier for users, we should maybe group them?
> 
> i2c8+9: additional gpio busses
> i2c10-13: i2cexioX

Should we also group gpioi2cX?
Wolfram Sang June 15, 2016, 6:24 a.m. UTC | #5
On Wed, Jun 15, 2016 at 01:29:43PM +0900, Simon Horman wrote:
> On Mon, Jun 13, 2016 at 04:35:21PM +0200, Wolfram Sang wrote:
> > 
> > >  		i2c9 = "i2cexio1";
> > >  		i2c10 = "i2chdmi";
> > >  		i2c11 = "gpioi2c";
> > > +		i2c12 = "i2cpwr";
> > 
> > To make it easier for users, we should maybe group them?
> > 
> > i2c8+9: additional gpio busses
> > i2c10-13: i2cexioX
> 
> Should we also group gpioi2cX?

That's what I meant with "additional gpio busses" :) I assume we only
need 2 on lager.
diff mbox

Patch

diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
index 80b0eaa93607..b75501e4c56d 100644
--- a/arch/arm/boot/dts/r8a7790-lager.dts
+++ b/arch/arm/boot/dts/r8a7790-lager.dts
@@ -54,6 +54,7 @@ 
 		i2c9 = "i2cexio1";
 		i2c10 = "i2chdmi";
 		i2c11 = "gpioi2c";
+		i2c12 = "i2cpwr";
 	};
 
 	chosen {
@@ -355,6 +356,42 @@ 
 			>;
 		i2c-gpio,delay-us = <5>;
 	};
+
+	i2cpwr: i2c-12 {
+		compatible = "i2c-demux-pinctrl";
+		i2c-parent = <&iic3>, <&i2c3>;
+		i2c-bus-name = "i2c-pwr";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		pmic@58 {
+			compatible = "dlg,da9063";
+			reg = <0x58>;
+			interrupt-parent = <&irqc0>;
+			interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
+			interrupt-controller;
+
+			rtc {
+				compatible = "dlg,da9063-rtc";
+			};
+
+			wdt {
+				compatible = "dlg,da9063-watchdog";
+			};
+		};
+
+		vdd_dvfs: regulator@68 {
+			compatible = "dlg,da9210";
+			reg = <0x68>;
+			interrupt-parent = <&irqc0>;
+			interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
+
+			regulator-min-microvolt = <1000000>;
+			regulator-max-microvolt = <1000000>;
+			regulator-boot-on;
+			regulator-always-on;
+		};
+	};
 };
 
 &du {
@@ -497,6 +534,11 @@ 
 		function = "iic2";
 	};
 
+	i2c3_pins: i2c3 {
+		groups = "i2c3";
+		function = "i2c3";
+	};
+
 	iic3_pins: iic3 {
 		groups = "iic3";
 		function = "iic3";
@@ -707,38 +749,14 @@ 
 	clock-frequency = <100000>;
 };
 
-&iic3 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&iic3_pins>;
-	status = "okay";
-
-	pmic@58 {
-		compatible = "dlg,da9063";
-		reg = <0x58>;
-		interrupt-parent = <&irqc0>;
-		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
-		interrupt-controller;
-
-		rtc {
-			compatible = "dlg,da9063-rtc";
-		};
-
-		wdt {
-			compatible = "dlg,da9063-watchdog";
-		};
-	};
-
-	vdd_dvfs: regulator@68 {
-		compatible = "dlg,da9210";
-		reg = <0x68>;
-		interrupt-parent = <&irqc0>;
-		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
+&i2c3	{
+	pinctrl-0 = <&i2c3_pins>;
+	pinctrl-names = "i2c-pwr";
+};
 
-		regulator-min-microvolt = <1000000>;
-		regulator-max-microvolt = <1000000>;
-		regulator-boot-on;
-		regulator-always-on;
-	};
+&iic3	{
+	pinctrl-0 = <&iic3_pins>;
+	pinctrl-names = "i2c-pwr";
 };
 
 &pci0 {