From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wolverine01.qualcomm.com ([199.106.114.254]:20710 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751875Ab0KJCNH (ORCPT ); Tue, 9 Nov 2010 21:13:07 -0500 Date: Wed, 10 Nov 2010 07:42:59 +0530 From: Pavan Kondeti Subject: Re: [PATCH v2] USB: Add MSM USB Device Controller driver Message-ID: <20101110021259.GA16558@codeaurora.org> References: <1289301494-26150-1-git-send-email-pkondeti@codeaurora.org> <1289301494-26150-2-git-send-email-pkondeti@codeaurora.org> <4CD93321.4040106@parrot.com> <20101109121607.GA30807@codeaurora.org> <4CD94E79.1050104@parrot.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4CD94E79.1050104@parrot.com> Sender: linux-arm-msm-owner@vger.kernel.org List-ID: To: Matthieu CASTET Cc: "greg@kroah.com" , "linux-usb@vger.kernel.org" , "linux-arm-msm@vger.kernel.org" , Mike Lockwood , Brian Swetland On Tue, Nov 09, 2010 at 02:36:57PM +0100, Matthieu CASTET wrote: > Hi Pavan, > > Pavan Kondeti a écrit : >> On Tue, Nov 09, 2010 at 12:40:17PM +0100, Matthieu CASTET wrote: >> >> Hi Matthieu, >> >>>> >>> This look like the arc/chipidea/mips ehci otg core. >> >> Yes. It is chipidea core for ARM. >>> Why can't you reuse the ci13xxx_udc.c driver ? >>> Or if ci13xxx_udc.c is too bad, rewrite a new generic version for this core. >>> >> ci13xxx_udc.c driver registers with PCI subsytem (ours is a platform subsystem), >> does not manage clocks. msm72k_udc.c also takes care of initializing the >> integrated PHY. We also need to program special registers (MSM-ARM specific) >> upon resetting the hardware. > Yes, but why not adding this to ci13xxx_udc.c instead of doing a new driver. > For example adding platform subsystem is less than 150 lines of code. I agree. > > I am not sure doing n drivers for a same hardware is a good idea. > > May be ci13xxx_udc.c isn't enough generic, but in this case don't do the > same mistake with the new driver. > Sure. Thanks for the advice. > Make a generic core, and make the ulpi stuff (or other specific stuff) > in a glue around this code. > IMHO, generic core should handle the controller stuff (endpoint operations, interrupts processing etc...) and leave the transceiver interaction to the individual device controller driver. > Look at host ehci : you don't need to rewrite ehci core. You only add a > glue around it. > Thanks for pointing to EHCI. ehci-hcd can support PCI/platform/PS3 buses. It takes care of most of the things and yet gives flexibility to HCD to implement their own methods. I will hack ci13xxx_udc.c (platform bus support) and see how it goes. If it works, I will see how ci13xxx_ stuff can be reused efficiently. -- Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.