Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4562161yba; Mon, 29 Apr 2019 23:59:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2MDWrlqS+t5OM0VwdRHRd/b2EPjfKt6M86iLDPJKQIkrtlDGWECxCbMB8ykB5RbnPrGQE X-Received: by 2002:a63:4b20:: with SMTP id y32mr64557051pga.244.1556607589663; Mon, 29 Apr 2019 23:59:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556607589; cv=none; d=google.com; s=arc-20160816; b=GA0Rfyoz3iGXP/r5fegxf60Ze//oiqpEQTQ7sB1T9Uwl6HEEuky8gTBC+cMSXGuRf5 4vijbodbxdpupiIsA8UCRz9DrDDGN2vE/a9QE0yHanNoiWlXzCHNjUPH6slnDHftG1Zu 5Ay2Mi37zMFcCQqzi8a4BAwl/wawrp0GxpI3j7PiPGXZ2rIyBeskIOS6XN+MOsjWPNZQ 7uDfp28JQMQT07uBpwE5Iv3Qp5p+DxpkH0ToWaQiKeT0OdqIRxzmm4sNCqH6zGW5j5Zs rnKyu8mm+SimR2qkc5dk/KuKsaa66TUH4bPlVAA5LDDsg0N/0Me4XIF79m9Cx3IxE8OD qCTg== 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=4h4Did5up/xuwDxb46xY6orR1gfd78+TO4al1/SkEUk=; b=n5zoo/NWd6Ov/DY7X0XjPYAJYkBB1xVElkNZC+zl1rTfSEv+lC8V/4bi6DpZetMoO2 sV7zRFWsV3tfu5HI9WvHplkpmjrpo1XxmGQg/TraD8OAflD2PGXJ3NvGw60JrFnx1aeL h7lCrTOTR5lTqBcwgYdl+gnbnyS2orIZMiDQjsZt2PJOMBd5YYi+BB9JX1+X2IgZP5JF 9KIMQbBMwSadjkLVnqs1emR6YQzlwfwzDw4iBq9o4RTrto+0XE9OkJRzeuQ9/TWbFRg4 fxiiPMrklx+dHbC98uGeW2gGEcinaHWuNz5weHfet0rNa94kGQaMWcvOIwPqzBuz9I8I jsoA== 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 z4si13221980pln.354.2019.04.29.23.59.34; Mon, 29 Apr 2019 23:59:49 -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 S1726419AbfD3G5o (ORCPT + 99 others); Tue, 30 Apr 2019 02:57:44 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:8461 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725554AbfD3G5o (ORCPT ); Tue, 30 Apr 2019 02:57:44 -0400 X-UUID: 2d217474e79a4b76987e911cdbe6e632-20190430 X-UUID: 2d217474e79a4b76987e911cdbe6e632-20190430 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1809240108; Tue, 30 Apr 2019 14:57:39 +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; Tue, 30 Apr 2019 14:57:37 +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; Tue, 30 Apr 2019 14:57:37 +0800 Message-ID: <1556607457.10179.259.camel@mhfsdcap03> Subject: Re: [PATCH v4 3/6] dt-bindings: usb: mtu3: add properties about USB Role Switch 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 , , "linux-kernel@vger.kernel.org" , "Linux USB List" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "moderated list:ARM/Mediatek SoC support" , "Biju Das" , Linus Walleij Date: Tue, 30 Apr 2019 14:57:37 +0800 In-Reply-To: References: <1556261237-13823-1-git-send-email-chunfeng.yun@mediatek.com> <1556261237-13823-4-git-send-email-chunfeng.yun@mediatek.com> <20190426204906.GB15074@bogus> <1556453788.10179.224.camel@mhfsdcap03> 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 Mon, 2019-04-29 at 11:25 -0500, Rob Herring wrote: > On Sun, Apr 28, 2019 at 7:16 AM Chunfeng Yun wrote: > > > > On Fri, 2019-04-26 at 15:49 -0500, Rob Herring wrote: > > > On Fri, Apr 26, 2019 at 02:47:14PM +0800, Chunfeng Yun wrote: > > > > Now the USB Role Switch is supported, so add properties about it > > > > > > > > Signed-off-by: Chunfeng Yun > > > > --- > > > > v4: no changes > > > > v3: no changes > > > > > > > > v2 changes: > > > > 1. fix typo > > > > 2. refer new binding about connector property > > > > --- > > > > .../devicetree/bindings/usb/mediatek,mtu3.txt | 10 ++++++++-- > > > > 1 file changed, 8 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt b/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt > > > > index 3382b5cb471d..6e004c4a89af 100644 > > > > --- a/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt > > > > +++ b/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt > > > > @@ -27,7 +27,9 @@ Optional properties: > > > > - ranges : allows valid 1:1 translation between child's address space and > > > > parent's address space > > > > - extcon : external connector for vbus and idpin changes detection, needed > > > > - when supports dual-role mode. > > > > + when supports dual-role mode; it's consiedered valid for compatibility > > > > + reasons, and not allowed for new bindings, use the property > > > > + usb-role-switch instead. > > > > - vbus-supply : reference to the VBUS regulator, needed when supports > > > > dual-role mode. > > > > - pinctrl-names : a pinctrl state named "default" is optional, and need be > > > > @@ -36,7 +38,8 @@ Optional properties: > > > > is not set. > > > > - pinctrl-0 : pin control group > > > > See: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt > > > > - > > > > + - usb-role-switch : use USB Role Switch to support dual-role switch, but > > > > + not extcon > > > > > > Coordinate with the Renesas and HiSilicon folks implementing the same > > > thing and put this in a common spot. > > I'll prepare a patch for it, and CC Biju and Yu > > > > > However, I think this should not > > > even be needed as knowing the controller capabilities (based on the > > > compatible) and knowing the type of connector should be enough > > > information to tell you if dual role is supported or not. > > Some Dual-Role controller drivers already used extcon framework to > > handle role switch, if try to support the new USB Role Switch framework, > > the driver may want to know which way will be used. > > Wouldn't it know by presence of 'extcon' property or not? non-presence of 'extcon' doesn't mean the driver need USB Role Switch, e.g. support manual role switch decided by user, of course, we can check some cases and then decide whether need USB Role Switch or not, maybe provide a property will make it easier. > > > Sometimes users also want to use dual-role even use the type-A, such as > > use sys interface to handle role switch, so only knowing the connector > > type can't tell driver which way to use > > That use case doesn't sound like something that should be in DT > though. That would be possible for any controller that supports > dual-role. I give manual role switch by sysfs interface a higher priority than other ways, if manual switch is enabled, e.g. 'extcon' will be ignored. this may be different from other USB dual-role controller drivers. > Though perhaps that requires some specific Vbus wiring? Or > a cable with Vbus disconnected. Yes, some projects use PMIC or Charger to detect Vbus, but some don't have Vbus detection circuit, and some even don't provide vbus pin > Either way, doesn't sound USB compliant. Yes, it's more related with customer usage, or cost down, anyway, it's better to support cases as many as possible. > > Rob