diff mbox series

[v5,3/3] usb: dwc2: don't use ID/Vbus detection if usb-role-switch on STM32MP15 SoCs

Message ID 20200728074602.14218-4-amelie.delaunay@st.com (mailing list archive)
State New, archived
Headers show
Series Add USB role switch support to DWC2 | expand

Commit Message

Amelie Delaunay July 28, 2020, 7:46 a.m. UTC
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.

Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
---
Changes in v5:
- Use device_property_read_bool instead of of_read_property_bool
---
 drivers/usb/dwc2/params.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin Blumenstingl July 28, 2020, 7:18 p.m. UTC | #1
Hi Amelie,

On Tue, Jul 28, 2020 at 9:46 AM Amelie Delaunay <amelie.delaunay@st.com> wrote:
>
> 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.
>
> Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
thank you for updating this patch - please add my:
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>


Martin
diff mbox series

Patch

diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index a3611cdd1dea..50df72f32b4c 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -185,7 +185,7 @@  static void dwc2_set_stm32mp15_hsotg_params(struct dwc2_hsotg *hsotg)
 	struct dwc2_core_params *p = &hsotg->params;
 
 	p->otg_cap = DWC2_CAP_PARAM_NO_HNP_SRP_CAPABLE;
-	p->activate_stm_id_vb_detection = true;
+	p->activate_stm_id_vb_detection = !device_property_read_bool(hsotg->dev, "usb-role-switch");
 	p->host_rx_fifo_size = 440;
 	p->host_nperio_tx_fifo_size = 256;
 	p->host_perio_tx_fifo_size = 256;