From patchwork Fri Jan 22 20:40:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Clark X-Patchwork-Id: 571799 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 28CDC1402A1 for ; Sat, 23 Jan 2016 07:44:16 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Don8gQcm; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 3FAFB28C0EF; Fri, 22 Jan 2016 21:41:17 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id F3D4E28163A for ; Fri, 22 Jan 2016 21:40:54 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .gmail. - helo: .mail-qk0-f193.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from mail-qk0-f193.google.com (mail-qk0-f193.google.com [209.85.220.193]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Fri, 22 Jan 2016 21:40:27 +0100 (CET) Received: by mail-qk0-f193.google.com with SMTP id s5so2998090qkd.2 for ; Fri, 22 Jan 2016 12:41:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BywFTmcp8dt0slYF0cTHvPHiiWwm8E03cV/3/gt3yCs=; b=Don8gQcmJ83tnewh/hm3eR5HvpbOTRTL6Re+IOrOTn4gxxYMHZpJ7PrH7uWJyGAnoW 0m0+F+EFDDqlM4g2PtD1FPtFAXKO8v1utE4vddQauX1WtxDKIZg8ay0/PqFRFVsAorPI FAbsoXmUNJIoqxfFzD1UGzDuC9q5rHAO9w7lUSzl+NW3u+TqVzzXt04mckNrHEkWWI8E WhVeduDXx1If+jDCpviBlh15yRZ01Drkk3eLPrQGeyJcJ4ncHEhbW0fbpsHdlBNZWFTC cOzbP76GM4+Ps3KcgYz82j19JyVXeJgmAUq+vDRCL4ZTswLUKClv68ZqVeAvryD5L7tS jZAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BywFTmcp8dt0slYF0cTHvPHiiWwm8E03cV/3/gt3yCs=; b=T8g0bm1ukM4ODwhSfx036zyFLcFGcSRgPkyTBDFifmymRd1CLQiBtAuVWf2+0zEhvT tDaIATz2QGI1l/leuPzaboduxCbfY6NF1pcQrGAaKhAZks6C9zGmHZdNTf5bsWmH1GSP kb5vZiANRd4IdLAAFWl6176jU5VnmJNFii6FtOrItEA/lFegDWyo1WD3qcPrCSU2JCdt Rxr9shKRTydmo5ha4+vWe6So2tHiHy8namyV/ETJ+zkKQ8U4Ua+ultbahkHIXm4M4koP r++hguR6O229WLVvL6dPssMMfhv/J4TWP46jmwK8vZEsOtt1aTPZkP3CmoT3nHWL0vdk XFPg== X-Gm-Message-State: AG10YOSVzGAqWDhGQHbRKoT3dDut+bJsXOl48nVwYI3fUCeM+DtRzh6cUHtYc5Mt8a0qPQ== X-Received: by 10.55.78.75 with SMTP id c72mr6185307qkb.97.1453495267160; Fri, 22 Jan 2016 12:41:07 -0800 (PST) Received: from ip-192-168-74-100.ec2.internal (ec2-52-20-192-9.compute-1.amazonaws.com. [52.20.192.9]) by smtp.gmail.com with ESMTPSA id p188sm3446540qhb.34.2016.01.22.12.41.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jan 2016 12:41:06 -0800 (PST) From: John Clark To: openwrt-devel@lists.openwrt.org Date: Fri, 22 Jan 2016 20:40:46 +0000 Message-Id: <1453495247-5883-3-git-send-email-inindev@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1453495247-5883-1-git-send-email-inindev@gmail.com> References: <1453495247-5883-1-git-send-email-inindev@gmail.com> Subject: [OpenWrt-Devel] [PATCH 3/4] rampis: HLK-RM04 - Setup I2C as GPIO X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" The I2C function of the RT5350 SoC on the HLK-RM04 is used for GPIO1 and GPIO2. Take note that the I2C_SD pin is GPIO1 on the RT5350 and is exposed on the HLK-RM04 as GPIO0 Likewise the I2C_SCLK pin is GPIO2 on the RT5350 and is exposed on the HLK-RM04 as GPIO1 group mode 1 mode 2 hlk-rm04 pin & export i2c i2c_sd gpio1 (pin 8, hlk-rm04:gpio0) i2c i2c_sclk gpio2 (pin 9, hlk-rm04:gpio1) reference: http://www.hlktech.net/product_detail.php?ProId=39 http://cdn.sparkfun.com/datasheets/Wireless/WiFi/RT5350.pdf Signed-off-by: John Clark --- target/linux/ramips/dts/HLKRM04.dts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/target/linux/ramips/dts/HLKRM04.dts b/target/linux/ramips/dts/HLKRM04.dts index 5f43642..713b51f 100644 --- a/target/linux/ramips/dts/HLKRM04.dts +++ b/target/linux/ramips/dts/HLKRM04.dts @@ -60,7 +60,7 @@ pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "jtag"; + ralink,group = "i2c", "jtag"; ralink,function = "gpio"; }; }; @@ -82,6 +82,25 @@ status = "okay"; }; + gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + /* I2C */ + gpio1 { + /* I2C_I2C_SD */ + gpio-export,name = "hlk-rm04:gpio0"; + gpio-export,direction_may_change = <1>; + gpios = <&gpio0 1 0>; + }; + gpio2 { + /* I2C_I2C_SCLK */ + gpio-export,name = "hlk-rm04:gpio1"; + gpio-export,direction_may_change = <1>; + gpios = <&gpio0 2 0>; + }; + }; + gpio-keys-polled { compatible = "gpio-keys-polled"; #address-cells = <1>;