From patchwork Wed Oct 23 16:55:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jeff Kletsky X-Patchwork-Id: 1182312 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=allycomm.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KeEjZyQR"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46yxMb0Gt8z9sNx for ; Thu, 24 Oct 2019 03:55:39 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=tnMtEOw/t945bEABifOte9ZN7OUaUfl+jpZhBgzdAJc=; b=KeEjZyQRvzMa1q eHTqux9IyEclwQMvYA08sbIbGXoTDIgTnC5ia9+Ut+x5Cgqk34LFtFJA2GCZUP8t67+DRi7sI/m/P BqHF0Js1Bl995dMilE6F22YstD57Vqw9o2lnUMaQ/OwqblhX+MZD1bkPIQb148u6psopevID4pMTf +8685Ij8rdC/wgpmFRqMZDUdnt/p3YSUcgUnmjyqBEu11FVlZAmrTIRmKhgyXBnrrEFEL7hWNyn8O Q4J0M3bB6HTWSQqeNm0KfSIA36B4Woow2bsrTytw+teYoZ0YV8ju+AZ7PmnZS6BuSdzZHiIH6lrL1 02INZ0GSUuY9bZIJjrdQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNJv3-0001iV-S5; Wed, 23 Oct 2019 16:55:33 +0000 Received: from mx.allycomm.com ([138.68.30.55]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNJuv-0001ZX-Mz for openwrt-devel@lists.openwrt.org; Wed, 23 Oct 2019 16:55:27 +0000 Received: from allycomm.com (unknown [IPv6:2601:647:5401:2210::49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.allycomm.com (Postfix) with ESMTPSA id 7010559484; Wed, 23 Oct 2019 09:55:15 -0700 (PDT) From: Jeff Kletsky To: openwrt-devel@lists.openwrt.org Date: Wed, 23 Oct 2019 09:55:01 -0700 Message-Id: <20191023165502.25906-1-lede@allycomm.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191023_095525_747509_5EEF9D11 X-CRM114-Status: GOOD ( 10.01 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record Subject: [OpenWrt-Devel] [PATCH 1/2] ath79: GL-AR300M series: Add I2C Support X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jeff Kletsky Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Jeff Kletsky The GL-AR300M series have an internal header for I2C. Provide DTS definitions for the i2c-gpio driver. The I2C drivers; kmod-i2c-core, kmod-i2c-gpio consume ~20 kB of flash and can be loaded as modules, Default clock measured ~11.4 ms period, ~88 kHz The board has two sets of (unpopulated) headers. While facing the back of the board (looking into the Ethernet jacks), and looking from the top, the one on the left edge of the baord with four holes is the I2C header. It appears to be labeled J8 on "GL-AR300M-V1.4.0" boards. | (Patch antenna) | | | O GND | O SDA / GPIO 17 | O SCL / GPIO 16 | ⊡ 3V3 (square land) | | (Ethernet jacks) https://docs.gl-inet.com/en/3/hardware/ar300m/#pcb-pinout states "Note: I2C is not working in some early version of the router." Signed-off-by: Jeff Kletsky --- target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi index 267f2f478f..b72aa65522 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi @@ -60,6 +60,13 @@ linux,default-trigger = "phy0tpt"; }; }; + + i2c: i2c { + compatible = "i2c-gpio"; + + sda-gpios = <&gpio 17 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&gpio 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + }; }; &pcie0 {