From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EAB2C04AB4 for ; Tue, 14 May 2019 18:12:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0324420850 for ; Tue, 14 May 2019 18:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557857545; bh=1u+0RIP502cOVMKpSszyvWip+tJgxs7ndfhRdjVwHHw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=BOErzMeLADmT97LlhWGpctE2pqWWPo+nnC9hxrG7euSRZksQm1EGrJnObSwq3KszN tcyi8Q7aVAjNAPFZEZRysD4/lmpdLYiQsI1aY18POs+InsfJ2E8lIGDpH/FBhINvyO B8EcDTp0OERK9FWGLbZzxGZ8Ryh5mXNO2AyI3ZOg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727515AbfENSMY (ORCPT ); Tue, 14 May 2019 14:12:24 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:35891 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbfENSMY (ORCPT ); Tue, 14 May 2019 14:12:24 -0400 Received: by mail-oi1-f195.google.com with SMTP id l203so12878795oia.3; Tue, 14 May 2019 11:12:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7MKXOx72GnJK4OThTbg/Yq9n8A27D1pwO48w3mZxGik=; b=TfDtCCNmcVJ7WXWPI4ZxFdlwO0Mhu9x3wjKHn1IdQCdY9mHw24ZvvuEItFjyHyZpu2 VVaz36e+vJPBfZPmbsEm41Coi/JjA4va/p9o0kvrggHc2zBWGDWLX/HBSSPbeqVTEGDU mmMoH/38v1RUoxJGrxyn7NPQKxi+XI6brkd5mAVEiudZ6sx/eplCH0Uf5wFpUPHxv1bx 0hk6ZGy5qnlOI19/ytIrXV3KXZfKZQxz62xmm+92AAPdqeizcpWBMw39O6+iGuHjYqbf jo5CP/qANtYYfvhexUdugkb9gbz68cThPWwAvxcQuEDgJ9O0HwqtCxFtu9cRngMYQIEY ERgw== X-Gm-Message-State: APjAAAUOd5gcSGnSDvtXoXis3wg37CD0iZXveg3378RV4K81JXWuIj8M eFNwkcTNwxB2d8YJL7Tiww== X-Google-Smtp-Source: APXvYqy19Xjq9sGP3TMfrsYa+PbNh1BafjhPi5bE6IL4JiP7WIz0dF4SnI69FmgshwGuUtHZQI4Byg== X-Received: by 2002:aca:5d86:: with SMTP id r128mr3690918oib.135.1557857542852; Tue, 14 May 2019 11:12:22 -0700 (PDT) Received: from localhost (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id q25sm6355192otl.60.2019.05.14.11.12.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 11:12:22 -0700 (PDT) Date: Tue, 14 May 2019 13:12:04 -0500 From: Rob Herring To: Chunfeng Yun Cc: Greg Kroah-Hartman , Heikki Krogerus , Mark Rutland , Matthias Brugger , Adam Thomson , Li Jun , Badhri Jagan Sridharan , Hans de Goede , Andy Shevchenko , Min Guo , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Biju Das , Linus Walleij Subject: Re: [PATCH v5 2/6] dt-bindings: usb: add binding for Type-B GPIO connector driver Message-ID: <20190514181204.GA13949@bogus> References: <1557823643-8616-1-git-send-email-chunfeng.yun@mediatek.com> <1557823643-8616-3-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1557823643-8616-3-git-send-email-chunfeng.yun@mediatek.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 14, 2019 at 04:47:19PM +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 > --- > 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". I don't think we need "linux,typeb-conn-gpio". A driver can decide to handle GPIO lines if they present or we assume the parent device handles ID and/or Vbus if they are not present. > +- id-gpios, vbus-gpios : either one of them must be present, and both > + can be present as well. Please clarify that vbus-gpios is an input to sense Vbus presence as an output it should be modelled as a regulator only. These should be added to usb-connector.txt. The result of all this is you don't need this file. Just additions to usb-connector.txt. > +- 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"; Don't show status in examples. > + > + 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>; > + }; > + }; When the host controller is the parent of the connector, you don't need the graph unless you're describing the alternate modes in Type-C. > +}; > -- > 2.21.0 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88CE8C04AB4 for ; Tue, 14 May 2019 18:12:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 60DBF20879 for ; Tue, 14 May 2019 18:12:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nVzKeUnK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 60DBF20879 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bPl2V7u24CDYW8HLiezyowwPDTihJMbChTlPYLz/7qI=; b=nVzKeUnKMNQSkx AewBNQlBqwHsX8EXlR3B8wLZgLWB4loh5iDK7CANPqU/YZqy35MRhmo7zkuFkj75ktJE55t6A6mfw is0CzlgWJtvEbS42W1TeUEcUxLqEPNe1dy7YdhVkIYYmYwKuMZcgtry4gehkiEy1ocka0629lZMAe HPQ4O/PMW0bKhvnPZbHm+l6usBzwMAn+0UjWaeh7oqTGVJ2K1UnSYK7uP7Cj8Xsk0sWuDAoB2ywRA Ovw2VY1eKWP9teosv23Jr1EQv4k3C/BgAr4E4jQSaiA3Lhxo7nWiij2ot4j7LXRa2ncmhlLeHtTHV g644czO+a97r14RRZY1Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQbuf-0005Zq-Ss; Tue, 14 May 2019 18:12:29 +0000 Received: from mail-oi1-f194.google.com ([209.85.167.194]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQbuc-0005Yu-5T; Tue, 14 May 2019 18:12:27 +0000 Received: by mail-oi1-f194.google.com with SMTP id w144so7341182oie.12; Tue, 14 May 2019 11:12:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7MKXOx72GnJK4OThTbg/Yq9n8A27D1pwO48w3mZxGik=; b=bsjX3qmZCqxun82DSBfzFC+DVY/yiWI1RjI+Fi14mbr+BkyCV1ILxYR0B6tS+wuluY q4F9FUv95N8b0XScGNRr6rD/5SdxNpr9FxTc9NX547JftTBsINhAUQP6zT3yWnMnQudD twW3cOMtJ96OYjU/G3m5PXL0GZ/dR4XMO1mamdYhgYOVugTBF2NozfqGeZhBr8+rEQV1 fraKfB2LWYTT75ollopHqj6nmhCJRUxDQjgOQxOZLZTo0PixBJUdSYaK4sHO+YtWm+hd Ljfpf6gdxK9yknUl9ocV7mEYqbrfOquBSW9VjTe2iDfYfI/OXvozeGl6yziL5MNEY/2J 7utg== X-Gm-Message-State: APjAAAV/JDdumaIdo5SV52hDclZEmgHbyCkGPo9CZkK86+rMKVpjiPoz HdZIp+ZRrFDCk+UKSsQfDSJdbLM= X-Google-Smtp-Source: APXvYqy19Xjq9sGP3TMfrsYa+PbNh1BafjhPi5bE6IL4JiP7WIz0dF4SnI69FmgshwGuUtHZQI4Byg== X-Received: by 2002:aca:5d86:: with SMTP id r128mr3690918oib.135.1557857542852; Tue, 14 May 2019 11:12:22 -0700 (PDT) Received: from localhost (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id q25sm6355192otl.60.2019.05.14.11.12.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 11:12:22 -0700 (PDT) Date: Tue, 14 May 2019 13:12:04 -0500 From: Rob Herring To: Chunfeng Yun Subject: Re: [PATCH v5 2/6] dt-bindings: usb: add binding for Type-B GPIO connector driver Message-ID: <20190514181204.GA13949@bogus> References: <1557823643-8616-1-git-send-email-chunfeng.yun@mediatek.com> <1557823643-8616-3-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1557823643-8616-3-git-send-email-chunfeng.yun@mediatek.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190514_111226_222365_64D2870B X-CRM114-Status: GOOD ( 20.85 ) 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: Mark Rutland , devicetree@vger.kernel.org, Heikki Krogerus , Hans de Goede , Greg Kroah-Hartman , Linus Walleij , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Biju Das , Badhri Jagan Sridharan , Andy Shevchenko , linux-mediatek@lists.infradead.org, Min Guo , Matthias Brugger , Adam Thomson , linux-arm-kernel@lists.infradead.org, Li Jun Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 14, 2019 at 04:47:19PM +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 > --- > 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". I don't think we need "linux,typeb-conn-gpio". A driver can decide to handle GPIO lines if they present or we assume the parent device handles ID and/or Vbus if they are not present. > +- id-gpios, vbus-gpios : either one of them must be present, and both > + can be present as well. Please clarify that vbus-gpios is an input to sense Vbus presence as an output it should be modelled as a regulator only. These should be added to usb-connector.txt. The result of all this is you don't need this file. Just additions to usb-connector.txt. > +- 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"; Don't show status in examples. > + > + 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>; > + }; > + }; When the host controller is the parent of the connector, you don't need the graph unless you're describing the alternate modes in Type-C. > +}; > -- > 2.21.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel