From patchwork Tue May 14 08:47:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 10942515 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 96F25924 for ; Tue, 14 May 2019 08:48:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83A412857E for ; Tue, 14 May 2019 08:48:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71866285B9; Tue, 14 May 2019 08:48:13 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1678D2857E for ; Tue, 14 May 2019 08:48:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726771AbfENIsH (ORCPT ); Tue, 14 May 2019 04:48:07 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:55472 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725916AbfENIrj (ORCPT ); Tue, 14 May 2019 04:47:39 -0400 X-UUID: bf7c4763819d42ffbce3bc351accec92-20190514 X-UUID: bf7c4763819d42ffbce3bc351accec92-20190514 Received: from mtkcas34.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 2021548160; Tue, 14 May 2019 16:47:34 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 14 May 2019 16:47:30 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 14 May 2019 16:47:28 +0800 From: Chunfeng Yun To: Rob Herring , Greg Kroah-Hartman , Heikki Krogerus CC: Mark Rutland , Chunfeng Yun , Matthias Brugger , Adam Thomson , Li Jun , Badhri Jagan Sridharan , Hans de Goede , Andy Shevchenko , Min Guo , , , , , , Biju Das , Linus Walleij Subject: [PATCH v5 2/6] dt-bindings: usb: add binding for Type-B GPIO connector driver Date: Tue, 14 May 2019 16:47:19 +0800 Message-ID: <1557823643-8616-3-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1557823643-8616-1-git-send-email-chunfeng.yun@mediatek.com> References: <1557823643-8616-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It's used to support dual role switch via GPIO when use Type-B receptacle, typically the USB ID pin is connected to an input GPIO pin Signed-off-by: Chunfeng Yun --- v5 changes: 1. treat type-B connector as child device of USB controller's, but not as a separate virtual device, suggested by Rob 2. put connector's port node under connector node, suggested by Rob v4 no changes v3 changes: 1. treat type-B connector as a virtual device, but not child device of USB controller's v2 changes: 1. new patch to make binding clear suggested by Hans --- .../bindings/usb/typeb-conn-gpio.txt | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/typeb-conn-gpio.txt diff --git a/Documentation/devicetree/bindings/usb/typeb-conn-gpio.txt b/Documentation/devicetree/bindings/usb/typeb-conn-gpio.txt new file mode 100644 index 000000000000..20dd3499a348 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/typeb-conn-gpio.txt @@ -0,0 +1,42 @@ +USB Type-B GPIO Connector + +This is used to switch dual role mode from the USB ID pin connected to +an input GPIO pin. + +Required properties: +- compatible : should include "linux,typeb-conn-gpio" and "usb-b-connector". +- id-gpios, vbus-gpios : either one of them must be present, and both + can be present as well. +- vbus-supply : can be present if needed when supports dual role mode or + host mode. + see connector/usb-connector.txt + +Sub-nodes: +- port : should be present. + see graph.txt + +Example: + +&mtu3 { + status = "okay"; + + connector { + compatible = "linux,typeb-conn-gpio", "usb-b-connector"; + label = "micro-USB"; + type = "micro"; + id-gpios = <&pio 12 GPIO_ACTIVE_HIGH>; + vbus-supply = <&usb_p0_vbus>; + + port { + bconn_ep: endpoint@0 { + remote-endpoint = <&usb_role_sw>; + }; + }; + }; + + port { + usb_role_sw: endpoint@0 { + remote-endpoint = <&bconn_ep>; + }; + }; +};