I have created a USB gadget HID device driver in Linux running on an OMAP-L138. The driver uses the MUSB high-speed USB2.0 module and connects to a PC as a peripheral. The driver works fine. However, I have not found a way to detect when the OMAP is connected to a host. The information in sysfs is created when the driver module is loaded and never updated when the host is connected or disconnected.
After some investigation, I have found that the disconnect callback (in struct usb_gadget_driver) is only called when the module is unloaded (and loaded) and that the suspend callback is never called.
Any ideas on what is going on? How can I detect when the OMAP has been connected or disconnected from the host?
Thanks,
abkirchhoff
P.S. I have the same problem with the gadget serial driver (g_serial) that comes with Linux kernel.