Re: [PATCH v5 00/14] Add Qualcomm PMIC TPCM support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14/04/2023 07:51, Luca Weiss wrote:
I see "reverse" and "normal" depending on the direction the USB stick is
plugged in. When unplugged but also when plugged into my PC it stays at
"unknown".

Right so, this is down to bad behavior on the PHY patch, which is resolved for me on sm8250 with the below.

Basically when you unplug a device you would transition back to "TYPEC_ORIENTATION_NONE" but that would turn off the PHY, which is obs not very useful if you want to subsequently be a gadget.

Anyway thanks for testing this - I'd missed the host->device->host->device ping-pong breakage.

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
index b9a30c087423d..edb788a71edeb 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
@@ -3372,12 +3372,13 @@ static int qmp_combo_typec_switch_set(struct typec_switch_dev *sw,

        qmp->orientation = orientation;

-       if (orientation == TYPEC_ORIENTATION_NONE) {
-               if (qmp->init_count)
-                       ret = qmp_combo_dp_power_off(dp_phy);
-       } else {
-               if (!qmp->init_count)
-                       ret = qmp_combo_dp_power_on(dp_phy);
+       if (orientation != TYPEC_ORIENTATION_NONE) {
+               ret = qmp_combo_dp_power_off(dp_phy);
+               if (ret)
+                       return ret;
+               ret = qmp_combo_dp_power_on(dp_phy);
+               if (ret)
+                       return ret;
        }

---
bod



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux