[PATCH v2] soc: qcom: pmic_glink_altmode: Disable TBT/USB4 negotiation for now

From: Konrad Dybcio

Date: Mon Nov 30 2026 - 10:46:16 EST


Some platforms (like Glymur) accept a versioned flavor of PAN_EN,
allowing to specify a parameter that denotes the OS type, which
influences Type-C capabilities. In particular, there's a setting for an
installer image (which implicitly doesn't ship all the required
drivers) which disables TBT/USB4 negotiation to let the connected
devices fall back to USB3/DP mode cleanly.

Utilize that.

Signed-off-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>
---
Changes in v2:
- Turns out not all previous firmwares ignore the argument.
Flip it back to zero on things that don't claim compatibility
with Glymur.
- Link to v1: https://lore.kernel.org/r/20261117-topic-pga_nousb4_glymur-v1-1-0ede74e620d0@xxxxxxxxxxxxxxxx
---
Tested on Glymur with SOCCP.FW.2.1-00267
---
drivers/soc/qcom/pmic_glink_altmode.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/pmic_glink_altmode.c b/drivers/soc/qcom/pmic_glink_altmode.c
index 9e8e103ef8592a8da6ad19d80ddd7961a5ee916b..75692a99dc8bca74a6601a67ab7d1ed4b43c70af 100644
--- a/drivers/soc/qcom/pmic_glink_altmode.c
+++ b/drivers/soc/qcom/pmic_glink_altmode.c
@@ -32,6 +32,12 @@
#define ALTMODE_PAN_EN 0x10
#define ALTMODE_PAN_ACK 0x11

+/* These fields are ignored on older FWs */
+#define PAN_EN_OS_TYPE GENMASK(6, 3)
+ #define PAN_EN_OS_DEFAULT 1
+ #define PAN_EN_OS_INSTALLER 2
+#define PAN_EN_VERSION GENMASK(2, 0)
+
struct usbc_write_req {
struct pmic_glink_hdr hdr;
__le32 cmd;
@@ -563,9 +569,16 @@ static void pmic_glink_altmode_disable_work(void *data)
static void pmic_glink_altmode_enable_worker(struct work_struct *work)
{
struct pmic_glink_altmode *altmode = work_to_altmode(work);
+ u32 val = 0;
int ret;

- ret = pmic_glink_altmode_request(altmode, ALTMODE_PAN_EN, 0);
+ /* Set OS to installer for now to restrict USB4/TBT negotiation */
+ if (device_is_compatible(altmode->dev, "qcom,glymur-pmic-glink")) {
+ val = FIELD_PREP(PAN_EN_VERSION, 1) |
+ FIELD_PREP(PAN_EN_OS_TYPE, PAN_EN_OS_INSTALLER);
+ }
+
+ ret = pmic_glink_altmode_request(altmode, ALTMODE_PAN_EN, val);
if (ret)
dev_err(altmode->dev, "failed to request altmode notifications: %d\n", ret);
}

---
base-commit: 3dd8c790a7b7027abdd568e36db5e82ffaea7c77
change-id: 20261117-topic-pga_nousb4_glymur-ecfb1863b427

Best regards,
--
Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>