Thread (29 messages) 29 messages, 7 authors, 2011-05-04
STALE5552d
Revisions (7)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v1 [diff vs current]
  4. v1 [diff vs current]
  5. v1 [diff vs current]
  6. v1 current
  7. v1 [diff vs current]

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

From: Oleg Drokin <hidden>
Date: 2011-04-28 16:21:47
Also in: linux-omap
Subsystem: arm port, omap usb support, omap2+ support, the rest · Maintainers: Russell King, Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros, Tony Lindgren, Linus Torvalds

Hello!

On Apr 28, 2011, at 10:18 AM, Russell King - ARM Linux wrote:
quoted
quoted
-void __init usb_musb_init(struct omap_musb_board_data *board_data)
+static struct omap_musb_board_data musb_default_board_data = {
+	.interface_type		= MUSB_INTERFACE_ULPI,
+	.mode			= MUSB_OTG,
In fact can you make it more generic with ifdefs like this?
(since there are tons of boards taht are client only or would like to be compiled in some other way):

+#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
If this is something that's desired, then it should not be done via ifdefs
but by platforms passing the mode argument into an initialization function.
Eventually, when we switch to some DT like system, this is the kind of
information that would be obtained from DT, and identifying this stuff
now will help when DT stuff comes along.
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)?
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 35559f7..c7f834f 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -129,7 +129,6 @@ void __init usb_musb_init(struct omap_musb_board_data *board
        musb_plat.clock = "ick";
        musb_plat.board_data = board_data;
        musb_plat.power = board_data->power >> 1;
-       musb_plat.mode = board_data->mode;
        musb_plat.extvbus = board_data->extvbus;
 
        if (cpu_is_omap44xx())
Bye,
    Oleg
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help