Hi, In our platform, we use udev to implement that host/slave problem.
Best Regards, Peter Chen On Thu, 2009-06-25 at 12:46 +0530, Arjun Joshi 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 > > > Greg KH wrote: > > > On Sun, Apr 12, 2009 at 08:39:32AM +0530, niamathullah sharief wrote: > > > > > > > Yes that i know...Is this enough for making USB to enable? > > > > > > > > > Did you try it out to see if it is? > > > > If so, what problems did you run into? > > > > thanks, > > > > greg k-h > > > > -- > > To unsubscribe from this list: send an email with > > "unsubscribe kernelnewbies" to ecar...@nl.linux.org > > Please read the FAQ at http://kernelnewbies.org/FAQ > > > > > > > > Email Scanned for Virus & Dangerous Content by : www.CleanMailGateway.com > > > > > > > > > -- > ______________________________________________________________________ > > Disclaimer: This e-mail message and all attachments transmitted with > it are intended solely for the use of the addressee and may contain > legally privileged and confidential information. If the reader of this > message is not the intended recipient, or an employee or agent > responsible for delivering this message to the intended recipient, you > are hereby notified that any dissemination, distribution, copying, or > other use of this message or its attachments is strictly prohibited. > If you have received this message in error, please notify the sender > immediately by replying to this message and please delete it from your > computer. Any views expressed in this message are those of the > individual sender unless otherwise stated.Company has taken enough > precautions to prevent the spread of viruses. However the company > accepts no liability for any damage caused by any virus transmitted by > this email. > > > ______________________________________________________________________ >