Re: Switching OMAP2430 MUSB between host and device mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



HI,

On Thu, Oct 10, 2013 at 11:45:47PM +0800, Huang Rui wrote:
> On Thu, Oct 10, 2013 at 10:10:52AM -0500, Felipe Balbi wrote:
> > On Tue, Oct 08, 2013 at 10:28:29AM -0400, Alan Stern wrote:
> > > Felipe:
> > > 
> > > I've got an Android device that uses the omap2430 musb driver.  It's
> > > configured to go into device mode when it starts up, which I guess is
> > > the normal thing for Android devices to do.
> > > 
> > > Can you explain how to switch the controller over to host mode (and
> > > back)?  I tried writing "host" to the sysfs "mode" attribute, but all
> > > that happened was an immediate crash and reboot.
> > 
> > grounding ID pin should be enough. If you're getting a crash when
> > switching through sysfs, it's likely a bug in that kernel. Can you share
> > the crash ?
> >
> 
> I also have a question for host and device mode switch at DWC3
> controller with on PCI bus. I saw omap glue get extcon cable state to
> identify ID pin, am I right?
> 
>         if (extcon_get_cable_state(edev, "USB-HOST") == true)
>                 dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_GROUND);
> 
> But I don't find any similar identification on PCI glue. So how PCI
> glue execute this action?

OMAP is peculiar. Long story short, IP team always gives us some "nice"
easter eggs heh. In this case, ID pin status doesn't go straight from
transceiver to dwc3. Transceiver doesn't even know about the ID pin (or
vbus) states, those two lines are routed to a discrete comparator and we
need to manually write those to that mailbox you see.

On PCI land I'm assuming this won't be the case and ID/VBUS lines are
routed directly to a PHY with internal VBUS and ID comparators. If you
want to *force* the IP into host mode, there's a debugfs for that. Just
write "host" to /sys/kernel/debug/dwc3*/mode.

cheers

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux