Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2250536yba; Sat, 27 Apr 2019 18:54:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzteQqNyWvoT+uOgmY1HPBXPGBgjjdFx/Cr7zKI98l3SnGtxKRxKFQzVFpZBK/BmYQIOKUb X-Received: by 2002:a63:5d46:: with SMTP id o6mr16982172pgm.217.1556416484124; Sat, 27 Apr 2019 18:54:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556416484; cv=none; d=google.com; s=arc-20160816; b=ibexjDhkf2LL12yhqK5kc1ccEImO1bXrCgYzXB4NtXUM2xWp0idr4nHpc+4wg9N8No ejfcSQzDlxLatsUzyZTjywPi4GH45dXrW5wk4BveJsglzFeUGCAfGPKoiAN3gzeU3oge mL6PFReH7w65Opay0DEHYM52aUfdwFXXoy2sDpl+SKoRw7OnllwyaBg8Wua4hn+zZs6h IFqNIdVVNw5eIgQz+RfR2THfdsL64tMlP5A5dQIS7NmHP1GT4l3mE9AiV2K4006Ao8XC fAQTS+tIU9QQCs2ggiWdYWHjqwiQYF7YovSUqws15LIIwi6pl0vLNCvRy6x2lOvzGkX2 FsAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=bd889oFMzTqIBdYCTbomeDQBlH4wT/qpL3V/OtJZNSU=; b=pDuBB/VScazSg90e6WidnShQexiOljeRkYcaLhnzJpXP12ChycaCq0VefpLzkadhmg q5k/6ASze4s2mG08HVGLsv2jMV3zAN2LEWkw+E3AacFvkVDymz+4FN7k6B5G0lEuAkv2 QOObhpsTYS3MIKid6g6Cp+ikwyTQ+mZiA3s1HhPMI4dN/wyv2sbHSZdjgXexQ8YIoYOT ieobncxxPneEt5KwAL55eh97Ab5nDA8LqSz5piqC0KjiL+pa/QcKuWfm5MRNnGljfe8G tB+FROQPtOaIgYJBasZnjA3AFZrThbCqvOP0DwJn5pyv2SDh1nuDrIS23t2cFa6a5Cpe kSrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j11si1736223plb.302.2019.04.27.18.54.29; Sat, 27 Apr 2019 18:54:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726437AbfD1BvP (ORCPT + 99 others); Sat, 27 Apr 2019 21:51:15 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:59742 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726079AbfD1BvP (ORCPT ); Sat, 27 Apr 2019 21:51:15 -0400 X-UUID: ec47beeade304b68bf8a4019606d20b4-20190428 X-UUID: ec47beeade304b68bf8a4019606d20b4-20190428 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 370585049; Sun, 28 Apr 2019 09:51:00 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sun, 28 Apr 2019 09:50:58 +0800 Received: from [10.17.3.153] (172.27.4.253) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Sun, 28 Apr 2019 09:50:57 +0800 Message-ID: <1556416257.10179.210.camel@mhfsdcap03> Subject: Re: [PATCH v4 2/6] dt-bindings: usb: add binding for Type-B GPIO connector driver From: Chunfeng Yun To: Rob Herring CC: Greg Kroah-Hartman , Heikki Krogerus , Mark Rutland , Matthias Brugger , Adam Thomson , Li Jun , "Badhri Jagan Sridharan" , Hans de Goede , Andy Shevchenko , Min Guo , , , , , , Biju Das , Linus Walleij Date: Sun, 28 Apr 2019 09:50:57 +0800 In-Reply-To: <20190426204537.GA15074@bogus> References: <1556261237-13823-1-git-send-email-chunfeng.yun@mediatek.com> <1556261237-13823-3-git-send-email-chunfeng.yun@mediatek.com> <20190426204537.GA15074@bogus> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-04-26 at 15:45 -0500, Rob Herring wrote: > On Fri, Apr 26, 2019 at 02:47:13PM +0800, Chunfeng Yun wrote: > > 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 > > --- > > 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 | 49 +++++++++++++++++++ > > 1 file changed, 49 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..d2e1c4e01b6d > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/usb/typeb-conn-gpio.txt > > @@ -0,0 +1,49 @@ > > +USB Type-B GPIO Connector > > + > > +This is a virtual device used to switch dual role mode from the USB ID pin > > +connected to an input GPIO pin. > > + > > +Required properties: > > +- compatible : Should be "linux,typeb-conn-gpio" > > There's no need for this virtual node. The USB host or device driver can > instantiate a connector driver by walking the OF graph to the connector > and creating a device. Got it. > > > + > > +Sub-nodes: > > +- connector : should be present. > > + - compatible : should be "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. > > + see connector/usb-connector.txt > > + > > +- port : should be present. > > + see graph.txt > > + > > +Example: > > + > > +rsw_iddig: role_sw_iddig { > > + compatible = "linux,typeb-conn-gpio"; > > + status = "okay"; > > + > > + connector { > > + compatible = "usb-b-connector"; > > + label = "micro-USB"; > > + type = "micro"; > > + id-gpios = <&pio 12 GPIO_ACTIVE_HIGH>; > > + vbus-supply = <&usb_p0_vbus>; > > + }; > > + > > + port { > > Humm, same mistake as Hikey patches... > > This goes under the connector node as defined in the connector binding. Ok, will fix it. Thanks a lot. > > > + bconn_ep: endpoint@0 { > > + remote-endpoint = <&usb_role_sw>; > > + }; > > + }; > > +}; > > + > > +&mtu3 { > > + status = "okay"; > > + > > + port { > > + usb_role_sw: endpoint@0 { > > + remote-endpoint = <&bconn_ep>; > > + }; > > + }; > > +}; > > -- > > 2.21.0 > >