Hi Arjun, > I am trying to make USB work dynamically on an OMAP board which has a > USB OTG controller. The board has a mini-AB receptacle. Is this the Beagle board you're referring to ? If so, are you happy with it ? I've been considering getting Beagle, because (AFAIK) TI's OMAP is so far the only that supports the Ubuntu port to ARM ? Best Regards, Kris On Thu, 25 Jun 2009 12:46:46 +0530, Arjun Joshi <arjun.joshi@xxxxxxxxxxxxxx> wrote: > Hi Greg, > > I am trying to make USB work dynamically on an OMAP board which has a > USB OTG controller. The board has a mini-AB receptacle. > > My target is that whenever I insert a mini-B cable the gadget related > kernel modules must be loaded automatically so that my board works as > mass storage device. When i insert a mini-A cable the host mode related > kernel modules must be loaded so that my board works as host. > > I have compiled usbcore, HostController drivers(for both host and gadget > mode --- host.ko and gadget.ko) and mass storage support(for HC in host > mode) and file backed storage gadget(for HC in device mode) > as modules. > > What i am currently doing is that I am plugging a mini-A cable, > inserting usbcore,host.ko and usb-storage.ko and I am able to detect a > mobile phone as a mass storage device. > > Then I rmmod all the modules, unplug the mini-A cable, insert the mini-B > cable, modprobe the usbcore, gadget.ko and g_file_storage.ko which > enables my device to be detected as a mass storage device on my PC. > > Now the tricky part is that I want to do all the loading/unloading of > respective modules dynamically (without any human intervention - maybe > through a script) as soon as I insert the cable(either one) or remove > the cable. > > My Queries: > > 1. How do I detect which cable is inserted? Is there a way to find out? > 2. Is it possible to do this? If yes, any guidance will greatly help. > > Thanks, > Arjun > -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