From patchwork Mon Jan 16 19:14:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Icenowy Zheng X-Patchwork-Id: 9519339 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E56CC6020B for ; Mon, 16 Jan 2017 19:17:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D323028306 for ; Mon, 16 Jan 2017 19:17:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C62A628335; Mon, 16 Jan 2017 19:17:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5516E28306 for ; Mon, 16 Jan 2017 19:17:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cTCmX-0003Ub-3a; Mon, 16 Jan 2017 19:17:29 +0000 Received: from forward17j.cmail.yandex.net ([2a02:6b8:0:1630::f4]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cTCmM-0002VQ-13 for linux-arm-kernel@lists.infradead.org; Mon, 16 Jan 2017 19:17:20 +0000 Received: from smtp3m.mail.yandex.net (smtp3m.mail.yandex.net [IPv6:2a02:6b8:0:2519::125]) by forward17j.cmail.yandex.net (Yandex) with ESMTP id CF273206E7; Mon, 16 Jan 2017 22:16:53 +0300 (MSK) Received: from smtp3m.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3m.mail.yandex.net (Yandex) with ESMTP id 1C0F428408BB; Mon, 16 Jan 2017 22:16:45 +0300 (MSK) Received: by smtp3m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id h4aXT6W1l1-GPjKK63p; Mon, 16 Jan 2017 22:16:43 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aosc.xyz; s=mail; t=1484594205; bh=hFP6HX5K6bMnhWoDl/A4ZlIE5apEWSUxqgJaTbe9By0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=PR+BUwQnteuZuwE4MqFGU72+YOAjdq6tE4A61UJPDab5bbrKPwinie+BZXjnWolt/ FlU9CKTmfZX+JZQ0B3/k896TT9ghJA2e9Pxr2xyGlSCQR0k1wldx5VVQespfG2/+vy Sk0nfBZ/Oyb5Zqmrh8RigfzmETdjwNyoPkZBnYwU= Authentication-Results: smtp3m.mail.yandex.net; dkim=pass header.i=@aosc.xyz X-Yandex-ForeignMX: US X-Yandex-Suid-Status: 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 1130000036118848 From: Icenowy Zheng To: Rob Herring , Maxime Ripard , Chen-Yu Tsai , Kishon Vijay Abraham I , Greg Kroah-Hartman , Bin Liu Subject: [PATCH 3/4] ARM: dts: sun8i: enable USB OTG for Orange Pi Zero board Date: Tue, 17 Jan 2017 03:14:48 +0800 Message-Id: <20170116191449.50397-4-icenowy@aosc.xyz> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170116191449.50397-1-icenowy@aosc.xyz> References: <20170116191449.50397-1-icenowy@aosc.xyz> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170116_111718_330760_E48BCF75 X-CRM114-Status: GOOD ( 10.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Icenowy Zheng , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Orange Pi Zero board features a USB OTG port, which has a ID pin, and can be used to power up the borad. However, even if the board is powered via +5V pin in GPIO/expansion headers, the VBUS in the OTG port cannot be powered up, thus it's impossible to use it in host mode with simple OTG cables. Add support for it in peripheral mode. If someone really want to use it in host mode, the dr_mode property of &usb_otg can be changed into "otg", then a powered USB OTG cable or USB HUB is needed for powering out the external USB devices. Signed-off-by: Icenowy Zheng --- arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts index b7ca916d871d..437536e2b594 100644 --- a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts +++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts @@ -154,7 +154,13 @@ status = "disabled"; }; +&usb_otg { + dr_mode = "peripheral"; + status = "okay"; +}; + &usbphy { /* USB VBUS is always on */ status = "okay"; + usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ };