usb: musb: Adding musb support for OMAP4430
PATCH v2 7/8 usb: musb: Adding musb support for OMAP4430
OMAP4430 supports UTMI and ULPI types of transceiver interface.
In UTMI mode: The PHY is embedded within OMAP4430. The transceiver functionality is split between the twl6030 PMIC chip and OMAP4430. The VBUS, ID pin sensing and OTG SRP generation part is integrated in TWL6030 and UTMI PHY functionality is embedded within the OMAP4430.
There is no direct interactions between the MUSB controller and TWL6030 chip to communicate the session-valid, session-end and ID-GND events. It has to be done through a software by setting/resetting bits in one of the control module register of OMAP4430 which in turn toggles the appropriate signals to MUSB controller.
musb driver is register for blocking notifications from the transceiver driver to get the event notifications for connect/disconnect and ID-GND. Based on these events call the transceiver init/shutdown function to configure the transceiver to toggle the VBUS valid, session end and ID_GND signals to musb and power on/off the internal PHY.
For ID_GND event notifications, toggle the ID_GND signal and then wait for musb to be configured as "A" device, and then call the transceiver function to set the VBUS.
In OTG mode and musb as a host, When the Micro A connector used, VBUS is turned on and session bit set. When the device is connected, enumeration goes through. When the device disconnected from the other end of the connector(ID is still grounded), link will detect the disconnect and end the session. When the device is connected back, there are no events generated in the TWL6030-usb, and link is already down. So the device is not detected. Removed the session bit disable code which will recognize the connect of the device.
Limitation: In OTG host mode, if device is connected during boot, it does not get detected. If disconnect and connect it back or connect after boot only it works. Fix for this, I will submit seperate patch later.
--- drivers/usb/musb/musb_core.h | 1 drivers/usb/musb/omap2430.c | 105 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 96 insertions(+), 10 deletions(-)
drivers/usb/musb/musb_core.h +1 -0
@@ -411,6 +411,7 @@ struct musb {struct timer_list otg_timer;#endif +struct notifier_block nb;struct dma_controller *dma_controller;
drivers/usb/musb/omap2430.c +95 -10
140 lines not on this page · raw message
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1291984851-26040-1-git-send-email-hemahk-l0cyMroinI0@public.gmane.org
Quoted 9 lines · Hema HK
drivers/usb/musb/omap2430.c +5
-0@@ -214,9 +235,62 @@ static inline void omap2430_low_level_inmusb_writel (musb->mregs,OTG_FORCESTDBY , l); } +/* blocking notifier support */ +static int musb_otg_notifications (struct notifier_block *nb, +unsigned long event,void *unused) +{ + struct musb *musb = container_of(nb, struct musb, nb);
drivers/usb/musb/omap2430.c static inline void omap2430_low_level_in · line 252
Quoted 10 lines
drivers/usb/musb/omap2430.c +10
-0+struct device *dev = musb->controller; +struct musb_hdrc_platform_data *pdata = dev->platform_data; +struct omap_musb_board_data *data = pdata->board_data; + +switch (event) { +case USB_EVENT_ID : +DBG (4 ,"ID GND\n" ); + +if (is_otg_enabled (musb)) { +if (musb->gadget_driver) {
This breaks compilation:
drivers/usb/musb/omap2430.c: In function 'musb_otg_notifications':drivers/usb/musb/omap2430.c:252: error: 'struct musb' has no member named 'gadget_driver'
make[2]: *** [drivers/usb/musb/omap2430.o] Error 1 make[2]: *** Waiting for unfinished jobs....
make[1]: *** [drivers/usb/musb] Error 2
make: *** [drivers] Error 2
you need to ifdef that.
Signature · 5 lines
balbi -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 31 lines · Felipe Balbi
Quoted 9 lines · Hema HK
drivers/usb/musb/omap2430.c +5
-0@@ -214,9 +235,62 @@ static inline void omap2430_low_level_inmusb_writel (musb->mregs,OTG_FORCESTDBY , l); } +/* blocking notifier support */ +static int musb_otg_notifications (struct notifier_block *nb, +unsigned long event,void *unused) +{ + struct musb *musb = container_of(nb, struct musb, nb);drivers/usb/musb/omap2430.c static inline void omap2430_low_level_in · line 252
Quoted 10 lines
drivers/usb/musb/omap2430.c +10
-0+struct device *dev = musb->controller; +struct musb_hdrc_platform_data *pdata = dev->platform_data; +struct omap_musb_board_data *data = pdata->board_data; + +switch (event) { +case USB_EVENT_ID : +DBG (4 ,"ID GND\n" ); + +if (is_otg_enabled (musb)) { +if (musb->gadget_driver) {This breaks compilation:
drivers/usb/musb/omap2430.c: In function 'musb_otg_notifications':drivers/usb/musb/omap2430.c:252: error: 'struct musb' has no member named 'gadget_driver'
make[2]: *** [drivers/usb/musb/omap2430.o] Error 1 make[2]: *** Waiting for unfinished jobs....
make[1]: *** [drivers/usb/musb] Error 2
make: *** [drivers] Error 2
Quoted 1 line
you need to ifdef that.
fixed it already. Pushed to musb-hw branch.
Signature · 1 line
balbi