From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751610AbdBYDuu (ORCPT ); Fri, 24 Feb 2017 22:50:50 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:35044 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751484AbdBYDus (ORCPT ); Fri, 24 Feb 2017 22:50:48 -0500 MIME-Version: 1.0 Reply-To: cwchoi00@gmail.com In-Reply-To: References: <1487250377-13653-1-git-send-email-rogerq@ti.com> <1487250377-13653-5-git-send-email-rogerq@ti.com> <53cc4807-84fc-5d26-c7a9-b9efd95eedb4@codeaurora.org> <0bbded50-390c-40a5-730c-24779a607500@ti.com> From: Chanwoo Choi Date: Sat, 25 Feb 2017 12:50:03 +0900 Message-ID: Subject: Re: [PATCH v2 4/4] usb: dwc3: Workaround for super-speed host on dra7 in dual-role mode To: Roger Quadros Cc: Vivek Gautam , balbi@kernel.org, Chanwoo Choi , linux-usb@vger.kernel.org, linux-kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2017-02-25 12:46 GMT+09:00 Chanwoo Choi : > Hi, > > 2017-02-24 21:02 GMT+09:00 Roger Quadros : >> +Chanwoo >> >> Hi Vivek, >> >> On 23/02/17 10:34, Vivek Gautam wrote: >>> >>> >>> On 02/16/2017 06:36 PM, Roger Quadros wrote: >>>> dra7 OTG core limits the host controller to USB2.0 (high-speed) mode >>>> when we're operating in dual-role. >>>> >>>> We work around that by bypassing the OTG core and reading the >>>> extcon framework directly for ID/VBUS events. >>>> >>>> Signed-off-by: Roger Quadros >>>> --- >>>> Documentation/devicetree/bindings/usb/dwc3.txt | 2 + >>>> drivers/usb/dwc3/core.c | 169 ++++++++++++++++++++++++- >>>> drivers/usb/dwc3/core.h | 5 + >>>> 3 files changed, 170 insertions(+), 6 deletions(-) >>>> >>>> diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt >>>> index e3e6983..9955c0d 100644 >>>> --- a/Documentation/devicetree/bindings/usb/dwc3.txt >>>> +++ b/Documentation/devicetree/bindings/usb/dwc3.txt >>>> @@ -53,6 +53,8 @@ Optional properties: >>>> - snps,quirk-frame-length-adjustment: Value for GFLADJ_30MHZ field of GFLADJ >>>> register for post-silicon frame length adjustment when the >>>> fladj_30mhz_sdbnd signal is invalid or incorrect. >>>> + - extcon: phandle to the USB connector extcon device. If present, extcon >>>> + device will be used to get USB cable events instead of OTG controller. >>>> - tx-fifo-resize: determines if the FIFO *has* to be reallocated. >>>> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c >>>> index 619fa7c..b02d911 100644 >>>> --- a/drivers/usb/dwc3/core.c >>>> +++ b/drivers/usb/dwc3/core.c >>> >>> [snip] >>> >>>> @@ -1587,6 +1727,14 @@ static int dwc3_probe(struct platform_device *pdev) >>>> dwc3_get_properties(dwc); >>>> + if (dev->of_node) { >>>> + if (of_property_read_bool(dev->of_node, "extcon")) >>>> + dwc->edev = extcon_get_edev_by_phandle(dev, 0); >>> >>> Don't we want separate edev's for vbus and id ? >>> One can have separate pins connected to them and in that case >>> we can't get the events out of one pin only. >> >> Is such kind of hardware really there? Ideally one extcon device >> represents one connector. So VBUS and ID events of a single USB >> port should come on one extcon device. >> If it doesn't then you need to fix your platforms extcon driver >> so that it does. >> Chanwoo can correct me if I'm wrong on this understanding. >> >> Currently, if VBUS and ID come on GPIOs the extcon-usb-gpio driver >> takes care of both. > > Basically, one extcon device driver can support the multiple > external connectors if the detection h/w or port is same. > > One extcon device with extcon-usb-gpio.c can support the detection > of both ID and VBUS. > > But, if there is any issue of h/w schematic, we need to consider > how to use the extcon device. Additionally, the extcon-usb-gpio.c use the two gpio pins to detect both ID and VBUS pins. We can check it on documentation[1] of extcon-usb-gpio driver. [1] https://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/tree/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt -- Best Regards, Chanwoo Choi Samsung Electronics