2023-02-01 06:16 AM
Suppose I would implement a sysfs interface that enables me to set the dr_mode of the dwc2 driver. Is it possible without huge changes in the code, to change the dr_mode on the fly via userspace? We might use the usb-role-switch functionality of the dwc2 drd driver, but can it be dynamically set just like that?
2023-02-01 08:48 AM
Hi @johnnyc
I guess that for Type-C connector, the standard enforce some automated control to detect if USB has to behave as DFP (host) or a UFP (device).
For micro-AB connector, this control should be as well automated and is devoted to the physical ID pin.
Maybe you could write your own 'connector' driver, but I'm not SW expert. Furthermore, this has to comply to standard to allow certification for USB logo.
See if this could help: https://wiki.st.com/stm32mpu/wiki/OTG_device_tree_configuration#DT_configuration_example_as_high_speed_OTG-2C_with_Type-C_connector
Regards.