From patchwork Fri Oct 17 14:40:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien CHAUVEAU X-Patchwork-Id: 5098061 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D39B3C11AC for ; Fri, 17 Oct 2014 14:41:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A9EBF20204 for ; Fri, 17 Oct 2014 14:41:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 92FFF20200 for ; Fri, 17 Oct 2014 14:41:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xf8j4-0001pN-8j; Fri, 17 Oct 2014 14:41:54 +0000 Received: from 8.mo3.mail-out.ovh.net ([87.98.172.249] helo=mo3.mail-out.ovh.net) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xf8ir-0001ib-FO for linux-rockchip@lists.infradead.org; Fri, 17 Oct 2014 14:41:43 +0000 Received: from mail436.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo3.mail-out.ovh.net (Postfix) with SMTP id A4DC4FFC150 for ; Fri, 17 Oct 2014 16:41:11 +0200 (CEST) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 17 Oct 2014 16:41:09 +0200 Received: from laubervilliers-656-01-116-88.w193-248.abo.wanadoo.fr (HELO mail.neo-technologies.fr) (technique@neo-electronics.fr@193.248.240.88) by ns0.ovh.net with SMTP; 17 Oct 2014 16:41:08 +0200 Received: from pandora.neo-technologies.fr (unknown [192.168.0.105]) by mail.neo-technologies.fr (Postfix) with ESMTPSA id B6A4D98116; Fri, 17 Oct 2014 16:40:39 +0200 (CEST) From: Julien CHAUVEAU To: Heiko Stuebner , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Russell King , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Rockchip SoC...), linux-rockchip@lists.infradead.org (open list:ARM/Rockchip SoC...), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND...), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] ARM: dts: rockchip: use internal pull-up resistors on I2C busses Date: Fri, 17 Oct 2014 16:40:30 +0200 Message-Id: <1413556830-27854-1-git-send-email-julien.chauveau@neo-technologies.fr> X-Mailer: git-send-email 1.9.1 X-Ovh-Tracer-Id: 3057944148409647329 X-Ovh-Remote: 193.248.240.88 (laubervilliers-656-01-116-88.w193-248.abo.wanadoo.fr) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: -100 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejhedrtddtucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-Spam-Check: DONE|U 0.5/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejhedrtddtucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141017_074141_828060_FBD5118A X-CRM114-Status: GOOD ( 10.30 ) X-Spam-Score: -0.0 (/) Cc: Julien CHAUVEAU X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According to the I2C bus specification, it is required to use pull-up resistors on the clock and data lines. Probing the I2C busses with i2cdetect results in bad results when no devices are connected and no external resistors are used. This patch configures the I2C busses to use the internal pull-up resistors on the RK3066, RK3188 and RK3288 Rockchip processors. It should also be noted that these default pull settings match the original configuration on these SoCs. Below is the results of using i2cdetect on a I2C bus with no devices connected before (1) and after (2) applying this patch. (1) root@localhost:~# i2cdetect 3 WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-3. I will probe address range 0x03-0x77. Continue? [Y/n] 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30: -- -- -- -- -- rk3x-i2c 2005a000.i2c: timeout, ipd: 0x81, state: 2 -- rk3x-i2c 2005a000.i2c: timeout, ipd: 0x80, state: 2 -- rk3x-i2c 2005a000.i2c: timeout, ipd: 0x80, state: 2 -- rk3x-i2c 2005a000.i2c: timeout, ipd: 0x80, state: 3 -- rk3x-i2c 2005a000.i2c: timeout, ipd: 0x80, state: 3 -- rk3x-i2c 2005a000.i2c: timeout, ipd: 0x80, state: 3 -- rk3x-i2c 2005a000.i2c: timeout, ipd: 0x80, state: 3 ... (2) root@localhost:~# i2cdetect 3 WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-3. I will probe address range 0x03-0x77. Continue? [Y/n] 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- Signed-off-by: Julien CHAUVEAU --- arch/arm/boot/dts/rk3066a.dtsi | 20 ++++++++++---------- arch/arm/boot/dts/rk3188.dtsi | 20 ++++++++++---------- arch/arm/boot/dts/rk3288.dtsi | 24 ++++++++++++------------ 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/arch/arm/boot/dts/rk3066a.dtsi b/arch/arm/boot/dts/rk3066a.dtsi index ad9c2db..c5cdf55 100644 --- a/arch/arm/boot/dts/rk3066a.dtsi +++ b/arch/arm/boot/dts/rk3066a.dtsi @@ -202,36 +202,36 @@ i2c0 { i2c0_xfer: i2c0-xfer { - rockchip,pins = , - ; + rockchip,pins = , + ; }; }; i2c1 { i2c1_xfer: i2c1-xfer { - rockchip,pins = , - ; + rockchip,pins = , + ; }; }; i2c2 { i2c2_xfer: i2c2-xfer { - rockchip,pins = , - ; + rockchip,pins = , + ; }; }; i2c3 { i2c3_xfer: i2c3-xfer { - rockchip,pins = , - ; + rockchip,pins = , + ; }; }; i2c4 { i2c4_xfer: i2c4-xfer { - rockchip,pins = , - ; + rockchip,pins = , + ; }; }; diff --git a/arch/arm/boot/dts/rk3188.dtsi b/arch/arm/boot/dts/rk3188.dtsi index ddaada7..ee2865f 100644 --- a/arch/arm/boot/dts/rk3188.dtsi +++ b/arch/arm/boot/dts/rk3188.dtsi @@ -188,36 +188,36 @@ i2c0 { i2c0_xfer: i2c0-xfer { - rockchip,pins = , - ; + rockchip,pins = , + ; }; }; i2c1 { i2c1_xfer: i2c1-xfer { - rockchip,pins = , - ; + rockchip,pins = , + ; }; }; i2c2 { i2c2_xfer: i2c2-xfer { - rockchip,pins = , - ; + rockchip,pins = , + ; }; }; i2c3 { i2c3_xfer: i2c3-xfer { - rockchip,pins = , - ; + rockchip,pins = , + ; }; }; i2c4 { i2c4_xfer: i2c4-xfer { - rockchip,pins = , - ; + rockchip,pins = , + ; }; }; diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi index 874e66d..9a4b1f7 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -636,43 +636,43 @@ i2c0 { i2c0_xfer: i2c0-xfer { - rockchip,pins = <0 15 RK_FUNC_1 &pcfg_pull_none>, - <0 16 RK_FUNC_1 &pcfg_pull_none>; + rockchip,pins = <0 15 RK_FUNC_1 &pcfg_pull_up>, + <0 16 RK_FUNC_1 &pcfg_pull_up>; }; }; i2c1 { i2c1_xfer: i2c1-xfer { - rockchip,pins = <8 4 RK_FUNC_1 &pcfg_pull_none>, - <8 5 RK_FUNC_1 &pcfg_pull_none>; + rockchip,pins = <8 4 RK_FUNC_1 &pcfg_pull_up>, + <8 5 RK_FUNC_1 &pcfg_pull_up>; }; }; i2c2 { i2c2_xfer: i2c2-xfer { - rockchip,pins = <6 9 RK_FUNC_1 &pcfg_pull_none>, - <6 10 RK_FUNC_1 &pcfg_pull_none>; + rockchip,pins = <6 9 RK_FUNC_1 &pcfg_pull_up>, + <6 10 RK_FUNC_1 &pcfg_pull_up>; }; }; i2c3 { i2c3_xfer: i2c3-xfer { - rockchip,pins = <2 16 RK_FUNC_1 &pcfg_pull_none>, - <2 17 RK_FUNC_1 &pcfg_pull_none>; + rockchip,pins = <2 16 RK_FUNC_1 &pcfg_pull_up>, + <2 17 RK_FUNC_1 &pcfg_pull_up>; }; }; i2c4 { i2c4_xfer: i2c4-xfer { - rockchip,pins = <7 17 RK_FUNC_1 &pcfg_pull_none>, - <7 18 RK_FUNC_1 &pcfg_pull_none>; + rockchip,pins = <7 17 RK_FUNC_1 &pcfg_pull_up>, + <7 18 RK_FUNC_1 &pcfg_pull_up>; }; }; i2c5 { i2c5_xfer: i2c5-xfer { - rockchip,pins = <7 19 RK_FUNC_1 &pcfg_pull_none>, - <7 20 RK_FUNC_1 &pcfg_pull_none>; + rockchip,pins = <7 19 RK_FUNC_1 &pcfg_pull_up>, + <7 20 RK_FUNC_1 &pcfg_pull_up>; }; };