[Letux-kernel] Minor annoyances with USB(3) port on Pyra

H. Nikolaus Schaller hns at goldelico.com
Mon Sep 17 09:25:47 CEST 2018

Hi Roger,

> Am 10.09.2018 um 09:39 schrieb Roger Quadros <rogerq at ti.com>:
>> BTW: is there a /sys node to read the OTG state?
> The sys node should be something like
> /sys/kernel/debug/<addr>.usb
> However it doesn't have anything to show the current role.
> It has a "mode" file which shows the otg mode and allows you to force "host" or "device" modes
> if initial mode was "otg".

I have played a little around but configuring and mounting debugfs just to provide
some information to the GUI seems to be the wrong way to me...

root at letux:~# cat /sys/kernel/debug/4a030000.dwc3/link_state /sys/kernel/debug/4a030000.dwc3/mode 
root at letux:~# 

> If you need something to show the current role, it needs to be added to debugfs.c
> by exporting dwc->current_otg_role if (dwc->dr_mode == USB_DR_MODE_OTG)

On OMAP3 systems with twl4030 I can simply read


and it tells all about the interface state: if it is in a or b mode, peripheral, host or idle.
and I can translate that into different GUI icons.

root at letux:~# cat /sys/bus/platform/devices/musb-hdrc.0.auto/mode
root at letux:~# 

So maybe the debugfs mode should be moved to non-debugfs and report the
same as musb-hdrc.0.auto/mode? Or a new sysattr should be added to


But strangely, this symlink and /sys/devices/platform/44000000.ocp/4a020000.omap_dwc3/4a030000.dwc3/udc/4a030000.dwc3 disappear when I plug in the OTG cable. They come back on unplugging.


More information about the Letux-kernel mailing list