&usbotg1 { pinctrl-names = "default"; dr_mode = "otg"; status = "okay"; };
echo host > /sys/kernel/debug/ci_hdrc.0/role
echo gadget > /sys/kernel/debug/ci_hdrc.0/role
Switching to host again, works.
Questions
You can refer to the document to finish configuration and setting.
linux-imx\Documentation\usb\chipidea.rst
The chipidea.rst has very detailed steps.
usb id pin is no needed. Or it could not be called "role switch".
has usb id is called "otg" mode.
linux-imx\Documentation\usb\chipidea.rst
Thanks for pointing me to the documentation @rudi_cyber. I added CONFIG_USB_OTG_FSM=y to the kernel config as described in https://www.kernel.org/doc/html/latest/usb/chipidea.html but I get a compilation error.
| CC drivers/usb/host/ehci-hcd.o
| In file included from /kernel-source/drivers/usb/chipidea/trace.h:18,
| from /kernel-source/drivers/usb/chipidea/trace.c:11:
| /kernel-source/drivers/usb/chipidea/ci.h: In function 'ci_otg_is_fsm_mode':
| /kernel-source/drivers/usb/chipidea/ci.h:476:47: error: dereferencing pointer to incomplete type 'struct ci_hdrc_platform_data'
| 476 | struct usb_otg_caps *otg_caps = &ci->platdata->ci_otg_caps;
| | ^~
| CC drivers/usb/chipidea/host.o
| make[4]: *** [/kernel-source/scripts/Makefile.build:266: drivers/usb/chipidea/trace.o] Error 1
Do you know why that is happening? Do I need a specific kernel version or a patch?
Hi,
I want to achieve USB detection without ID pin. I am getting same error while compilation. Can you provide me a lead?
Thanks,
Ajita
Hi @crudo
You can try echo peripheral > /sys/kernel/debug/ci_hdrc.0/role.
OTG ID PIN needs to be configured, otherwise, which mostly cause operations either in host or peripheral mode.
Best regards
Harvey
Best regards
Harvey