Skip to content

Updating EUD series to v3#828

Merged
wcheng-eng merged 18 commits intoqualcomm-linux:tech/bus/usb/phyfrom
elsonroy:tech/bus/usb/phy
Mar 26, 2026
Merged

Updating EUD series to v3#828
wcheng-eng merged 18 commits intoqualcomm-linux:tech/bus/usb/phyfrom
elsonroy:tech/bus/usb/phy

Conversation

@elsonroy
Copy link

Updating EUD series to v3

…t handling"

This reverts commit 7104631.

Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
This reverts commit 583d6fc.

Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
This reverts commit eb5da51.

Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
This reverts commit e7e656c.

Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
…ntrol"

This reverts commit e2541a8.

Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
…election"

This reverts commit c042ed7.

Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
…ulti-path hardware"

This reverts commit cfe135b.

Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
Add an optional consumer→provider phandle on USB connectors to reference
the USB role-switch provider when no direct graph link exists. The DRD
controller remains the provider via its 'usb-role-switch' property.

Link: https://lore.kernel.org/all/20260223191042.825136-2-elson.serrao@oss.qualcomm.com/
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
…iguration

EUD hardware supports debugging on up to two USB ports depending on the
SoC configuration. Debugging can be selected on either the primary or
secondary USB port as controlled by the EUD_PORT_SELECT register.

Extend the binding to support dual-port configurations by adding port@2
and port@3 for secondary USB controller and Type-C connector connections.

Link: https://lore.kernel.org/all/20260309203337.803986-2-elson.serrao@oss.qualcomm.com/
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
@wcheng-eng wcheng-eng self-requested a review March 24, 2026 22:30
@wcheng-eng
Copy link

can you just fix these checkpatch warnings?


Commit 6ca46c5 ("FROMLIST: usb: misc: qcom_eud: add sysfs attribute for port selection")

CHECK: Alignment should match open parenthesis
#75: FILE: drivers/usb/misc/qcom_eud.c:112:
+static ssize_t port_show(struct device *dev,

  •   struct device_attribute *attr, char *buf)
    

CHECK: Alignment should match open parenthesis
#83: FILE: drivers/usb/misc/qcom_eud.c:120:
+static ssize_t port_store(struct device *dev,

  •   struct device_attribute *attr,
    

6ca46c5 total: 0 errors, 0 warnings, 2 checks, 84 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

Commit 6ca46c5 ("FROMLIST: usb: misc: qcom_eud: add sysfs attribute for port selection") has style problems, please review.

EUD can be mapped to either the primary USB port or the secondary USB port
depending on the value of the EUD_PORT_SEL register. Add a 'port' sysfs
attribute to allow userspace to select which port EUD should operate on
and update the ABI documentation. This is needed for systems with dual
USB ports where EUD needs to be accessible on either port depending on the
system configuration and use case.

Link: https://lore.kernel.org/all/20260309203337.803986-3-elson.serrao@oss.qualcomm.com/
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
EUD hardware can support multiple High-Speed USB ports, each routed
through its own PHY. The active port is selected in hardware via the
EUD_PORT_SEL register. As a High-Speed hub, EUD requires access to
the High-Speed PHY associated with the active port. To support this
multi-port capability, the driver must manage PHY resources on a
per-port basis, ensuring that the PHY for the currently selected
port is properly initialized and powered.

This patch adds per-port PHY management to the driver. The driver
now powers the appropriate PHY based on the selected and enabled
port, ensuring correct operation when EUD is enabled.

Historically, EUD appeared to work on single-port systems because
the USB controller kept the PHY initialized. However, EUD is
designed to operate independently of the USB controller and
therefore requires explicit PHY control for proper operation.

Link: https://lore.kernel.org/all/20260309203337.803986-4-elson.serrao@oss.qualcomm.com/
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
The EUD hardware can support multiple High-Speed USB ports, each
connected to different USB controllers. The current implementation
uses a single chip-level role switch, which cannot properly handle
multi-port configurations where each USB port can operate in
different role.

Restructure the driver to support per-port role switches.
Additionally, remove the unnecessary role switch call from
enable_eud() as EUD need not modify the USB role upon enabling.

Link: https://lore.kernel.org/all/20260309203337.803986-5-elson.serrao@oss.qualcomm.com/
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
Currently enable_store() allows operations irrespective of the EUD state,
which can result in redundant operations. Avoid this by adding duplicate
state checks to skip requests when EUD is already in the desired state.
Additionally, improve error handling with explicit logging to provide
better feedback.

Link: https://lore.kernel.org/all/20260309203337.803986-6-elson.serrao@oss.qualcomm.com/
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
EUD provides virtual USB attach/detach events to simulate cable
plug/unplug while maintaining the physical debug connection. However,
the current implementation incorrectly sets the USB role to HOST on
virtual detach, which doesn't represent the disconnected state.

Fix the virtual detach handling by setting the USB role to NONE
instead of HOST, correctly representing the disconnected state.

Link: https://lore.kernel.org/all/20260309203337.803986-7-elson.serrao@oss.qualcomm.com/
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
EUD functions by presenting itself as a USB device to the host PC for
debugging, making it incompatible with USB host mode configurations.

Handle below two scenarios to prevent these conflicts:
1. Prevent user from enabling EUD via sysfs when the USB port is
   in host mode.
2. Automatically disable EUD when USB port switches to host mode
   and re-enable it when exiting host mode. This is achieved via
   the exported qcom_eud_usb_role_notify() API that allows the USB
   controller driver to notify EUD of role changes.

This ensures consistent state management without creating conflicts
between the EUD debug hub and the USB controller.

Link: https://lore.kernel.org/all/20260309203337.803986-8-elson.serrao@oss.qualcomm.com/
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
The EUD driver needs USB role information to control its operation as
it is incompatible with host mode. Notify the EUD driver when role
changes occur so it can manage its state accordingly.

Link: https://lore.kernel.org/all/20260309203337.803986-9-elson.serrao@oss.qualcomm.com/
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
The EUD node is currently mapped to the secondary USB controller. This
SoC only supports EUD on the primary High-Speed USB path.

Fix the graph connections to properly map EUD to the primary USB
controller. Add an empty connector endpoint for board DTS files to
complete the connection. Also enable EUD so debug is available by
default on this SoC.

Link: https://lore.kernel.org/all/20260309203337.803986-10-elson.serrao@oss.qualcomm.com/
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
Map the USB connector HS endpoint to EUD for debug functionality on all
boards using kodiak.dtsi. Since the controller is no longer a direct
neighbor of the connector, add usb-role-switch phandle to map the USB
role switch provider for this connector.

Link: https://lore.kernel.org/all/20260309203337.803986-11-elson.serrao@oss.qualcomm.com/
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
@wcheng-eng wcheng-eng merged commit 8c7f91d into qualcomm-linux:tech/bus/usb/phy Mar 26, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants