All of lore.kernel.org
 help / color / mirror / Atom feed
* MUSB dual-role on AM335x behaving weirdly
@ 2015-01-21 16:06 Maxime Ripard
  2015-01-21 18:53 ` Bin Liu
  0 siblings, 1 reply; 42+ messages in thread
From: Maxime Ripard @ 2015-01-21 16:06 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Felipe,

I'm currently working on a custom AM335x-based board, that has a OTG
connector wired to one of the musb controlers, and Linux 3.17

This OTG connector seems to behave in a weird way when it comes to
switching from one role to another:

  - The host mode works with CONFIG_USB_MUSB_DUAL_ROLE set, only if
    the dr_mode is set to host in the DT, and only if we plug the USB
    device after the kernel has booted. Otherwise, even though the
    controller seems to be set up as host in the kernel logs, it
    doesn't work. When DR-mode is set to otg, DRVVBUS is not high
    which surely doesn't help, but there might be some other issues.

  - The gadget mode works with CONFIG_USB_MUSB_DUAL_ROLE, if dr_mode
    is set to otg and not host (obviously), and only if we plug the
    USB cable after the kernel has booted.

  - The gadget mode works with CONFIG_USB_MUSB_GADGET, and with
    dr_mode set to otg, even if we cold plug the device.

  - As you might expect from the two first items, the runtime
    switching from gadget to host when CONFIG_USB_MUSB_DUAL_ROLE is
    set and dr_mode is set in otg doesn't work either.

It looks like it's only waiting for an interrupt to occur to read the
ID pin state, without reading its initial value, which would explain
why both the host and gadget enumerate only when a device/cable is
hotplugged, and that there's some configuration bits that differ
whenever dr_mode changes, but I couldn't really see anything standing
out in the driver nor the datasheet.

Have you already experienced something alike with that driver?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150121/01f9c534/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2015-08-21 12:19 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-21 16:06 MUSB dual-role on AM335x behaving weirdly Maxime Ripard
2015-01-21 18:53 ` Bin Liu
2015-01-22  7:37   ` Yegor Yefremov
2015-01-22 10:43     ` Maxime Ripard
2015-01-22 11:01       ` Markus Pargmann
2015-01-22 14:00         ` Maxime Ripard
2015-01-22 14:52           ` Bin Liu
2015-02-05 13:21     ` Maxime Ripard
2015-02-24 10:39       ` Maxime Ripard
2015-02-24 14:54         ` Felipe Balbi
2015-02-24 16:50           ` Maxime Ripard
2015-02-24 17:33             ` Felipe Balbi
2015-02-25 11:11               ` Maxime Ripard
2015-02-25 12:11                 ` Yegor Yefremov
2015-05-14 17:07                   ` Felipe Balbi
2015-05-14 17:40                     ` Felipe Balbi
2015-05-14 17:49                       ` Felipe Balbi
2015-05-14 19:04                         ` Felipe Balbi
2015-05-14 19:19                           ` Bin Liu
2015-05-14 19:21                             ` Felipe Balbi
2015-05-14 19:29                               ` Bin Liu
2015-05-14 19:29                                 ` Felipe Balbi
2015-05-14 19:49                                   ` Felipe Balbi
2015-05-14 20:03                                     ` Bin Liu
2015-05-14 20:10                                       ` Felipe Balbi
2015-05-14 21:04                                   ` Bin Liu
2015-05-14 21:16                                     ` Bin Liu
2015-05-14 21:26                                       ` Alexandre Belloni
2015-05-14 21:36                                         ` Bin Liu
2015-05-26 14:51                                           ` Felipe Balbi
2015-05-27  9:42                                             ` Alexandre Belloni
2015-07-02  7:16                                               ` Gregory CLEMENT
2015-07-02 17:05                                                 ` Bin Liu
2015-08-04 13:08                                                   ` Gregory CLEMENT
2015-08-04 14:23                                                     ` Gregory CLEMENT
2015-08-04 19:32                                                       ` Felipe Balbi
2015-08-18 12:36                                                         ` Gregory CLEMENT
2015-08-18 14:13                                                           ` Felipe Balbi
2015-08-20 16:35                                                             ` Gregory CLEMENT
2015-08-20 16:46                                                               ` Felipe Balbi
2015-08-21 12:19                                                                 ` Gregory CLEMENT
2015-04-14 15:46       ` Maxime Ripard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.