From 803ea84d8b5e3eef93a6453bf877ff2c38ddb7fa Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Fri, 2 Jan 2026 20:02:55 +0100 Subject: [PATCH] Fixing broken patch --- ...modes-displayport-Respect-DP_CAP_RECEPT.patch | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/patch/kernel/archive/rockchip64-6.18/rk3399-usbc-usb-typec-altmodes-displayport-Respect-DP_CAP_RECEPT.patch b/patch/kernel/archive/rockchip64-6.18/rk3399-usbc-usb-typec-altmodes-displayport-Respect-DP_CAP_RECEPT.patch index a5e87e6ba0..9854d80cc6 100644 --- a/patch/kernel/archive/rockchip64-6.18/rk3399-usbc-usb-typec-altmodes-displayport-Respect-DP_CAP_RECEPT.patch +++ b/patch/kernel/archive/rockchip64-6.18/rk3399-usbc-usb-typec-altmodes-displayport-Respect-DP_CAP_RECEPT.patch @@ -51,13 +51,18 @@ index 111111111111..222222222222 100644 /* Determining the initial pin assignment. */ if (!DP_CONF_GET_PIN_ASSIGN(dp->data.conf)) { /* Is USB together with DP preferred */ -@@ -814,15 +832,37 @@ int dp_altmode_probe(struct typec_altmode *alt) +@@ -757,16 +775,40 @@ int dp_altmode_probe(struct typec_altmode *alt) struct typec_altmode *plug = typec_altmode_get_plug(alt, TYPEC_PLUG_SOP_P); struct fwnode_handle *fwnode; struct dp_altmode *dp; + u32 port_pins, alt_pins; - /* FIXME: Port can only be DFP_U. */ + /* Port can only be DFP_U. */ +- if (typec_altmode_get_data_role(alt) != TYPEC_HOST) ++ if (typec_altmode_get_data_role(alt) != TYPEC_HOST) {+ ++ typec_altmode_put_plug(plug); + return -EPROTO; ++ } - /* Make sure we have compatible pin configurations */ - if (!(DP_CAP_PIN_ASSIGN_DFP_D(port->vdo) & @@ -82,6 +87,7 @@ index 111111111111..222222222222 100644 + if (!(port->vdo & DP_CAP_RECEPTACLE) && !(alt->vdo & DP_CAP_RECEPTACLE)) { + dev_warn(&alt->dev, "Our Alt-DP VDO 0x%06x and peer port VDO 0x%06x are not compatible (both are reported as plugs!)\n", + port->vdo, alt->vdo); ++ typec_altmode_put_plug(plug); + return -ENODEV; + } + @@ -89,11 +95,9 @@ index 111111111111..222222222222 100644 + if (!(port_pins & alt_pins)) { + dev_warn(&alt->dev, "Our Alt-DP VDO 0x%06x and peer port VDO 0x%06x are not compatible (no shared pinconf %04x<->%04x (UUDD))\n", + port->vdo, alt->vdo, port_pins, alt_pins); + typec_altmode_put_plug(plug); return -ENODEV; -+ } - - dp = devm_kzalloc(&alt->dev, sizeof(*dp), GFP_KERNEL); - if (!dp) + } -- Armbian