[PATCH 4/4] omap: musb: introduce default baord config

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Apr 28 12:28:20 EDT 2011


On Thu, Apr 28, 2011 at 12:21:47PM -0400, Oleg Drokin wrote:
> Frankly, I am not even sure why the mode needs to be supplied by the board at all.
> The musb code already  has a very similar switch in musb_plat and so it totally looks like
> a duplicated specification of the same thing from the board file and from
> generic musb code where the original init value is then ignored.
> 
> I see that in .29 the board file did not need to specify usb mode and it was all decided
> in musb-specific code, and I have no idea why that was later changed to the way it is now.
> 
> Would it just be better if a patch removing mode field from struct omap_musb_board_data
> is adopted like this (warning - not a real patch)?

Hmm, it looks to me like we're ending up with two layers on top of
each other, both trying to provide some kind of generic board interface.

I think they should be squashed together.  And that:

static struct musb_hdrc_platform_data musb_plat = {
#ifdef CONFIG_USB_MUSB_OTG
        .mode           = MUSB_OTG,
#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
        .mode           = MUSB_HOST,
#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
        .mode           = MUSB_PERIPHERAL,
#endif

in usb-musb.c needs the same treatment as I mentioned in the previous
message if it really is board specific.  If not, I see no reason why
the above can't go into the musb driver itself.



More information about the linux-arm-kernel mailing list