cancel
Showing results for 
Search instead for 
Did you mean: 

Would it be possible to easily switch dr_mode via sysfs?

johnnyc
Associate III

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?

1 REPLY 1
PatrickF
ST Employee

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.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.