From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754192AbbIGJjQ (ORCPT ); Mon, 7 Sep 2015 05:39:16 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:56443 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751489AbbIGJjN (ORCPT ); Mon, 7 Sep 2015 05:39:13 -0400 Subject: Re: [PATCH v4 1/9] usb: dwc3: add dual-role support To: Peter Chen References: <1441203864-15786-1-git-send-email-rogerq@ti.com> <1441203864-15786-2-git-send-email-rogerq@ti.com> <20150906020240.GB4914@shlinux2> CC: , , , , , , , From: Roger Quadros Message-ID: <55ED5B39.8070407@ti.com> Date: Mon, 7 Sep 2015 12:39:05 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150906020240.GB4914@shlinux2> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter, On 06/09/15 05:02, Peter Chen wrote: > On Wed, Sep 02, 2015 at 05:24:16PM +0300, Roger Quadros wrote: >> Register with the USB OTG core. Since we don't support >> OTG yet we just work as a dual-role device even >> if device tree says "otg". >> >> + >> +static int dwc3_drd_init(struct dwc3 *dwc) >> +{ >> + int ret, id, vbus; >> + struct usb_otg_caps *otgcaps = &dwc->otg_config.otg_caps; >> + >> + otgcaps->otg_rev = 0; >> + otgcaps->hnp_support = false; >> + otgcaps->srp_support = false; >> + otgcaps->adp_support = false; >> + dwc->otg_config.fsm_ops = &dwc3_drd_ops; >> + >> + if (!dwc->edev) { >> + dev_err(dwc->dev, "No extcon device found for OTG mode\n"); >> + return -ENODEV; >> + } >> + > > Do All dwc3 platforms id/vbus need to get through extcon? Do the > SoCs have id/vbus pin? > > Extcon access is in fact not needed from dwc3 driver and I will be getting rid of this patch. We will support dual-role only via the OTG irq as in patch 5. The way it works is that the OMAP glue layer dwc3-omap.c requests extcon device and sets some mailbox register and this causes the VBUS/ID events to come over OTG irq/status. So this patch is redundant. The extcon device is not needed for all TI platforms. e.g. we need it for DRA7 but not for AM437x. cheers, -roger