Re: [PATCH v7 4/8] usb: misc: qcom_eud: add per-path role switch support

From: Konrad Dybcio

Date: Mon Sep 21 2026 - 08:37:11 EST


On 8/31/26 5:01 AM, Elson Serrao wrote:
> The EUD hardware can support multiple High-Speed USB paths, each connected
> to different USB controllers. The current implementation uses a single
> chip-level role switch, which cannot properly handle multi-path
> configurations where each path needs independent role management. Since
> EUD is physically present between the USB connector and the controller,
> it should also relay the role change requests from the connector.
>
> Restructure the driver to support per-path role switches and remove the
> chip-level role switch. Additionally, as EUD need not modify the USB
> role upon enabling, remove the unnecessary role switch call from
> enable_eud().
>
> Reviewed-by: Peter Chen <peter.chen@xxxxxxxxxx>
> Signed-off-by: Elson Serrao <elson.serrao@xxxxxxxxxxxxxxxx>
> ---

[...]

> + of_property_read_string(controller_node, "dr_mode", &dr_mode);
> +
> + /* No role switch needed for fixed role controllers */
> + if (!strcmp(dr_mode, "host")) {
> + path->curr_role = USB_ROLE_HOST;
> + of_node_put(controller_node);
> + return 0;
> + }
> +
> + if (!strcmp(dr_mode, "peripheral")) {
> + path->curr_role = USB_ROLE_DEVICE;
> + of_node_put(controller_node);
> + return 0;
> + }

I was thinking.. wouldn't that also get rid of the virtual detach
functionality on fixed-role controllers?

dwc3 currently only registers a role_switch if it's in OTG mode,
but other drivers (such as dwc2) do it unconditionally - see

https://lore.kernel.org/linux-usb/8fabc049-7fdf-498a-a3ef-6f2570d510c8@xxxxxxxxxxxxxxxx/T/#u

if that's the reason, we can change the dwc3 driver to match
since the maintainer there expressed he wouldn't mind

Konrad