Re: [PATCH v6 4/9] usb: misc: qcom_eud: add per-path role switch support
From: Elson Serrao
Date: Mon Aug 24 2026 - 23:15:41 EST
On 8/24/2026 6:44 AM, Konrad Dybcio wrote:
> On 8/11/26 11:36 PM, 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.
>
> [...]
>
>> + if (!strcmp(dr_mode, "host"))
>> + path->curr_role = USB_ROLE_HOST;
>> + else if (!strcmp(dr_mode, "peripheral"))
>> + path->curr_role = USB_ROLE_DEVICE;
>> + else
>> + path->curr_role = USB_ROLE_NONE;
>> +
>> + /* No role switch needed for fixed role controllers */
>> + if (path->curr_role != USB_ROLE_NONE) {
>> + of_node_put(controller_node);
>> + return 0;
>> + }
>
> IIUC think this is a bit of a convoluted way intending to say:
>
> if dr_mode != effectively_otg
> return
>
> I don't think there's much of a better choice in APIs here, so let's
> maybe just do something like:
>
> if (host || peripheral)
> return 0;
>
> directly (i.e. without making ROLE_NONE the "desired case" as that
> is very much not obvious)
>
Sure. I will change this in v7
Thanks
Elson