mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] usb: typec: ps883x: fixes for older Thunderbolt 4 / USB4 docks
@ 2026-09-14  6:05 Jens Glathe via B4 Relay
  2026-09-14  6:05 ` [PATCH v2 1/3] usb: typec: mux: ps883x: support TYPEC_DP_STATE_F like qmp-combo Jens Glathe via B4 Relay
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jens Glathe via B4 Relay @ 2026-09-14  6:05 UTC (permalink / raw)
  To: Heikki Krogerus, Greg Kroah-Hartman, Abel Vesa, Bjorn Andersson,
	Konrad Dybcio, Sebastian Reichel
  Cc: linux-usb, linux-kernel, linux-arm-msm, stable,
	Dr. David Alan Gilbert, Dmitry Baryshkov, Jens Glathe

On Qualcomm X1E80100 / X1P42100 platforms using the Parade PS883x
retimer, connecting USB4-capable docks such as the Lenovo 40B0 via a
regular Type-C cable (Type-C fallback mode) often results in working
USB but no DisplayPort output.

This series addresses the issue with three driver-only changes:

- Support the legacy TYPEC_DP_STATE_F request (deprecated since DP Alt
  Mode 1.0b) that docks such as the 40B0 and SSK SC220 still send.
  Handle it in the existing DP altmode path in ps883x_set(), using the
  same C/E = DP-only and D/F = USB3+DP mapping as qcom-qmp-combo.

- Add a post-configuration delay after writing the connection-status
  registers so the analog front-end can settle. This makes DP Alt Mode
  hotplug reliable on the 40B0.

- On platforms whose USB4 / DP-tunneling stack is not ready yet, reject
  TYPEC_MODE_USB4 with -EOPNOTSUPP. That forces the Type-C stack to
  fall back to USB3 + DP Alt Mode. The quirk is a machine-compatible
  table inside the driver, not a DT property.

This is a temporary workaround until full USB4 DP tunneling support is
available in the X1E USB4 controller and qmp-combo PHY stack.

As an additional observation, the same dock with a Type-C cable works
well on Thinkpad X13s, Thinkbook 16 G7 QOY and Ideapad 5 14Q8X9, which
do not use this retimer.

To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Abel Vesa <abelvesa@kernel.org>
To: Bjorn Andersson <andersson@kernel.org>
To: Konrad Dybcio <konradybcio@kernel.org>
To: Sebastian Reichel <sre@kernel.org>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org
Cc: stable@vger.kernel.org
Cc: Dr. David Alan Gilbert <dave@treblig.org>
Cc: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

Assisted-by: Grok(xAI):4.6
Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
---
Changes in v2:
- Drop the parade,disable-usb4 DT property, bindings and board DTS
  changes (Sebastian Reichel, Krzysztof Kozlowski). DT describes
  hardware; incomplete software support is not a board property.
- Disable USB4 from the driver via of_machine_is_compatible() for
  qcom,x1e80100, qcom,x1p42100, qcom,hamoa and qcom,purwa. The quirk
  stays kernel-contained and can be dropped later without ABI.
- Keep DP altmode handling in the existing ps883x_set() path instead
  of extracting a helper (Konrad Dybcio). Treat STATE_F like STATE_D
  and STATE_E like STATE_C, matching qcom-qmp-combo.
- Replace usleep_range(20000, 30000) with fsleep(30000) and document
  why the delay is required (Heikki Krogerus).
- Drop the per-event "USB4 disabled via DT property" log; print once
  at probe when the quirk is active.
- Link to v1: https://lore.kernel.org/r/20260718-ps883x-disable-usb4-v1-0-cec86d0b909e@oldschoolsolutions.biz

---
Jens Glathe (3):
      usb: typec: mux: ps883x: support TYPEC_DP_STATE_F like qmp-combo
      usb: typec: mux: ps883x: add a delay after writing config regs
      usb: typec: mux: ps883x: disable USB4 on incomplete USB4 platforms

 drivers/usb/typec/mux/ps883x.c | 56 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 53 insertions(+), 3 deletions(-)
---
base-commit: 68142f986ff04b2b70b31db00f719bf690f64a9a
change-id: 20260718-ps883x-disable-usb4-19b0fc13b5ab

Best regards,
-- 
Jens Glathe <jens.glathe@oldschoolsolutions.biz>



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/3] usb: typec: mux: ps883x: support TYPEC_DP_STATE_F like qmp-combo
  2026-09-14  6:05 [PATCH v2 0/3] usb: typec: ps883x: fixes for older Thunderbolt 4 / USB4 docks Jens Glathe via B4 Relay
@ 2026-09-14  6:05 ` Jens Glathe via B4 Relay
  2026-09-14 10:25   ` Konrad Dybcio
  2026-09-14  6:05 ` [PATCH v2 2/3] usb: typec: mux: ps883x: add a delay after writing config regs Jens Glathe via B4 Relay
  2026-09-14  6:05 ` [PATCH v2 3/3] usb: typec: mux: ps883x: disable USB4 on incomplete USB4 platforms Jens Glathe via B4 Relay
  2 siblings, 1 reply; 7+ messages in thread
From: Jens Glathe via B4 Relay @ 2026-09-14  6:05 UTC (permalink / raw)
  To: Heikki Krogerus, Greg Kroah-Hartman, Abel Vesa, Bjorn Andersson,
	Konrad Dybcio, Sebastian Reichel
  Cc: linux-usb, linux-kernel, linux-arm-msm, stable,
	Dr. David Alan Gilbert, Dmitry Baryshkov, Jens Glathe

From: Jens Glathe <jens.glathe@oldschoolsolutions.biz>

Several docks, including the Lenovo 40B0 and SSK SC220, still send the
legacy TYPEC_DP_STATE_F mode request (deprecated since DisplayPort Alt
Mode spec version 1.0b).

Keep the handling in the existing DP altmode path in ps883x_set() and
mirror qcom-qmp-combo: pin C/E are DP-only, pin D/F are USB3 + DP.
STATE_E is grouped with STATE_C the same way.

Assisted-by: Grok(xAI):4.6
Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
---
 drivers/usb/typec/mux/ps883x.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/typec/mux/ps883x.c b/drivers/usb/typec/mux/ps883x.c
index 64e0a61b776a1..c185d8897e3a4 100644
--- a/drivers/usb/typec/mux/ps883x.c
+++ b/drivers/usb/typec/mux/ps883x.c
@@ -205,21 +205,24 @@ static int ps883x_set(struct ps883x_retimer *retimer, struct typec_retimer_state
 			cfg1 |= CONN_STATUS_1_DP_CONNECTED |
 				CONN_STATUS_1_DP_HPD_LEVEL;
 
-			switch (state->mode)  {
+			switch (state->mode) {
+			/* DP + USB3 (pin D, and legacy pin F) */
 			case TYPEC_DP_STATE_D:
+			case TYPEC_DP_STATE_F:
 				cfg0 |= CONN_STATUS_0_USB_3_1_CONNECTED;
 				fallthrough;
+			/* DP only (pin C, and pin E) */
 			case TYPEC_DP_STATE_C:
+			case TYPEC_DP_STATE_E:
 				cfg1 |= CONN_STATUS_1_DP_SINK_REQUESTED |
 					CONN_STATUS_1_DP_PIN_ASSIGNMENT_C_D;
 				break;
-			default: /* MODE_E */
+			default:
 				break;
 			}
 			break;
 		case USB_TYPEC_TBT_SID:
 			tb_data = state->data;
-
 			/* Unconditional */
 			cfg2 |= CONN_STATUS_2_TBT_CONNECTED;
 

-- 
2.53.0



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 2/3] usb: typec: mux: ps883x: add a delay after writing config regs
  2026-09-14  6:05 [PATCH v2 0/3] usb: typec: ps883x: fixes for older Thunderbolt 4 / USB4 docks Jens Glathe via B4 Relay
  2026-09-14  6:05 ` [PATCH v2 1/3] usb: typec: mux: ps883x: support TYPEC_DP_STATE_F like qmp-combo Jens Glathe via B4 Relay
