phy: apple: atc: Fall back to USB2 when pipehandler state is DUMMY - #515
Open
p4ulcristian wants to merge 3342 commits into
Open
phy: apple: atc: Fall back to USB2 when pipehandler state is DUMMY#515p4ulcristian wants to merge 3342 commits into
p4ulcristian wants to merge 3342 commits into
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When DP alt mode is active on a TypeC port, atcphy is configured in DP
mode and
atcphy_modes[mode].pipehandler_stateisATCPHY_PIPEHANDLER_STATE_DUMMY. If DWC3/xHCI then callsphy_set_mode(PHY_MODE_USB_HOST)on the USB3 PHY,atcphy_configure_pipehandler()hits thedefault:branch and returns-EINVAL.This propagates through
usb_phy_roothub_set_mode()→usb_add_hcd()as error -22, failing the entire
xhci-hcdprobe. USB2 data to theTypeC device is lost, even though D+/D- are unaffected by DP alt mode.
Fix this by configuring the dummy pipehandler instead of returning
-EINVAL.DUMMYpipehandler state means SS lanes are not availablefor USB3, so DWC3/xHCI initialises in USB2-only mode and devices
enumerate normally. This is consistent with how
ATCPHY_PIPEHANDLER_STATE_USB4is already handled.Tested on
apple,j413(M2 MacBook Air 13") with DP alt mode active:xhci-hcd.3.autonow probes successfully and USB2 HID devices enumerate(USB HID glasses
idVendor=1bbb idProduct=af50on USB bus 1).Signed-off-by: Paul Cristian p4ulcristian@gmail.com