]> www.infradead.org Git - users/jedix/linux-maple.git/commit
phy: exynos5-usbdrd: subscribe to orientation notifier if required
authorAndré Draszik <andre.draszik@linaro.org>
Fri, 6 Dec 2024 16:31:06 +0000 (16:31 +0000)
committerVinod Koul <vkoul@kernel.org>
Thu, 13 Feb 2025 17:12:53 +0000 (22:42 +0530)
commit09dc674295a388e71192430b6f9c3c5cb0eb47da
tree1bba06c86185d22d4d6f2c48826cc9229c9cb20e
parent0bccdcb3eea93e087887027ff374dac5c3de36cd
phy: exynos5-usbdrd: subscribe to orientation notifier if required

gs101's SS phy needs to be configured differently based on the
connector orientation, as the SS link can only be established if the
mux is configured correctly.

The code to handle programming of the mux is in place already, this commit
now adds the missing pieces to subscribe to the Type-C orientation
switch event.

Note that for this all to work we rely on the USB controller
re-initialising us. It should invoke our .exit() upon cable unplug, and
during cable plug we'll receive the orientation event after which we
expect our .init() to be called.

Above reinitialisation happens if the DWC3 controller can enter runtime
suspend automatically. For the DWC3 driver, this is an opt-in:
    echo auto > /sys/devices/.../11110000.usb/power/control
Once done, things work as long as the UDC is not bound as otherwise it
stays busy because it doesn't cancel / stop outstanding TRBs. For now
we have to manually unbind the UDC in that case:
     echo "" > sys/kernel/config/usb_gadget/.../UDC

Note that if the orientation-switch property is missing from the DT,
the code will behave as before this commit (meaning for gs101 it will
work in SS mode in one orientation only). Other platforms are not
affected either way.

Signed-off-by: André Draszik <andre.draszik@linaro.org>
Tested-by: Will McVicker <willmcvicker@google.com>
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Tested-by: Peter Griffin <peter.griffin@linaro.org>
Link: https://lore.kernel.org/r/20241206-gs101-phy-lanes-orientation-phy-v4-6-f5961268b149@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/samsung/Kconfig
drivers/phy/samsung/phy-exynos5-usbdrd.c