Skip to contentSkip to conversation

musb_hdrc misc cleanups

PATCH In review David Brownell 2 participants 2 messages Jan 17, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 musb_hdrc misc cleanups

Remove debug/prototype sysfs attribute 'musb_otg', so there's only the one (compound) state machine to follow. (If we need an option it'd more likely be to match the N800: Mini-B connector forced into host mode, with gender-bender assistance.)

Minor DaVinci tweak: on driver shutdown, don't wait for VBUS to fall unless we're the host which was supplying that voltage.

Remove some more UglyCamelCasing.

Clear HR in some peripheral side code; the silicon doesn't clear it in various cases you'd expect such stuff to be automatic.

drivers/usb/musb/plat_uds.c +0 -18
Index: h4/drivers/usb/musb/plat_uds.c
===================================================================
@@ -145,19 +145,6 @@ MODULE_LICENSE("GPL");
 
 /*-------------------------------------------------------------------------*/
 
-#ifdef	CONFIG_USB_MUSB_OTG
-
-/* For debugging/prototyping:  allow disabling host side support on boards
- * with Mini-AB (or Mini-A) connectors, making peripheral side support look
- * like pure peripherals (not reporting OTG capabilities, and able to
- * draw a full 100mA unit load).
- */
-int musb_otg = 1;
-
-module_param(musb_otg, bool, 0);
-MODULE_PARM_DESC(musb_otg, "enable/disable OTG capabilities");
-#endif
-
 static inline struct musb *dev_to_musb(struct device *dev)
 {
 #ifdef CONFIG_USB_MUSB_HDRC_HCD
@@ -1798,11 +1785,6 @@ musb_init_controller(struct device *dev,
 	}
 #endif				/* CONFIG_USB_MUSB_HDRC_HCD */
 
-#ifdef CONFIG_USB_MUSB_OTG
-	if (!is_otg_enabled(pThis))
-		musb_otg = 0;
-#endif
-
 	/* For the host-only role, we can activate right away.
 	 * (We expect the ID pin to be forcibly grounded!!)
 	 * Otherwise, wait till the gadget driver hooks up.
drivers/usb/musb/musbdefs.h +0 -7
Index: h4/drivers/usb/musb/musbdefs.h
===================================================================
@@ -492,13 +492,6 @@ static inline struct musb *gadget_to_mus
 }
 #endif
 
-#ifdef CONFIG_USB_MUSB_OTG
-/* sysfs flag to seletively force peripheral-only operation */
-extern int musb_otg;
-#else
-#define musb_otg 0
-#endif
-
 
 /***************************** Glue it together *****************************/
 
drivers/usb/musb/musb_gadget.c +34 -27

119 lines not on this page · raw message

drivers/usb/musb/davinci.c +1 -1
Index: h4/drivers/usb/musb/davinci.c
===================================================================
@@ -432,7 +432,7 @@ int musb_platform_exit(struct musb *musb
 	davinci_source_power(musb, 0 /*off*/, 1);
 
 	/* delay, to avoid problems with module reload */
-	if (is_host_enabled(musb)) {
+	if (is_host_enabled(musb) && musb->xceiv.default_a) {
 		int	maxdelay = 30;
 		u8	devctl, warn = 0;
 
#1 lore raw
Quoted 5 lines · David Brownell

Remove debug/prototype sysfs attribute 'musb_otg', so there's only the one (compound) state machine to follow. (If we need an option it'd more likely be to match the N800: Mini-B connector forced into host mode, with gender-bender assistance.)

Quoted 7 lines

Minor DaVinci tweak: on driver shutdown, don't wait for VBUS to fall unless we're the host which was supplying that voltage.

Remove some more UglyCamelCasing.

Clear HR in some peripheral side code; the silicon doesn't clear it in various cases you'd expect such stuff to be automatic.

Pushed.

Tony