From patchwork Tue Aug 13 11:27:06 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: 1146230 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4679Sq3FnTz9sN6 for ; Tue, 13 Aug 2019 21:28:27 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727437AbfHML1k (ORCPT ); Tue, 13 Aug 2019 07:27:40 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:55080 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727195AbfHML1f (ORCPT ); Tue, 13 Aug 2019 07:27:35 -0400 X-UUID: f017d74a93074949bb30d888807d023d-20190813 X-UUID: f017d74a93074949bb30d888807d023d-20190813 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1758261697; Tue, 13 Aug 2019 19:27:25 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 13 Aug 2019 19:27:19 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 13 Aug 2019 19:27:22 +0800 From: Chunfeng Yun To: Rob Herring , Greg Kroah-Hartman , Biju Das CC: Mark Rutland , Chunfeng Yun , Matthias Brugger , Adam Thomson , Li Jun , Badhri Jagan Sridharan , Heikki Krogerus , Hans de Goede , Andy Shevchenko , Min Guo , , , , , , Linus Walleij , Nagarjuna Kristam Subject: [PATCH next v9 03/11] dt-bindings: usb: add binding for USB GPIO based connection detection driver Date: Tue, 13 Aug 2019 19:27:06 +0800 Message-ID: <1565695634-9711-4-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1565695634-9711-1-git-send-email-chunfeng.yun@mediatek.com> References: <1565695634-9711-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: E03EBA038E1275BFC1EB911BB3F120C24BD75ADB3CE4BCA941B2E8BC00FAE8BF2000:8 X-MTK: N Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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, and also used to enable/disable device when the USB Vbus pin is connected to an input GPIO. Signed-off-by: Chunfeng Yun --- v9 no changes v8 changes: 1. rename the title 2. change the compatible as "linux,usb-conn-gpio" instead of "linux,typeb-conn-gpio" v7 changes: 1. add description for device only mode v6 changes: 1. remove status and port nodes in example 2. make vbus-supply as optional property 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 --- .../devicetree/bindings/usb/usb-conn-gpio.txt | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/usb-conn-gpio.txt diff --git a/Documentation/devicetree/bindings/usb/usb-conn-gpio.txt b/Documentation/devicetree/bindings/usb/usb-conn-gpio.txt new file mode 100644 index 000000000000..d4d107fedc22 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/usb-conn-gpio.txt @@ -0,0 +1,31 @@ +USB GPIO Based Connection Detection + +This is typically used to switch dual role mode from the USB ID pin connected +to an input GPIO, and also used to enable/disable device mode from the USB +Vbus pin connected to an input GPIO. + +Required properties: +- compatible : should include "linux,usb-conn-gpio" and "usb-b-connector". +- id-gpios, vbus-gpios : input gpios, either one of them must be present, + and both can be present as well. + see connector/usb-connector.txt + +Optional properties: +- vbus-supply : can be present if needed when supports dual role mode. + see connector/usb-connector.txt + +- Sub-nodes: + - port : can be present. + see graph.txt + +Example: + +&mtu3 { + connector { + compatible = "linux,usb-conn-gpio", "usb-b-connector"; + label = "micro-USB"; + type = "micro"; + id-gpios = <&pio 12 GPIO_ACTIVE_HIGH>; + vbus-supply = <&usb_p0_vbus>; + }; +};