From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfram Sang Subject: [PATCH v4 05/14] ARM: dts: koelsch: use demuxer for I2C1 Date: Sun, 6 Nov 2016 21:20:23 +0100 Message-ID: <20161106202032.5227-6-wsa+renesas@sang-engineering.com> References: <20161106202032.5227-1-wsa+renesas@sang-engineering.com> Return-path: Received: from sauhun.de ([89.238.76.85]:46886 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751765AbcKFUU4 (ORCPT ); Sun, 6 Nov 2016 15:20:56 -0500 In-Reply-To: <20161106202032.5227-1-wsa+renesas@sang-engineering.com> Sender: linux-i2c-owner@vger.kernel.org List-Id: linux-i2c@vger.kernel.org To: linux-renesas-soc@vger.kernel.org, Simon Horman Cc: linux-i2c@vger.kernel.org, Simon Horman , Wolfram Sang From: Simon Horman Make 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. Signed-off-by: Simon Horman [wsa: rebased and fixed aliases] Signed-off-by: Wolfram Sang --- arch/arm/boot/dts/r8a7791-koelsch.dts | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts index 57e69af6513619..5405d337d74486 100644 --- a/arch/arm/boot/dts/r8a7791-koelsch.dts +++ b/arch/arm/boot/dts/r8a7791-koelsch.dts @@ -50,6 +50,8 @@ aliases { serial0 = &scif0; serial1 = &scif1; + i2c9 = &gpioi2c1; + i2c12 = &i2cexio1; }; chosen { @@ -298,6 +300,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 { @@ -333,6 +358,11 @@ pinctrl-0 = <&scif_clk_pins>; pinctrl-names = "default"; + i2c1_pins: i2c1 { + groups = "i2c1"; + function = "i2c1"; + }; + i2c2_pins: i2c2 { groups = "i2c2"; function = "i2c2"; @@ -582,6 +612,11 @@ }; }; +&i2c1 { + pinctrl-0 = <&i2c1_pins>; + pinctrl-names = "i2c-exio1"; +}; + &i2c2 { pinctrl-0 = <&i2c2_pins>; pinctrl-names = "default"; -- 2.9.3