ARM: dts: r8a779x: use demuxer for I2C
v3 cover ARM: dts: r8a779x: use demuxer for I2C
Hi,
the intention of this series is to extend use of the demuxer for I2C on the lager, koelsch, porter, koelsch, alt and silk boards cover all I2C IP blocks that are either already used or exposed via an EXIO connector.
* This is based on work by Wolfram Sang.
* Testing:
- Underlying driver problems are discussed in the thread
"[PATCH v2 0/4] ARM: dts: r8a7790: lager: use demuxer for I2C"
- I have only compile tested the silk and porters patches as I do
not have access to those boards
- For all other boards I have boot tested the code and the
the default settings seem to work.
* This series is based on renesas-next-20160621-v4.7-rc1
* To aid review it is provided in git at:
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git topic/i2c-demu x-v3
* I also intend to add demux for I2C for r8a7792/blanche
Changes between v2 and v3
* Group extra GPIO buses
* Add GPIO fallback for IIC1/I2C1 on Lager
* Add patches for koelsch, porter, alt and silk
Changes between v1 and v2
* Provide GPIO fallback for I2C2,
this does not seem appropriate for other I2C blocks on the lager board
Simon Horman (13):
ARM: dts: lager: rename and reindex i2cexio
ARM: dts: lager: use demuxer for IIC1/I2C1
ARM: dts: lager: use demuxer for IIC2/I2C2
ARM: dts: lager: use demuxer for IIC3/I2C3
ARM: dts: koelsch: use demuxer for I2C1
ARM: dts: koelsch: use demuxer for I2C2
ARM: dts: koelsch: use demuxer for I2C4
ARM: dts: porter: use demuxer for I2C2
ARM: dts: porter: use demuxer for I2C2
ARM: dts: koelsch: use demuxer for I2C4
ARM: dts: alt: use demuxer for I2C1
ARM: dts: alt: use demuxer for I2C4
ARM: dts: silk: use demuxer for I2C1
arch/arm/boot/dts/r8a7790-lager.dts | 275 +++++++++++++++++++++++----------- arch/arm/boot/dts/r8a7791-koelsch.dts | 209 +++++++++++++++++++------- arch/arm/boot/dts/r8a7791-porter.dts | 129 +++++++++------- arch/arm/boot/dts/r8a7793-gose.dts | 147 ++++++++++++------ arch/arm/boot/dts/r8a7794-alt.dts | 87 +++++++++-- arch/arm/boot/dts/r8a7794-silk.dts | 117 +++++++++------ 6 files changed, 658 insertions(+), 306 deletions(-)
Signature · 1 line
2.1.4
PATCH v3 1/13 ARM: dts: lager: rename and reindex i2cexio
The rename from i2cexio to i2cexio0 is in in preparation for adding i2cexio1 which will use the dmuxer for IIC1/I2C1.
The reindexing from i2c8 to i2c10 is to allow space for grouping of additional GPIO buses to added by follow-up patches to support demuxing of other i2c buses.
Also note that fallback to GPIO is not provided by the hardware for IIC1/I2C1.
---
v2:
* Reindex i2c
* Add note that GPIO fallback is not provided by hardware
--- arch/arm/boot/dts/r8a7790-lager.dts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
arch/arm/boot/dts/r8a7790-lager.dts +7 -5
@@ -50,7 +50,7 @@ aliases { serial0 = &scif0; serial1 = &scifa1; - i2c8 = "i2cexio"; + i2c10 = "i2cexio0"; }; chosen {
@@ -262,11 +262,13 @@ * bus with IIC3 on pins 110 (SCL) + 112 (SDA), select I2C0 at runtime, and * instantiate the slave device at runtime according to the documentation. * You can then communicate with the slave via IIC3. + * + * IIC0/I2C0 does not appear to support fallback to GPIO. */ - i2cexio: i2c-8 { + i2cexio0: i2c-10 { compatible = "i2c-demux-pinctrl"; i2c-parent = <&iic0>, <&i2c0>; - i2c-bus-name = "i2c-exio"; + i2c-bus-name = "i2c-exio0"; #address-cells = <1>; #size-cells = <0>; };
@@ -580,12 +582,12 @@ &i2c0 { pinctrl-0 = <&i2c0_pins>; - pinctrl-names = "i2c-exio"; + pinctrl-names = "i2c-exio0"; }; &iic0 { pinctrl-0 = <&iic0_pins>; - pinctrl-names = "i2c-exio"; + pinctrl-names = "i2c-exio0"; }; &iic1 {
Signature · 1 line
2.1.4
PATCH v3 1/13 ARM: dts: lager: rename and reindex i2cexio
Hi Simon,
arch/arm/boot/dts/r8a7790-lager.dts line 53
Quoted 4 lines
arch/arm/boot/dts/r8a7790-lager.dts +1
-1serial0 = &scif0; serial1 = &scifa1; - i2c8 = "i2cexio"; + i2c10 = "i2cexio0";
Those should be pointers, i.e. "&i2cexio0;", here and in the rest of your series. Sorry for the broken template! Did you have a chance to test my fix for the demuxer?
Regards,
Wolfram
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160830/6e38476e/attachment.sig>
PATCH v3 1/13 ARM: dts: lager: rename and reindex i2cexio
Quoted 9 lines · Wolfram Sang
Hi Simon,
arch/arm/boot/dts/r8a7790-lager.dts line 53
Quoted 4 lines
arch/arm/boot/dts/r8a7790-lager.dts +1
-1serial0 = &scif0; serial1 = &scifa1; - i2c8 = "i2cexio"; + i2c10 = "i2cexio0";Those should be pointers, i.e. "&i2cexio0;", here and in the rest of your series. Sorry for the broken template!
Thanks, got it.
Quoted 2 lines
Did you have a chance to
test my fix for the demuxer?
Sorry, not yet.
PATCH v3 2/13 ARM: dts: lager: use demuxer for IIC1/I2C1
In reply to Simon HormanMake it possible to select which I2C1 IP core you want to run on the EXIO-A connector.
This is based on reference work for the I2C0 core of the lager board by Wolfram Sang.
---
v3
* Add GPIO fallback
* Re-order buses to facilitate grouping of additional GPIO buses
v2
* No change
--- arch/arm/boot/dts/r8a7790-lager.dts | 39 +++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-)
arch/arm/boot/dts/r8a7790-lager.dts +37 -2
@@ -50,7 +50,9 @@ aliases { serial0 = &scif0; serial1 = &scifa1; + i2c8 = "gpioi2c1"; i2c10 = "i2cexio0"; + i2c11 = "i2cexio1"; }; chosen {
@@ -254,6 +256,17 @@ clock-frequency = <148500000>; }; + gpioi2c1: i2c-8 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "i2c-gpio"; + status = "disabled"; + gpios = <&gpio1 17 GPIO_ACTIVE_HIGH /* sda */ + &gpio1 16 GPIO_ACTIVE_HIGH /* scl */ + >; + i2c-gpio,delay-us = <5>; + }; + /* * IIC0/I2C0 is routed to EXIO connector A, pins 114 (SCL) + 116 (SDA) only. * We use the I2C demuxer, so the desired IP core can be selected at runtime
@@ -272,6 +285,19 @@ #address-cells = <1>; #size-cells = <0>; }; + + /* + * IIC1/I2C1 is routed to EXIO connector A, pins 78 (SCL) + 80 (SDA). + * This is similar to the arangement described for i2cexio0 (above) + * with a fallback to GPIO also provided. + */ + i2cexio1: i2c-11 { + compatible = "i2c-demux-pinctrl"; + i2c-parent = <&iic1>, <&i2c1>, <&gpioi2c1>; + i2c-bus-name = "i2c-exio1"; + #address-cells = <1>; + #size-cells = <0>; + }; }; &du {
@@ -394,6 +420,11 @@ function = "iic0"; }; + i2c1_pins: i2c1 { + groups = "i2c1"; + function = "i2c1"; + }; + iic1_pins: iic1 { groups = "iic1"; function = "iic1";
@@ -590,10 +621,14 @@ pinctrl-names = "i2c-exio0"; }; +&i2c1 { + pinctrl-0 = <&i2c1_pins>; + pinctrl-names = "i2c-exio1"; +}; + &iic1 { - status = "okay"; pinctrl-0 = <&iic1_pins>; - pinctrl-names = "default"; + pinctrl-names = "i2c-exio1"; }; &iic2 {
Signature · 1 line
2.1.4
PATCH v3 3/13 ARM: dts: lager: use demuxer for IIC2/I2C2
In reply to Simon HormanCreate a separate bus for HDMI related I2C slaves.
Based on work by Wolfram Sang.
---
v3
* Name GPIO i2c node gpioi2c2 instead of gpioi2c2 as there is now another gpioi2c node
* Add a small comment documenting that IIC2/I2C2 may be switched and that a GPIO fallback is provided.
* Group additional GPIO buses
v2
* No change
--- arch/arm/boot/dts/r8a7790-lager.dts | 142 ++++++++++++++++++++++-------------- 1 file changed, 89 insertions(+), 53 deletions(-)
arch/arm/boot/dts/r8a7790-lager.dts +89 -53
@@ -51,8 +51,10 @@ serial0 = &scif0; serial1 = &scifa1; i2c8 = "gpioi2c1"; + i2c9 = "gpioi2c2"; i2c10 = "i2cexio0"; i2c11 = "i2cexio1"; + i2c12 = "i2chdmi"; }; chosen {
@@ -267,6 +269,17 @@ i2c-gpio,delay-us = <5>; }; + gpioi2c2: i2c-9 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "i2c-gpio"; + status = "disabled"; + gpios = <&gpio5 6 GPIO_ACTIVE_HIGH /* sda */ + &gpio5 5 GPIO_ACTIVE_HIGH /* scl */ + >; + i2c-gpio,delay-us = <5>; + }; + /* * IIC0/I2C0 is routed to EXIO connector A, pins 114 (SCL) + 116 (SDA) only. * We use the I2C demuxer, so the desired IP core can be selected at runtime
@@ -298,6 +311,69 @@ #address-cells = <1>; #size-cells = <0>; }; + + /* + * IIC2 and I2C2 may be switched using pinmux. + * A fallback to GPIO also provided. + */ + i2chdmi: i2c-12 { + compatible = "i2c-demux-pinctrl"; + i2c-parent = <&iic2>, <&i2c2>, <&gpioi2c2>; + i2c-bus-name = "i2c-hdmi"; + #address-cells = <1>; + #size-cells = <0>; + + ak4643: codec at 12 { + compatible = "asahi-kasei,ak4643"; + #sound-dai-cells = <0>; + reg = <0x12>; + }; + + composite-in at 20 { + compatible = "adi,adv7180"; + reg = <0x20>; + remote = <&vin1>; + + port { + adv7180: endpoint { + bus-width = <8>; + remote-endpoint = <&vin1ep0>; + }; + }; + }; + + hdmi at 39 { + compatible = "adi,adv7511w"; + reg = <0x39>; + interrupt-parent = <&gpio1>; + interrupts = <15 IRQ_TYPE_LEVEL_LOW>; + + adi,input-depth = <8>; + adi,input-colorspace = "rgb"; + adi,input-clock = "1x"; + adi,input-style = <1>; + adi,input-justification = "evenly"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port at 0 { + reg = <0>; + adv7511_in: endpoint { + remote-endpoint = <&du_out_lvds0>; + }; + }; + + port at 1 { + reg = <1>; + adv7511_out: endpoint { + remote-endpoint = <&hdmi_con>; + }; + }; + }; + }; + }; }; &du {
@@ -430,6 +506,11 @@ function = "iic1"; }; + i2c2_pins: i2c2 { + groups = "i2c2"; + function = "i2c2"; + }; + iic2_pins: iic2 { groups = "iic2"; function = "iic2";
@@ -631,63 +712,18 @@ pinctrl-names = "i2c-exio1"; }; -&iic2 { - status = "okay"; - pinctrl-0 = <&iic2_pins>; - pinctrl-names = "default"; +&i2c2 { + pinctrl-0 = <&i2c2_pins>; + pinctrl-names = "i2c-hdmi"; clock-frequency = <100000>; +}; - ak4643: codec at 12 { - compatible = "asahi-kasei,ak4643"; - #sound-dai-cells = <0>; - reg = <0x12>; - }; - - composite-in at 20 { - compatible = "adi,adv7180"; - reg = <0x20>; - remote = <&vin1>; - - port { - adv7180: endpoint { - bus-width = <8>; - remote-endpoint = <&vin1ep0>; - }; - }; - }; - - hdmi at 39 { - compatible = "adi,adv7511w"; - reg = <0x39>; - interrupt-parent = <&gpio1>; - interrupts = <15 IRQ_TYPE_LEVEL_LOW>; - - adi,input-depth = <8>; - adi,input-colorspace = "rgb"; - adi,input-clock = "1x"; - adi,input-style = <1>; - adi,input-justification = "evenly"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port at 0 { - reg = <0>; - adv7511_in: endpoint { - remote-endpoint = <&du_out_lvds0>; - }; - }; +&iic2 { + pinctrl-0 = <&iic2_pins>; + pinctrl-names = "i2c-hdmi"; - port at 1 { - reg = <1>; - adv7511_out: endpoint { - remote-endpoint = <&hdmi_con>; - }; - }; - }; - }; + clock-frequency = <100000>; }; &iic3 {
Signature · 1 line
2.1.4
PATCH v3 4/13 ARM: dts: lager: use demuxer for IIC3/I2C3
In reply to Simon HormanCreate a separate bus for dla98063 PMIC and da9210 regulator related I2C slaves.
Based on similar work for HDMI by Wolfram Sang.
---
v3
* Add a small commend documenting that IIC3/I2C3 may be switched and that a GPIO fallback not provided.
v2
* No change
--- arch/arm/boot/dts/r8a7790-lager.dts | 84 +++++++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 31 deletions(-)
arch/arm/boot/dts/r8a7790-lager.dts +53 -31
@@ -55,6 +55,7 @@ i2c10 = "i2cexio0"; i2c11 = "i2cexio1"; i2c12 = "i2chdmi"; + i2c13 = "i2cpwr"; }; chosen {
@@ -374,6 +375,46 @@ }; }; }; + + /* + * IIC3 and I2C3 may be switched using pinmux. + * IIC3/I2C3 does not appear to support fallback to GPIO. + */ + i2cpwr: i2c-13 { + compatible = "i2c-demux-pinctrl"; + i2c-parent = <&iic3>, <&i2c3>; + i2c-bus-name = "i2c-pwr"; + #address-cells = <1>; + #size-cells = <0>; + + pmic at 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 at 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 {
@@ -516,6 +557,11 @@ function = "iic2"; }; + i2c3_pins: i2c3 { + groups = "i2c3"; + function = "i2c3"; + }; + iic3_pins: iic3 { groups = "iic3"; function = "iic3";
@@ -726,38 +772,14 @@ clock-frequency = <100000>; }; -&iic3 { - pinctrl-names = "default"; - pinctrl-0 = <&iic3_pins>; - status = "okay"; - - pmic at 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 at 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 {
Signature · 1 line
2.1.4
PATCH v3 4/13 ARM: dts: lager: use demuxer for IIC3/I2C3
Quoted 1 line · Simon Horman
Create a separate bus for dla98063 PMIC and da9210 regulator
da9063.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
PATCH v3 5/13 ARM: dts: koelsch: use demuxer for I2C1
In reply to Simon HormanMake it possible to fallback to GPIO for I2C1 on the EXIO-C connector.
This is based on reference work for the I2C0 core of the lager/r8a7790 by Wolfram Sang.
---
v3
* New Patch
--- arch/arm/boot/dts/r8a7791-koelsch.dts | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
arch/arm/boot/dts/r8a7791-koelsch.dts +35 -0
@@ -50,6 +50,8 @@ aliases { serial0 = &scif0; serial1 = &scif1; + i2c9 = "gpioi2c1"; + i2c12 = "i2cexio1"; }; chosen {
@@ -287,6 +289,29 @@ #clock-cells = <0>; clock-frequency = <148500000>; }; + + gpioi2c1: i2c-9 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "i2c-gpio"; + status = "disabled"; + gpios = <&gpio7 16 GPIO_ACTIVE_HIGH /* sda */ + &gpio7 15 GPIO_ACTIVE_HIGH /* scl */ + >; + i2c-gpio,delay-us = <5>; + }; + + /* + * I2C1 is routed to EXIO connector B, pins 64 (SCL) + 66 (SDA). + * A fallback to GPIO is provided. + */ + i2cexio1: i2c-12 { + compatible = "i2c-demux-pinctrl"; + i2c-parent = <&i2c1>, <&gpioi2c1>; + i2c-bus-name = "i2c-exio1"; + #address-cells = <1>; + #size-cells = <0>; + }; }; &du {
@@ -322,6 +347,11 @@ pinctrl-0 = <&scif_clk_pins>; pinctrl-names = "default"; + i2c1_pins: i2c1 { + groups = "i2c1"; + function = "i2c1"; + }; + i2c2_pins: i2c2 { groups = "i2c2"; function = "i2c2";
@@ -538,6 +568,11 @@ }; }; +&i2c1 { + pinctrl-0 = <&i2c1_pins>; + pinctrl-names = "i2c-exio1"; +}; + &i2c2 { pinctrl-0 = <&i2c2_pins>; pinctrl-names = "default";
Signature · 1 line
2.1.4
PATCH v3 6/13 ARM: dts: koelsch: use demuxer for I2C2
In reply to Simon HormanCreate a separate bus for HDMI related I2C2 and provide fallback to GPIO.
Based on work for the r8a7790/lager by Wolfram Sang.
---
v3
* New patch
--- arch/arm/boot/dts/r8a7791-koelsch.dts | 141 ++++++++++++++++++++-------------- 1 file changed, 82 insertions(+), 59 deletions(-)
arch/arm/boot/dts/r8a7791-koelsch.dts +82 -59
@@ -51,7 +51,9 @@ serial0 = &scif0; serial1 = &scif1; i2c9 = "gpioi2c1"; + i2c10 = "gpioi2c2"; i2c12 = "i2cexio1"; + i2c13 = "i2chdmi"; }; chosen {
@@ -301,6 +303,17 @@ i2c-gpio,delay-us = <5>; }; + gpioi2c2: i2c-10 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "i2c-gpio"; + status = "disabled"; + gpios = <&gpio2 7 GPIO_ACTIVE_HIGH /* sda */ + &gpio2 6 GPIO_ACTIVE_HIGH /* scl */ + >; + i2c-gpio,delay-us = <5>; + }; + /* * I2C1 is routed to EXIO connector B, pins 64 (SCL) + 66 (SDA). * A fallback to GPIO is provided.
@@ -312,6 +325,74 @@ #address-cells = <1>; #size-cells = <0>; }; + + /* + * A fallback to GPIO is provided for I2C2. + */ + i2chdmi: i2c-13 { + compatible = "i2c-demux-pinctrl"; + i2c-parent = <&i2c2>, <&gpioi2c2>; + i2c-bus-name = "i2c-hdmi"; + #address-cells = <1>; + #size-cells = <0>; + + ak4643: codec at 12 { + compatible = "asahi-kasei,ak4643"; + #sound-dai-cells = <0>; + reg = <0x12>; + }; + + composite-in at 20 { + compatible = "adi,adv7180"; + reg = <0x20>; + remote = <&vin1>; + + port { + adv7180: endpoint { + bus-width = <8>; + remote-endpoint = <&vin1ep>; + }; + }; + }; + + hdmi at 39 { + compatible = "adi,adv7511w"; + reg = <0x39>; + interrupt-parent = <&gpio3>; + interrupts = <29 IRQ_TYPE_LEVEL_LOW>; + + adi,input-depth = <8>; + adi,input-colorspace = "rgb"; + adi,input-clock = "1x"; + adi,input-style = <1>; + adi,input-justification = "evenly"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port at 0 { + reg = <0>; + adv7511_in: endpoint { + remote-endpoint = <&du_out_rgb>; + }; + }; + + port at 1 { + reg = <1>; + adv7511_out: endpoint { + remote-endpoint = <&hdmi_con>; + }; + }; + }; + }; + + eeprom at 50 { + compatible = "renesas,24c02"; + reg = <0x50>; + pagesize = <16>; + }; + }; }; &du {
@@ -575,67 +656,9 @@ &i2c2 { pinctrl-0 = <&i2c2_pins>; - pinctrl-names = "default"; + pinctrl-names = "i2c-hdmi"; - status = "okay"; clock-frequency = <100000>; - - ak4643: codec at 12 { - compatible = "asahi-kasei,ak4643"; - #sound-dai-cells = <0>; - reg = <0x12>; - }; - - composite-in at 20 { - compatible = "adi,adv7180"; - reg = <0x20>; - remote = <&vin1>; - - port { - adv7180: endpoint { - bus-width = <8>; - remote-endpoint = <&vin1ep>; - }; - }; - }; - - hdmi at 39 { - compatible = "adi,adv7511w"; - reg = <0x39>; - interrupt-parent = <&gpio3>; - interrupts = <29 IRQ_TYPE_LEVEL_LOW>; - - adi,input-depth = <8>; - adi,input-colorspace = "rgb"; - adi,input-clock = "1x"; - adi,input-style = <1>; - adi,input-justification = "evenly"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port at 0 { - reg = <0>; - adv7511_in: endpoint { - remote-endpoint = <&du_out_rgb>; - }; - }; - - port at 1 { - reg = <1>; - adv7511_out: endpoint { - remote-endpoint = <&hdmi_con>; - }; - }; - }; - }; - - eeprom at 50 { - compatible = "renesas,24c02"; - reg = <0x50>; - pagesize = <16>; - }; }; &i2c6 {
Signature · 1 line
2.1.4
PATCH v3 7/13 ARM: dts: koelsch: use demuxer for I2C4
In reply to Simon HormanMake it possible to fallback to GPIO for I2C4 on the EXIO-E connector.
This is based on reference work for the I2C0 core of the lager/r8a7790 by Wolfram Sang.
---
v3
* New Patch
--- arch/arm/boot/dts/r8a7791-koelsch.dts | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
arch/arm/boot/dts/r8a7791-koelsch.dts +35 -0
@@ -52,8 +52,10 @@ serial1 = &scif1; i2c9 = "gpioi2c1"; i2c10 = "gpioi2c2"; + i2c11 = "gpioi2c4"; i2c12 = "i2cexio1"; i2c13 = "i2chdmi"; + i2c14 = "i2cexio4"; }; chosen {
@@ -314,6 +316,17 @@ i2c-gpio,delay-us = <5>; }; + gpioi2c4: i2c-11 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "i2c-gpio"; + status = "disabled"; + gpios = <&gpio7 14 GPIO_ACTIVE_HIGH /* sda */ + &gpio7 13 GPIO_ACTIVE_HIGH /* scl */ + >; + i2c-gpio,delay-us = <5>; + }; + /* * I2C1 is routed to EXIO connector B, pins 64 (SCL) + 66 (SDA). * A fallback to GPIO is provided.
@@ -393,6 +406,18 @@ pagesize = <16>; }; }; + + /* + * I2C4 is routed to EXIO connector E, pins 37 (SCL) + 39 (SDA). + * A fallback to GPIO is provided. + */ + i2cexio4: i2c-14 { + compatible = "i2c-demux-pinctrl"; + i2c-parent = <&i2c4>, <&gpioi2c4>; + i2c-bus-name = "i2c-exio4"; + #address-cells = <1>; + #size-cells = <0>; + }; }; &du {
@@ -438,6 +463,11 @@ function = "i2c2"; }; + i2c4_pins: i2c4 { + groups = "i2c4"; + function = "i2c4"; + }; + du_pins: du { groups = "du_rgb888", "du_sync", "du_disp", "du_clk_out_0"; function = "du";
@@ -661,6 +691,11 @@ clock-frequency = <100000>; }; +&i2c4 { + pinctrl-0 = <&i2c4_pins>; + pinctrl-names = "i2c-exio4"; +}; + &i2c6 { status = "okay"; clock-frequency = <100000>;
Signature · 1 line
2.1.4
PATCH v3 8/13 ARM: dts: porter: use demuxer for I2C2
In reply to Simon HormanCreate a separate bus for HDMI related I2C2 and provide fallback to GPIO.
Based on work for the r8a7790/lager by Wolfram Sang.
---
v3
* New patch
* Compile tested only
--- arch/arm/boot/dts/r8a7791-porter.dts | 129 +++++++++++++++++++++-------------- 1 file changed, 76 insertions(+), 53 deletions(-)
arch/arm/boot/dts/r8a7791-porter.dts +76 -53
@@ -29,6 +29,8 @@ aliases { serial0 = &scif0; + i2c9 = "gpioi2c2"; + i2c10 = "i2chdmi"; }; chosen {
@@ -135,6 +137,79 @@ clocks = <&x14_clk>; }; }; + + gpioi2c2: i2c-9 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "i2c-gpio"; + status = "disabled"; + gpios = <&gpio2 7 GPIO_ACTIVE_HIGH /* sda */ + &gpio2 6 GPIO_ACTIVE_HIGH /* scl */ + >; + i2c-gpio,delay-us = <5>; + }; + + /* + * A fallback to GPIO is provided for I2C2. + */ + i2chdmi: i2c-10 { + compatible = "i2c-demux-pinctrl"; + i2c-parent = <&i2c2>, <&gpioi2c2>; + i2c-bus-name = "i2c-hdmi"; + #address-cells = <1>; + #size-cells = <0>; + + ak4642: codec at 12 { + compatible = "asahi-kasei,ak4642"; + #sound-dai-cells = <0>; + reg = <0x12>; + }; + + composite-in at 20 { + compatible = "adi,adv7180"; + reg = <0x20>; + remote = <&vin0>; + + port { + adv7180: endpoint { + bus-width = <8>; + remote-endpoint = <&vin0ep>; + }; + }; + }; + + hdmi at 39 { + compatible = "adi,adv7511w"; + reg = <0x39>; + interrupt-parent = <&gpio3>; + interrupts = <29 IRQ_TYPE_LEVEL_LOW>; + + adi,input-depth = <8>; + adi,input-colorspace = "rgb"; + adi,input-clock = "1x"; + adi,input-style = <1>; + adi,input-justification = "evenly"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port at 0 { + reg = <0>; + adv7511_in: endpoint { + remote-endpoint = <&du_out_rgb>; + }; + }; + + port at 1 { + reg = <1>; + adv7511_out: endpoint { + remote-endpoint = <&hdmi_con>; + }; + }; + }; + }; + }; }; &extal_clk {
@@ -296,61 +371,9 @@ &i2c2 { pinctrl-0 = <&i2c2_pins>; - pinctrl-names = "default"; + pinctrl-names = "i2c-hdmi"; - status = "okay"; clock-frequency = <400000>; - - ak4642: codec at 12 { - compatible = "asahi-kasei,ak4642"; - #sound-dai-cells = <0>; - reg = <0x12>; - }; - - composite-in at 20 { - compatible = "adi,adv7180"; - reg = <0x20>; - remote = <&vin0>; - - port { - adv7180: endpoint { - bus-width = <8>; - remote-endpoint = <&vin0ep>; - }; - }; - }; - - hdmi at 39 { - compatible = "adi,adv7511w"; - reg = <0x39>; - interrupt-parent = <&gpio3>; - interrupts = <29 IRQ_TYPE_LEVEL_LOW>; - - adi,input-depth = <8>; - adi,input-colorspace = "rgb"; - adi,input-clock = "1x"; - adi,input-style = <1>; - adi,input-justification = "evenly"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port at 0 { - reg = <0>; - adv7511_in: endpoint { - remote-endpoint = <&du_out_rgb>; - }; - }; - - port at 1 { - reg = <1>; - adv7511_out: endpoint { - remote-endpoint = <&hdmi_con>; - }; - }; - }; - }; }; &sata0 {
Signature · 1 line
2.1.4
PATCH v3 9/13 ARM: dts: porter: use demuxer for I2C2
In reply to Simon HormanCreate a separate bus for HDMI related I2C2 and provide fallback to GPIO.
Based on work for the r8a7790/lager by Wolfram Sang.
---
v3
* New patch
--- arch/arm/boot/dts/r8a7793-gose.dts | 114 ++++++++++++++++++++++--------------- 1 file changed, 69 insertions(+), 45 deletions(-)
arch/arm/boot/dts/r8a7793-gose.dts +69 -45
@@ -48,6 +48,8 @@ aliases { serial0 = &scif0; serial1 = &scif1; + i2c9 = "gpioi2c2"; + i2c11 = "i2chdmi"; }; chosen {
@@ -275,6 +277,72 @@ #clock-cells = <0>; clock-frequency = <148500000>; }; + + gpioi2c2: i2c-9 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "i2c-gpio"; + status = "disabled"; + gpios = <&gpio2 7 GPIO_ACTIVE_HIGH /* sda */ + &gpio2 6 GPIO_ACTIVE_HIGH /* scl */ + >; + i2c-gpio,delay-us = <5>; + }; + + /* + * A fallback to GPIO is provided for I2C2. + */ + i2chdmi: i2c-11 { + compatible = "i2c-demux-pinctrl"; + i2c-parent = <&i2c2>, <&gpioi2c2>; + i2c-bus-name = "i2c-hdmi"; + #address-cells = <1>; + #size-cells = <0>; + + ak4643: codec at 12 { + compatible = "asahi-kasei,ak4643"; + #sound-dai-cells = <0>; + reg = <0x12>; + }; + + hdmi at 39 { + compatible = "adi,adv7511w"; + reg = <0x39>; + interrupt-parent = <&gpio3>; + interrupts = <29 IRQ_TYPE_LEVEL_LOW>; + + adi,input-depth = <8>; + adi,input-colorspace = "rgb"; + adi,input-clock = "1x"; + adi,input-style = <1>; + adi,input-justification = "evenly"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port at 0 { + reg = <0>; + adv7511_in: endpoint { + remote-endpoint = <&du_out_rgb>; + }; + }; + + port at 1 { + reg = <1>; + adv7511_out: endpoint { + remote-endpoint = <&hdmi_con>; + }; + }; + }; + }; + + eeprom at 50 { + compatible = "renesas,r1ex24002", "atmel,24c02"; + reg = <0x50>; + pagesize = <16>; + }; + }; }; &du {
@@ -488,54 +556,10 @@ &i2c2 { pinctrl-0 = <&i2c2_pins>; - pinctrl-names = "default"; + pinctrl-names = "i2c-hdmi"; status = "okay"; clock-frequency = <100000>; - - ak4643: codec at 12 { - compatible = "asahi-kasei,ak4643"; - #sound-dai-cells = <0>; - reg = <0x12>; - }; - - hdmi at 39 { - compatible = "adi,adv7511w"; - reg = <0x39>; - interrupt-parent = <&gpio3>; - interrupts = <29 IRQ_TYPE_LEVEL_LOW>; - - adi,input-depth = <8>; - adi,input-colorspace = "rgb"; - adi,input-clock = "1x"; - adi,input-style = <1>; - adi,input-justification = "evenly"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port at 0 { - reg = <0>; - adv7511_in: endpoint { - remote-endpoint = <&du_out_rgb>; - }; - }; - - port at 1 { - reg = <1>; - adv7511_out: endpoint { - remote-endpoint = <&hdmi_con>; - }; - }; - }; - }; - - eeprom at 50 { - compatible = "renesas,r1ex24002", "atmel,24c02"; - reg = <0x50>; - pagesize = <16>; - }; }; &rcar_sound {
Signature · 1 line
2.1.4
PATCH v3 10/13 ARM: dts: koelsch: use demuxer for I2C4
In reply to Simon HormanMake it possible to fallback to GPIO for I2C4 on the EXIO-E connector.
This is based on reference work for the I2C0 core of the lager/r8a7790 by Wolfram Sang.
---
v3
* New Patch
--- arch/arm/boot/dts/r8a7793-gose.dts | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
arch/arm/boot/dts/r8a7793-gose.dts +35 -0
@@ -49,7 +49,9 @@ serial0 = &scif0; serial1 = &scif1; i2c9 = "gpioi2c2"; + i2c10 = "gpioi2c4"; i2c11 = "i2chdmi"; + i2c12 = "i2cexio4"; }; chosen {
@@ -289,6 +291,17 @@ i2c-gpio,delay-us = <5>; }; + gpioi2c4: i2c-10 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "i2c-gpio"; + status = "disabled"; + gpios = <&gpio7 14 GPIO_ACTIVE_HIGH /* sda */ + &gpio7 13 GPIO_ACTIVE_HIGH /* scl */ + >; + i2c-gpio,delay-us = <5>; + }; + /* * A fallback to GPIO is provided for I2C2. */
@@ -343,6 +356,18 @@ pagesize = <16>; }; }; + + /* + * I2C4 is routed to EXIO connector E, pins 37 (SCL) + 39 (SDA). + * A fallback to GPIO is provided. + */ + i2cexio4: i2c-12 { + compatible = "i2c-demux-pinctrl"; + i2c-parent = <&i2c4>, <&gpioi2c4>; + i2c-bus-name = "i2c-exio4"; + #address-cells = <1>; + #size-cells = <0>; + }; }; &du {
@@ -383,6 +408,11 @@ function = "i2c2"; }; + i2c4_pins: i2c4 { + groups = "i2c4"; + function = "i2c4"; + }; + du_pins: du { groups = "du_rgb888", "du_sync", "du_disp", "du_clk_out_0"; function = "du";
@@ -562,6 +592,11 @@ clock-frequency = <100000>; }; +&i2c4 { + pinctrl-0 = <&i2c4_pins>; + pinctrl-names = "i2c-exio4"; +}; + &rcar_sound { pinctrl-0 = <&sound_pins &sound_clk_pins>; pinctrl-names = "default";
Signature · 1 line
2.1.4
PATCH v3 11/13 ARM: dts: alt: use demuxer for I2C1
In reply to Simon HormanCreate a separate bus for HDMI related I2C1 and provide fallback to GPIO.
Based on work for the r8a7790/lager by Wolfram Sang.
---
v3
* New patch
--- arch/arm/boot/dts/r8a7794-alt.dts | 54 ++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 15 deletions(-)
arch/arm/boot/dts/r8a7794-alt.dts +39 -15
@@ -10,6 +10,7 @@ /dts-v1/; #include "r8a7794.dtsi" +#include <dt-bindings/gpio/gpio.h> / { model = "Alt";
@@ -17,6 +18,8 @@ aliases { serial0 = &scif2; + i2c9 = "gpioi2c1"; + i2c11 = "i2chdmi"; }; chosen {
@@ -77,6 +80,41 @@ #clock-cells = <0>; clock-frequency = <148500000>; }; + + gpioi2c1: i2c-9 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "i2c-gpio"; + status = "disabled"; + gpios = <&gpio4 1 GPIO_ACTIVE_HIGH /* sda */ + &gpio4 0 GPIO_ACTIVE_HIGH /* scl */ + >; + i2c-gpio,delay-us = <5>; + }; + + /* + * A fallback to GPIO is provided for I2C1. + */ + i2chdmi: i2c-11 { + compatible = "i2c-demux-pinctrl"; + i2c-parent = <&i2c1>, <&gpioi2c1>; + i2c-bus-name = "i2c-hdmi"; + #address-cells = <1>; + #size-cells = <0>; + + composite-in at 20 { + compatible = "adi,adv7180"; + reg = <0x20>; + remote = <&vin0>; + + port { + adv7180: endpoint { + bus-width = <8>; + remote-endpoint = <&vin0ep>; + }; + }; + }; + }; }; &du {
@@ -171,23 +209,9 @@ &i2c1 { pinctrl-0 = <&i2c1_pins>; - pinctrl-names = "default"; + pinctrl-names = "i2c-hdmi"; - status = "okay"; clock-frequency = <400000>; - - composite-in at 20 { - compatible = "adi,adv7180"; - reg = <0x20>; - remote = <&vin0>; - - port { - adv7180: endpoint { - bus-width = <8>; - remote-endpoint = <&vin0ep>; - }; - }; - }; }; &vin0 {
Signature · 1 line
2.1.4
PATCH v3 12/13 ARM: dts: alt: use demuxer for I2C4
In reply to Simon HormanMake it possible to fallback to GPIO for I2C4 on the EXIO-B connector.
This is based on reference work for the I2C0 core of the lager/r8a7790 by Wolfram Sang.
---
v3
* New Patch
--- arch/arm/boot/dts/r8a7794-alt.dts | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
arch/arm/boot/dts/r8a7794-alt.dts +35 -0
@@ -19,7 +19,9 @@ aliases { serial0 = &scif2; i2c9 = "gpioi2c1"; + i2c10 = "gpioi2c4"; i2c11 = "i2chdmi"; + i2c12 = "i2cexio4"; }; chosen {
@@ -92,6 +94,17 @@ i2c-gpio,delay-us = <5>; }; + gpioi2c4: i2c-10 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "i2c-gpio"; + status = "disabled"; + gpios = <&gpio4 9 GPIO_ACTIVE_HIGH /* sda */ + &gpio4 8 GPIO_ACTIVE_HIGH /* scl */ + >; + i2c-gpio,delay-us = <5>; + }; + /* * A fallback to GPIO is provided for I2C1. */
@@ -115,6 +128,18 @@ }; }; }; + + /* + * I2C4 is routed to EXIO connector B, pins 73 (SCL) + 74 (SDA). + * A fallback to GPIO is provided. + */ + i2cexio4: i2c-14 { + compatible = "i2c-demux-pinctrl"; + i2c-parent = <&i2c4>, <&gpioi2c4>; + i2c-bus-name = "i2c-exio4"; + #address-cells = <1>; + #size-cells = <0>; + }; }; &du {
@@ -174,6 +199,11 @@ function = "i2c1"; }; + i2c4_pins: i2c4 { + groups = "i2c4"; + function = "i2c4"; + }; + vin0_pins: vin0 { groups = "vin0_data8", "vin0_clk"; function = "vin0";
@@ -214,6 +244,11 @@ clock-frequency = <400000>; }; +&i2c4 { + pinctrl-0 = <&i2c4_pins>; + pinctrl-names = "i2c-exio4"; +}; + &vin0 { status = "okay"; pinctrl-0 = <&vin0_pins>;
Signature · 1 line
2.1.4
PATCH v3 13/13 ARM: dts: silk: use demuxer for I2C1
In reply to Simon HormanCreate a separate bus for HDMI related I2C1 and provide fallback to GPIO.
Based on work for the r8a7790/lager by Wolfram Sang.
---
v3
* New patch
* Compile tested only
--- arch/arm/boot/dts/r8a7794-silk.dts | 117 ++++++++++++++++++++++--------------- 1 file changed, 70 insertions(+), 47 deletions(-)
arch/arm/boot/dts/r8a7794-silk.dts +70 -47
@@ -20,6 +20,8 @@ aliases { serial0 = &scif2; + i2c9 = "gpioi2c1"; + i2c10 = "i2chdmi"; }; chosen {
@@ -119,6 +121,73 @@ #clock-cells = <0>; clock-frequency = <74250000>; }; + + gpioi2c1: i2c-9 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "i2c-gpio"; + status = "disabled"; + gpios = <&gpio4 1 GPIO_ACTIVE_HIGH /* sda */ + &gpio4 0 GPIO_ACTIVE_HIGH /* scl */ + >; + i2c-gpio,delay-us = <5>; + }; + + /* + * A fallback to GPIO is provided for I2C1. + */ + i2chdmi: i2c-10 { + compatible = "i2c-demux-pinctrl"; + i2c-parent = <&i2c1>, <&gpioi2c1>; + i2c-bus-name = "i2c-hdmi"; + #address-cells = <1>; + #size-cells = <0>; + + composite-in at 20 { + compatible = "adi,adv7180"; + reg = <0x20>; + remote = <&vin0>; + + port { + adv7180: endpoint { + bus-width = <8>; + remote-endpoint = <&vin0ep>; + }; + }; + }; + + hdmi at 39 { + compatible = "adi,adv7511w"; + reg = <0x39>; + interrupt-parent = <&gpio5>; + interrupts = <23 IRQ_TYPE_LEVEL_LOW>; + + adi,input-depth = <8>; + adi,input-colorspace = "rgb"; + adi,input-clock = "1x"; + adi,input-style = <1>; + adi,input-justification = "evenly"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port at 0 { + reg = <0>; + adv7511_in: endpoint { + remote-endpoint = <&du_out_rgb0>; + }; + }; + + port at 1 { + reg = <1>; + adv7511_out: endpoint { + remote-endpoint = <&hdmi_con>; + }; + }; + }; + }; + }; }; &extal_clk {
@@ -225,55 +294,9 @@ &i2c1 { pinctrl-0 = <&i2c1_pins>; - pinctrl-names = "default"; + pinctrl-names = "i2c-hdmi"; - status = "okay"; clock-frequency = <400000>; - - composite-in at 20 { - compatible = "adi,adv7180"; - reg = <0x20>; - remote = <&vin0>; - - port { - adv7180: endpoint { - bus-width = <8>; - remote-endpoint = <&vin0ep>; - }; - }; - }; - - hdmi at 39 { - compatible = "adi,adv7511w"; - reg = <0x39>; - interrupt-parent = <&gpio5>; - interrupts = <23 IRQ_TYPE_LEVEL_LOW>; - - adi,input-depth = <8>; - adi,input-colorspace = "rgb"; - adi,input-clock = "1x"; - adi,input-style = <1>; - adi,input-justification = "evenly"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port at 0 { - reg = <0>; - adv7511_in: endpoint { - remote-endpoint = <&du_out_rgb0>; - }; - }; - - port at 1 { - reg = <1>; - adv7511_out: endpoint { - remote-endpoint = <&hdmi_con>; - }; - }; - }; - }; }; &mmcif0 {
Signature · 1 line
2.1.4