@ 2026-09-14  6:05 ` Jens Glathe via B4 Relay
  2026-09-14  6:05 ` [PATCH v2 3/3] usb: typec: mux: ps883x: disable USB4 on incomplete USB4 platforms Jens Glathe via B4 Relay
  2 siblings, 0 replies; 7+ messages in thread
From: Jens Glathe via B4 Relay @ 2026-09-14  6:05 UTC (permalink / raw)
  To: Heikki Krogerus, Greg Kroah-Hartman, Abel Vesa, Bjorn Andersson,
	Konrad Dybcio, Sebastian Reichel
  Cc: linux-usb, linux-kernel, linux-arm-msm, stable,
	Dr. David Alan Gilbert, Dmitry Baryshkov, Jens Glathe

From: Jens Glathe <jens.glathe@oldschoolsolutions.biz>

The connection-status registers need time to propagate through the
analog front-end (PLLs, lane training) after they are written. A 30 ms
delay after ps883x_configure() brings DisplayPort Alt Mode hotplug on
the Lenovo 40B0 to a reliable success rate.

Tested with T14s G6 and IdeaCentre Mini with the 40B0 dock on the HDMI
port with a Type-C host cable. Qualcomm firmware that programs this
retimer from an MCU uses a similar post-config delay.

Assisted-by: Grok(xAI):4.6
Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
---
 drivers/usb/typec/mux/ps883x.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/usb/typec/mux/ps883x.c b/drivers/usb/typec/mux/ps883x.c
