public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roland Stigge <stigge@antcom.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	w.sang@pengutronix.de, kevin.wells@nxp.com,
	linux-arm-kernel@lists.infradead.org, arm@kernel.org,
	srinivas.bakki@nxp.com
Subject: Re: [PATCH] USB: gadget driver for LPC32xx
Date: Mon, 19 Mar 2012 23:26:21 +0100	[thread overview]
Message-ID: <4F67B28D.3060500@antcom.de> (raw)
In-Reply-To: <201203192130.13583.arnd@arndb.de>

Hi Arnd,

On 19/03/12 22:30, Arnd Bergmann wrote:
> There is already a driver for the isp1301 otg part in the kernel, I don't
> think we want to add another one.
> 
> From what I can tell, this shares a common ancestry with the omap version
> but has diverged quite a bit. The best solution would really be to
> bring the two back together and let them share a common base driver,
> with the lpc32xx and omap specific bits in another file.

Yes, it's a good idea to share code where possible and consolidate into
one driver.

Please consider:

The LPC32xx driver is actually using only 3 functions via isp1301:

isp1301_udc_configure()
isp1301_set_powerstate()
isp1301_pullup_set()

The first of those is LPC32xx specific. The power setting function is
also done differently in isp1301_omap's power_up()/power_down() ("board
specific"). For the pullups, there is not (yet?) a dedicated API in the
OMAP driver, but it's really only two small I2C commands.

Are you still sure it's worth it to use a common driver when there is
hardly shared code?

Maybe the right thing is a common low-level isp1301 interface defining
all the registers and providing low-level (I2C) access functions,
leaving all the "higher level"/"board specific" functions up to the
existing drivers?

(I guess you meant drivers/usb/otg/isp1301_omap.c ?)

Thanks in advance,

Roland

  reply	other threads:[~2012-03-19 22:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-19 21:18 [PATCH] USB: gadget driver for LPC32xx Roland Stigge
2012-03-19 21:30 ` Arnd Bergmann
2012-03-19 22:26   ` Roland Stigge [this message]
2012-03-20 13:01     ` Arnd Bergmann
2012-03-20 18:20       ` Roland Stigge
2012-03-20 19:21         ` Arnd Bergmann
2012-03-20  1:56 ` Alan Stern
2012-03-23  8:38 ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F67B28D.3060500@antcom.de \
    --to=stigge@antcom.de \
    --cc=arm@kernel.org \
    --cc=arnd@arndb.de \
    --cc=kevin.wells@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=srinivas.bakki@nxp.com \
    --cc=w.sang@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox