Skip to content

Commit 916f8b6

Browse files
ADESTMfelipebalbi
authored andcommitted
usb: dwc2: don't use ID/Vbus detection if usb-role-switch on STM32MP15 SoCs
If usb-role-switch is present in the device tree, it means that ID and Vbus signals are not connected to the OTG controller but to an external component (GPIOs, Type-C controller). In this configuration, usb role switch is used to force valid sessions on STM32MP15 SoCs. Acked-by: Minas Harutyunyan <[email protected]> Signed-off-by: Amelie Delaunay <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent bc0f0d4 commit 916f8b6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/usb/dwc2/params.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,11 @@ static void dwc2_set_stm32mp15_fsotg_params(struct dwc2_hsotg *hsotg)
183183
static void dwc2_set_stm32mp15_hsotg_params(struct dwc2_hsotg *hsotg)
184184
{
185185
struct dwc2_core_params *p = &hsotg->params;
186+
struct device_node *np = hsotg->dev->of_node;
186187

187188
p->otg_cap = DWC2_CAP_PARAM_NO_HNP_SRP_CAPABLE;
188-
p->activate_stm_id_vb_detection = true;
189+
p->activate_stm_id_vb_detection =
190+
!of_property_read_bool(np, "usb-role-switch");
189191
p->host_rx_fifo_size = 440;
190192
p->host_nperio_tx_fifo_size = 256;
191193
p->host_perio_tx_fifo_size = 256;

0 commit comments

Comments
 (0)