Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752942AbcDSIWO (ORCPT ); Tue, 19 Apr 2016 04:22:14 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:35013 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751237AbcDSIWL (ORCPT ); Tue, 19 Apr 2016 04:22:11 -0400 Date: Tue, 19 Apr 2016 16:14:46 +0800 From: Peter Chen To: Roger Quadros Cc: stern@rowland.harvard.edu, balbi@kernel.org, gregkh@linuxfoundation.org, peter.chen@freescale.com, dan.j.williams@intel.com, jun.li@freescale.com, mathias.nyman@linux.intel.com, tony@atomide.com, Joao.Pinto@synopsys.com, abrestic@chromium.org, r.baldyga@samsung.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: Re: [PATCH v6 08/12] usb: hcd: Adapt to OTG core Message-ID: <20160419081446.GA15789@shlinux2.ap.freescale.net> References: <1459865117-7032-1-git-send-email-rogerq@ti.com> <1459865117-7032-9-git-send-email-rogerq@ti.com> <20160418062937.GA4477@shlinux2.ap.freescale.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160418062937.GA4477@shlinux2.ap.freescale.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2528 Lines: 77 On Mon, Apr 18, 2016 at 02:29:37PM +0800, Peter Chen wrote: > On Tue, Apr 05, 2016 at 05:05:13PM +0300, Roger Quadros wrote: > > Introduce usb_otg_add/remove_hcd() for use by host > > controllers that are part of OTG/dual-role port. > > > > Non Device tree platforms can use the otg_dev argument > > to specify the OTG controller device. If otg_dev is NULL > > then the device tree node's otg-controller property is used to > > get the otg_dev device. > > > > Signed-off-by: Roger Quadros > > --- > > drivers/usb/core/hcd.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ > > include/linux/usb/hcd.h | 4 +++ > > 2 files changed, 75 insertions(+) > > > > diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c > > index 6b1930d..6a80193 100644 > > --- a/drivers/usb/core/hcd.c > > +++ b/drivers/usb/core/hcd.c > > @@ -46,6 +46,10 @@ > > #include > > #include > > #include > > +#include > > + > > +#include > > +#include > > > > #include "usb.h" > > > > @@ -3013,6 +3017,73 @@ void usb_remove_hcd(struct usb_hcd *hcd) > > } > > EXPORT_SYMBOL_GPL(usb_remove_hcd); > > > > + > > +static struct otg_hcd_ops otg_hcd_intf = { > > + .add = usb_add_hcd, > > + .remove = usb_remove_hcd, > > + .usb_bus_start_enum = usb_bus_start_enum, > > + .usb_control_msg = usb_control_msg, > > + .usb_hub_find_child = usb_hub_find_child, > > +}; > > + > > +/** > > + * usb_otg_add_hcd - Register the HCD with OTG core. > > + * @hcd: the usb_hcd structure to initialize > > + * @irqnum: Interrupt line to allocate > > + * @irqflags: Interrupt type flags > > + * @otg_dev: OTG controller device manging this HCD > > %s/manging/managing > > > + * > > + * Registers the HCD with OTG core. OTG core will call usb_add_hcd() > > + * or usb_remove_hcd() as necessary. > > + * If otg_dev is NULL then device tree node is checked for OTG > > + * controller device via the otg-controller property. > > + */ > > +int usb_otg_add_hcd(struct usb_hcd *hcd, > > + unsigned int irqnum, unsigned long irqflags, > > + struct device *otg_dev) > > +{ > > Some users may not want to use default otg_hcd_ops, would you please > add one more parameter (eg, hcd_ops) for that? If hcd_ops is NULL, just > use the default one. > I forgot there is .start_host at otg fsm API when reviewing, so it is ok to have a unified hcd_ops, the user can do platform things at fsm.start_host. -- Best Regards, Peter Chen