On Fri, Jul 24, 2026 at 03:48:59PM +0530, Balaji Selvanathan wrote:
> Read the USB-C cable orientation from the orientation-gpios
> property on the qcom,pmic-glink node and use it when programming
> the TypeC port-select mux.
>
> Taken from Linux commit 815891eee668 ("phy: qcom-qmp-combo: Introduce
> orientation variable")
>
> Previously the driver always set SW_PORTSELECT_MUX without
> accounting for cable orientation, so the SuperSpeed/DP lanes could
> be routed to the wrong side of the connector on boards where the
> cable was flipped. Now orientation is read once during DT parsing
> and SW_PORTSELECT_VAL is added to the mux value when a reversed
> orientation is detected.
>
> Tested on QCS6490 RB3 Gen2 board.
>
> Signed-off-by: Balaji Selvanathan <[email protected]>
Reviewed-by: Varadarajan Narayanan <[email protected]>