index c185d8897e3a4..e93e958065f6f 100644
--- a/drivers/usb/typec/mux/ps883x.c
+++ b/drivers/usb/typec/mux/ps883x.c
@@ -7,6 +7,7 @@
 
 #include <drm/bridge/aux-bridge.h>
 #include <linux/clk.h>
+#include <linux/delay.h>
 #include <linux/gpio/consumer.h>
 #include <linux/i2c.h>
 #include <linux/kernel.h>
@@ -184,6 +185,15 @@ static int ps883x_configure(struct ps883x_retimer *retimer, int cfg0,
 		return ret;
 	}
 
+	/*
+	 * The retimer needs time after the connection-status registers are
+	 * written for the analog front-end (PLLs, lane training) to settle.
+	 * Without this, DisplayPort Alt Mode hotplug is unreliable on some
+	 * docks (e.g. Lenovo 40B0). Qualcomm firmware on platforms that
+	 * program this chip from an MCU uses a similar post-config delay.
+	 */
+	fsleep(30000);
+
 	return 0;
 }
 

-- 
2.53.0



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 3/3] usb: typec: mux: ps883x: disable USB4 on incomplete USB4 platforms
  2026-09-14  6:05 [PATCH v2 0/3] usb: typec: ps883x: fixes for older Thunderbolt 4 / USB4 docks Jens Glathe via B4 Relay
  2026-09-14  6:05 ` [PATCH v2 1/3] usb: typec: mux: ps883x: support TYPEC_DP_STATE_F like qmp-combo Jens Glathe via B4 Relay
  2026-09-14  6:05 ` [PATCH v2 2/3] usb: typec: mux: ps883x: add a delay after writing config regs Jens Glathe via B4 Relay
@ 2026-09-14  6:05 ` Jens Glathe via B4 Relay
  2026-09-15  0:56   ` Dr. David Alan Gilbert
  2 siblings, 1 reply; 7+ messages in thread
From: Jens Glathe via B4 Relay @ 2026-09-14  6:05 UTC (permalink / raw)
  To: Heikki Krogerus, Greg Kroah-Hartman, Abel Vesa, Bjorn Andersson,
	Konrad Dybcio, Sebastian Reichel
  Cc: linux-usb, linux-kernel, linux-arm-msm, stable,
	Dr. David Alan Gilbert, Dmitry Baryshkov, Jens Glathe

From: Jens Glathe <jens.glathe@oldschoolsolutions.biz>

On Qualcomm X1E80100 / X1P42100 platforms using the Parade PS883x
retimer, hotplugging USB4-capable docks such as the Lenovo 40B0 can
result in working USB but no DisplayPort output.

When the dock negotiates USB4, the retimer receives TYPEC_MODE_USB4
and forwards it via typec_mux_set(). The qmp-combo PHY then selects
USB3-only because no classic DP altmode SVID is present in the state,
leaving the DP transmitter and AUX channel disabled.

Reject USB4 with -EOPNOTSUPP on platforms whose USB4 / DP-tunneling
stack is not ready yet. The Type-C stack then falls back to USB3 + DP
Alt Mode. DP altmode configuration continues to use the existing
ps883x_set() path.

Use a machine-compatible table rather than a DT property so the quirk
stays inside the kernel and can be removed later without creating ABI.

