fix broken patch
This commit is contained in:
parent
e38d028214
commit
45aac305ac
@ -1,4 +1,4 @@
|
||||
From 4924272fe0385296f3e06d7f9aff5166815c86db Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Jirman <megi@xff.cz>
|
||||
Date: Mon, 5 Sep 2022 00:56:07 +0200
|
||||
Subject: usb: typec: altmodes: displayport: Respect DP_CAP_RECEPTACLE bit
|
||||
@ -14,16 +14,13 @@ wrong VDO.
|
||||
|
||||
Signed-off-by: Ondrej Jirman <megi@xff.cz>
|
||||
---
|
||||
drivers/usb/typec/altmodes/displayport.c | 48 ++++++++++++++++++++++--
|
||||
1 file changed, 44 insertions(+), 4 deletions(-)
|
||||
drivers/usb/typec/altmodes/displayport.c | 50 ++++++++++++++++++++++++++++----
|
||||
1 file changed, 45 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
|
||||
index 6964f403a2d5..9af15469fc3a 100644
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/usb/typec/altmodes/displayport.c
|
||||
+++ b/drivers/usb/typec/altmodes/displayport.c
|
||||
@@ -116,11 +116,29 @@ static int dp_altmode_configure(struct dp_altmode *dp, u8 con)
|
||||
/* Account for active cable capabilities */
|
||||
if (dp->plug_prime)
|
||||
pin_assign &= DP_CAP_UFP_D_PIN_ASSIGN(dp->plug_prime->vdo);
|
||||
+
|
||||
+ /*
|
||||
@ -45,21 +42,21 @@ index 6964f403a2d5..9af15469fc3a 100644
|
||||
break;
|
||||
}
|
||||
|
||||
+
|
||||
+ dev_info(&dp->alt->dev, "con=%d pin_assign=%x (port=%x alt=%x)\n",
|
||||
+ (int)con, (unsigned)pin_assign, dp->port->vdo, dp->alt->vdo);
|
||||
+
|
||||
/* Determining the initial pin assignment. */
|
||||
if (!DP_CONF_GET_PIN_ASSIGN(dp->data.conf)) {
|
||||
/* Is USB together with DP preferred */
|
||||
@@ -729,15 +747,37 @@ int dp_altmode_probe(struct typec_altmode *alt)
|
||||
struct typec_altmode *plug = typec_altmode_get_plug(alt, TYPEC_PLUG_SOP_P);
|
||||
@@ -730,13 +749,35 @@
|
||||
struct fwnode_handle *fwnode;
|
||||
struct dp_altmode *dp;
|
||||
+ u32 port_pins, alt_pins;
|
||||
|
||||
+ u32 port_pins, alt_pins;
|
||||
/* FIXME: Port can only be DFP_U. */
|
||||
|
||||
+ /*
|
||||
+/*
|
||||
+ * When port is a receptacle DP_CAP_xFP_D_PIN_ASSIGN macros have the
|
||||
+ * regular meaning. When the port is a plug, the meaning is swapped.
|
||||
+ *
|
||||
@ -77,6 +74,7 @@ index 6964f403a2d5..9af15469fc3a 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;
|
||||
+ }
|
||||
+
|
||||
@ -84,15 +82,12 @@ index 6964f403a2d5..9af15469fc3a 100644
|
||||
- if (!(DP_CAP_PIN_ASSIGN_DFP_D(port->vdo) &
|
||||
- DP_CAP_PIN_ASSIGN_UFP_D(alt->vdo)) &&
|
||||
- !(DP_CAP_PIN_ASSIGN_UFP_D(port->vdo) &
|
||||
- DP_CAP_PIN_ASSIGN_DFP_D(alt->vdo)))
|
||||
- DP_CAP_PIN_ASSIGN_DFP_D(alt->vdo))) {
|
||||
+ 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)
|
||||
}
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user