Link: https://patch.msgid.link/20260312101431.2375709-1-krishna.kurapati@oss.qualcomm.com
Assisted-by: Grok(xAI):4.6
Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
---
 drivers/usb/typec/mux/ps883x.c | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/drivers/usb/typec/mux/ps883x.c b/drivers/usb/typec/mux/ps883x.c
index e93e958065f6f..02d6c04d45ae3 100644
--- a/drivers/usb/typec/mux/ps883x.c
+++ b/drivers/usb/typec/mux/ps883x.c
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
+#include <linux/of.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/usb/pd.h>
@@ -42,6 +43,22 @@
 #define CONN_STATUS_2_TBT_UNIDIR_LSRX_ACT_LT	BIT(4)
 #define CONN_STATUS_2_USB4_CONNECTED		BIT(7)
 
+/*
+ * Platforms where the USB4 / DP-tunneling stack is not ready yet. Rejecting
+ * USB4 here lets the Type-C stack fall back to USB3 + DP Alt Mode instead of
+ * negotiating USB4 and then failing to drive DisplayPort.
+ *
+ * This is a temporary, kernel-contained quirk (not DT ABI). Drop the entries
+ * once the corresponding USB4 support is complete.
+ */
+static const char * const ps883x_disable_usb4_compats[] = {
+	"qcom,x1e80100",
+	"qcom,x1p42100",
+	"qcom,hamoa",
+	"qcom,purwa",
+	NULL,
+};
+
 struct ps883x_retimer {
 	struct i2c_client *client;
 	struct gpio_desc *reset_gpio;
@@ -63,8 +80,21 @@ struct ps883x_retimer {
 
 	enum typec_orientation orientation;
 	bool in_reset;
+	bool disable_usb4;
 };
 
+static bool ps883x_should_disable_usb4(void)
+{
+	const char * const *compat;
+
+	for (compat = ps883x_disable_usb4_compats; *compat; compat++) {
+		if (of_machine_is_compatible(*compat))
+			return true;
+	}
+
+	return false;
+}
+
 static int ps883x_enable_vregs(struct ps883x_retimer *retimer)
 {
 	struct device *dev = &retimer->client->dev;
@@ -262,6 +292,9 @@ static int ps883x_set(struct ps883x_retimer *retimer, struct typec_retimer_state
 			cfg0 |= CONN_STATUS_0_USB_3_1_CONNECTED;
 			break;
 		case TYPEC_MODE_USB4:
+			if (retimer->disable_usb4)
+				return -EOPNOTSUPP;
+
 			eudo_data = state->data;
 
 			cfg2 |= CONN_STATUS_2_USB4_CONNECTED;
@@ -391,6 +424,10 @@ static int ps883x_retimer_probe(struct i2c_client *client)
 
 	retimer->client = client;
 
+	retimer->disable_usb4 = ps883x_should_disable_usb4();
+	if (retimer->disable_usb4)
+		dev_info(dev, "USB4 disabled until platform USB4 support is complete\n");
+
 	mutex_init(&retimer->lock);
 
 	retimer->regmap = devm_regmap_init_i2c(client, &ps883x_retimer_regmap);

-- 
2.53.0



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 1/3] usb: typec: mux: ps883x: support TYPEC_DP_STATE_F like qmp-combo
  2026-09-14  6:05 ` [PATCH v2 1/3] usb: typec: mux: ps883x: support TYPEC_DP_STATE_F like qmp-combo Jens Glathe via B4 Relay
@ 2026-09-14 10:25   ` Konrad Dybcio
  2026-09-15  5:07     ` Jens Glathe
  0 siblings, 1 reply; 7+ messages in thread
From: Konrad Dybcio @ 2026-09-14 10:25 UTC (permalink / raw)
  To: jens.glathe, Heikki Krogerus, Greg Kroah-Hartman, Abel Vesa,
	Bjorn Andersson, Konrad Dybcio, Sebastian Reichel
  Cc: linux-usb, linux-kernel, linux-arm-msm, stable,
	Dr. David Alan Gilbert, Dmitry Baryshkov

On 9/14/26 8:05 AM, Jens Glathe via B4 Relay wrote:
> From: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
> 
> Several docks, including the Lenovo 40B0 and SSK SC220, still send the
> legacy TYPEC_DP_STATE_F mode request (deprecated since DisplayPort Alt
> Mode spec version 1.0b).
> 
> Keep the handling in the existing DP altmode path in ps883x_set() and
> mirror qcom-qmp-combo: pin C/E are DP-only, pin D/F are USB3 + DP.
> STATE_E is grouped with STATE_C the same way.

The premise here is entirely wrong, you shouldn't assume wholly
different hardware should be programmed the same way

> 
> Assisted-by: Grok(xAI):4.6
> Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
> ---
>  drivers/usb/typec/mux/ps883x.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/typec/mux/ps883x.c b/drivers/usb/typec/mux/ps883x.c
> index 64e0a61b776a1..c185d8897e3a4 100644
> --- a/drivers/usb/typec/mux/ps883x.c
> +++ b/drivers/usb/typec/mux/ps883x.c
> @@ -205,21 +205,24 @@ static int ps883x_set(struct ps883x_retimer *retimer, struct typec_retimer_state
>  			cfg1 |= CONN_STATUS_1_DP_CONNECTED |
>  				CONN_STATUS_1_DP_HPD_LEVEL;
>  
> -			switch (state->mode)  {
> +			switch (state->mode) {
> +			/* DP + USB3 (pin D, and legacy pin F) */
>  			case TYPEC_DP_STATE_D:
> +			case TYPEC_DP_STATE_F:
>  				cfg0 |= CONN_STATUS_0_USB_3_1_CONNECTED;
>  				fallthrough;
> +			/* DP only (pin C, and pin E) */
>  			case TYPEC_DP_STATE_C:
> +			case TYPEC_DP_STATE_E:

STATE_E must not set the CONN_STATUS_1_DP_PIN_ASSIGNMENT_C_D bit
I don't know if that's the case for F too, possibly.

Setting DP_SINK_REQUESTED seems to be valid on _E.

>  				cfg1 |= CONN_STATUS_1_DP_SINK_REQUESTED |
>  					CONN_STATUS_1_DP_PIN_ASSIGNMENT_C_D;
>  				break;
> -			default: /* MODE_E */
> +			default:
>  				break;
>  			}
>  			break;
>  		case USB_TYPEC_TBT_SID:
>  			tb_data = state->data;
> -
>  			/* Unconditional */
>  			cfg2 |= CONN_STATUS_2_TBT_CONNECTED;

Stray change

Konrad

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 3/3] usb: typec: mux: ps883x: disable USB4 on incomplete USB4 platforms
  2026-09-14  6:05 ` [PATCH v2 3/3] usb: typec: mux: ps883x: disable USB4 on incomplete USB4 platforms Jens Glathe via B4 Relay
@ 2026-09-15  0:56   ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2026-09-15  0:56 UTC (permalink / raw)
  To: jens.glathe
  Cc: Heikki Krogerus, Greg Kroah-Hartman, Abel Vesa, Bjorn Andersson,
	Konrad Dybcio, Sebastian Reichel, linux-usb, linux-kernel,
	linux-arm-msm, stable, Dmitry Baryshkov

* Jens Glathe via B4 Relay (devnull+jens.glathe.oldschoolsolutions.biz@kernel.org) wrote:
> From: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
> 
> On Qualcomm X1E80100 / X1P42100 platforms using the Parade PS883x
> retimer, hotplugging USB4-capable docks such as the Lenovo 40B0 can
> result in working USB but no DisplayPort output.
> 
> When the dock negotiates USB4, the retimer receives TYPEC_MODE_USB4
> and forwards it via typec_mux_set(). The qmp-combo PHY then selects
> USB3-only because no classic DP altmode SVID is present in the state,
> leaving the DP transmitter and AUX channel disabled.
> 
> Reject USB4 with -EOPNOTSUPP on platforms whose USB4 / DP-tunneling
> stack is not ready yet. The Type-C stack then falls back to USB3 + DP
> Alt Mode. DP altmode configuration continues to use the existing
> ps883x_set() path.
> 
> Use a machine-compatible table rather than a DT property so the quirk
> stays inside the kernel and can be removed later without creating ABI.
> 
> Link: https://patch.msgid.link/20260312101431.2375709-1-krishna.kurapati@oss.qualcomm.com
> Assisted-by: Grok(xAI):4.6
> Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>

Seems to work here (pair of Asus zenbook a14's doing usb networking), so:

Tested-by: Dr. David Alan Gilbert <dave@treblig.org>

> ---
>  drivers/usb/typec/mux/ps883x.c | 37 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> diff --git a/drivers/usb/typec/mux/ps883x.c b/drivers/usb/typec/mux/ps883x.c
> index e93e958065f6f..02d6c04d45ae3 100644
> --- a/drivers/usb/typec/mux/ps883x.c
> +++ b/drivers/usb/typec/mux/ps883x.c
> @@ -13,6 +13,7 @@
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/mutex.h>
> +#include <linux/of.h>
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/usb/pd.h>
> @@ -42,6 +43,22 @@
>  #define CONN_STATUS_2_TBT_UNIDIR_LSRX_ACT_LT	BIT(4)
>  #define CONN_STATUS_2_USB4_CONNECTED		BIT(7)
>  
> +/*
> + * Platforms where the USB4 / DP-tunneling stack is not ready yet. Rejecting
> + * USB4 here lets the Type-C stack fall back to USB3 + DP Alt Mode instead of
> + * negotiating USB4 and then failing to drive DisplayPort.
> + *
> + * This is a temporary, kernel-contained quirk (not DT ABI). Drop the entries
> + * once the corresponding USB4 support is complete.
> + */
> +static const char * const ps883x_disable_usb4_compats[] = {
> +	"qcom,x1e80100",
> +	"qcom,x1p42100",
> +	"qcom,hamoa",
> +	"qcom,purwa",
> +	NULL,
> +};
> +
>  struct ps883x_retimer {
>  	struct i2c_client *client;
>  	struct gpio_desc *reset_gpio;
> @@ -63,8 +80,21 @@ struct ps883x_retimer {
>  
>  	enum typec_orientation orientation;
>  	bool in_reset;
> +	bool disable_usb4;
>  };
>  
> +static bool ps883x_should_disable_usb4(void)
> +{
> +	const char * const *compat;
> +
> +	for (compat = ps883x_disable_usb4_compats; *compat; compat++) {
> +		if (of_machine_is_compatible(*compat))
> +			return true;
> +	}
> +
> +	return false;
> +}
> +
>  static int ps883x_enable_vregs(struct ps883x_retimer *retimer)
>  {
>  	struct device *dev = &retimer->client->dev;
> @@ -262,6 +292,9 @@ static int ps883x_set(struct ps883x_retimer *retimer, struct typec_retimer_state
>  			cfg0 |= CONN_STATUS_0_USB_3_1_CONNECTED;
>  			break;
>  		case TYPEC_MODE_USB4:
> +			if (retimer->disable_usb4)
> +				return -EOPNOTSUPP;
> +
>  			eudo_data = state->data;
>  
>  			cfg2 |= CONN_STATUS_2_USB4_CONNECTED;
> @@ -391,6 +424,10 @@ static int ps883x_retimer_probe(struct i2c_client *client)
>  
>  	retimer->client = client;
>  
> +	retimer->disable_usb4 = ps883x_should_disable_usb4();
> +	if (retimer->disable_usb4)
> +		dev_info(dev, "USB4 disabled until platform USB4 support is complete\n");
> +
>  	mutex_init(&retimer->lock);
>  
>  	retimer->regmap = devm_regmap_init_i2c(client, &ps883x_retimer_regmap);
> 
> -- 
> 2.53.0
> 
> 
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 1/3] usb: typec: mux: ps883x: support TYPEC_DP_STATE_F like qmp-combo
  2026-09-14 10:25   ` Konrad Dybcio
@ 2026-09-15  5:07     ` Jens Glathe
  0 siblings, 0 replies; 7+ messages in thread
From: Jens Glathe @ 2026-09-15  5:07 UTC (permalink / raw)
  To: Konrad Dybcio, Heikki Krogerus, Greg Kroah-Hartman, Abel Vesa,
	Bjorn Andersson, Konrad Dybcio, Sebastian Reichel
  Cc: linux-usb, linux-kernel, linux-arm-msm, stable,
	Dr. David Alan Gilbert, Dmitry Baryshkov

Hi Konrad,

On 14.09.26 12:25, Konrad Dybcio wrote:
> On 9/14/26 8:05 AM, Jens Glathe via B4 Relay wrote:
>> From: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
>>
>> Several docks, including the Lenovo 40B0 and SSK SC220, still send the
>> legacy TYPEC_DP_STATE_F mode request (deprecated since DisplayPort Alt
>> Mode spec version 1.0b).
>>
>> Keep the handling in the existing DP altmode path in ps883x_set() and
>> mirror qcom-qmp-combo: pin C/E are DP-only, pin D/F are USB3 + DP.
>> STATE_E is grouped with STATE_C the same way.
> The premise here is entirely wrong, you shouldn't assume wholly
> different hardware should be programmed the same way
>
>> Assisted-by: Grok(xAI):4.6
>> Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
>> ---
>>   drivers/usb/typec/mux/ps883x.c | 9 ++++++---
>>   1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/usb/typec/mux/ps883x.c b/drivers/usb/typec/mux/ps883x.c
>> index 64e0a61b776a1..c185d8897e3a4 100644
>> --- a/drivers/usb/typec/mux/ps883x.c
>> +++ b/drivers/usb/typec/mux/ps883x.c
>> @@ -205,21 +205,24 @@ static int ps883x_set(struct ps883x_retimer *retimer, struct typec_retimer_state
>>   			cfg1 |= CONN_STATUS_1_DP_CONNECTED |
>>   				CONN_STATUS_1_DP_HPD_LEVEL;
>>   
>> -			switch (state->mode)  {
>> +			switch (state->mode) {
>> +			/* DP + USB3 (pin D, and legacy pin F) */
>>   			case TYPEC_DP_STATE_D:
>> +			case TYPEC_DP_STATE_F:
>>   				cfg0 |= CONN_STATUS_0_USB_3_1_CONNECTED;
>>   				fallthrough;
>> +			/* DP only (pin C, and pin E) */
>>   			case TYPEC_DP_STATE_C:
>> +			case TYPEC_DP_STATE_E:
> STATE_E must not set the CONN_STATUS_1_DP_PIN_ASSIGNMENT_C_D bit
> I don't know if that's the case for F too, possibly.
>
> Setting DP_SINK_REQUESTED seems to be valid on _E.
>
>>   				cfg1 |= CONN_STATUS_1_DP_SINK_REQUESTED |
>>   					CONN_STATUS_1_DP_PIN_ASSIGNMENT_C_D;
>>   				break;
>> -			default: /* MODE_E */
>> +			default:
>>   				break;
>>   			}
>>   			break;
>>   		case USB_TYPEC_TBT_SID:
>>   			tb_data = state->data;
>> -
>>   			/* Unconditional */
>>   			cfg2 |= CONN_STATUS_2_TBT_CONNECTED;
> Stray change
>
> Konrad
Acknowledged, copy/paste debris. I refined the patch and tested this one:

diff --git a/drivers/usb/typec/mux/ps883x.c b/drivers/usb/typec/mux/ps883x.c
index 64e0a61b776a1..a5696aef054ee 100644
--- a/drivers/usb/typec/mux/ps883x.c
+++ b/drivers/usb/typec/mux/ps883x.c
@@ -207,6 +207,7 @@ static int ps883x_set(struct ps883x_retimer 
*retimer, struct typec_retimer_state

                         switch (state->mode)  {
                         case TYPEC_DP_STATE_D:
+                       case TYPEC_DP_STATE_F:
                                 cfg0 |= CONN_STATUS_0_USB_3_1_CONNECTED;
                                 fallthrough;
                         case TYPEC_DP_STATE_C:

This will be in V3 with a corresponding commit message.

with best regards

Jens


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-15  5:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-14  6:05 [PATCH v2 0/3] usb: typec: ps883x: fixes for older Thunderbolt 4 / USB4 docks Jens Glathe via B4 Relay
2026-09-14  6:05 ` [PATCH v2 1/3] usb: typec: mux: ps883x: support TYPEC_DP_STATE_F like qmp-combo Jens Glathe via B4 Relay
2026-09-14 10:25   ` Konrad Dybcio
2026-09-15  5:07     ` Jens Glathe
2026-09-14  6:05 ` [PATCH v2 2/3] usb: typec: mux: ps883x: add a delay after writing config regs Jens Glathe via B4 Relay
2026-09-14  6:05 ` [PATCH v2 3/3] usb: typec: mux: ps883x: disable USB4 on incomplete USB4 platforms Jens Glathe via B4 Relay
2026-09-15  0:56   ` Dr. David Alan Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®