From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0A453F8ED8 for ; Fri, 26 Jun 2026 14:27:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782484042; cv=none; b=NE/U5UoBfFNBMXdXzkdrWhlZw1123peNKG6RBKIfYV+HrtFtrnQgzuvMtOlGxKWIb87+d4d5gGi5HfowZBlsVcSoaEPw9aOqLsHmGO7l3Uj4byVWNcCzSd9R+KyX+pBbjXdJ0BjwryFXRhHEMaXvnbdI02MT+6j6rO6Vx4OKIX8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782484042; c=relaxed/simple; bh=uN/IBN4vntgrjZsO3w5tBaNGdr3xPxH8/Ni243C4nwg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SCJ8Ox1enWqlt7xV9/NV24z5SBeWcyVZ+91QXEvngSrFsrgQswUnEdnSJfucwAORrMkE4uX2Q/APje1tT01RKFKmcJYPYbSQpym0pv6SLpt6IWzTyR34eMJGx5gf+UKzffaej9Qbi3txdBsicit4o3OHTDvRHDzd/OVuWmjSMRY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=QMPpvHw4; arc=none smtp.client-ip=209.85.208.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="QMPpvHw4" Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-6980ae819d0so1913508a12.3 for ; Fri, 26 Jun 2026 07:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1782484033; x=1783088833; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Bw4wOLtu6rGFY5GLKzfmFRrF9cJ0E7efDRcBVmIxEXw=; b=QMPpvHw40Jqebvo9wPo95DfU1BU9/FvCUn9eXB3YoVkK3O0LwYYatVzvxHPIFI1W07 3RtrrN7Xz43iTyma5tygyuAYvxhSsrcZQr22opkFGrLaXsJTj7XiancsF+ZDEkzPWla8 hz76BeoIqdni7JpXArubWIzIdaMUiNmuG9sUo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782484033; x=1783088833; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Bw4wOLtu6rGFY5GLKzfmFRrF9cJ0E7efDRcBVmIxEXw=; b=d9XCvZquHyby1ZEdqBbfp4LS4P+WlmwlchKWfX8rKhYVmXhGvnMTgF0Ldyi9ybUTzb L2dyJ8uZ4J9Df8aJxBUsZhyPbiAo1G9LPMizEYxNrNrtPw12/nNWy/icbGGL3/6PhO8h /j2lFYZXznjWlIYtcsh9mSqZje4nGYt7f4+AtEEaxLsMq11hEnXfVt1cfsuU+uetku5/ usP09A/Ktzx9ym+zCMyxHGmHnCOrrRBZcsX9JnOJDrR6GZMKWURXHIfHN+AewyfdbPzk 2KpCZ6recTo6eMCiwQloq5UxqOrJEqM8sRUoFrs8d+Kkc3k2ma7JWWubvfxtmxhP638W QUuw== X-Forwarded-Encrypted: i=1; AHgh+Rrbd3llzze4FP37in/v+p8Kl4GlAfQLhFEj4Blp/kZYID3opp+ltSu7eoK3AKPQ6py17KGa91yULKLuagc=@vger.kernel.org X-Gm-Message-State: AOJu0YxZyPEr+NHJV72eRor93Dp47J3KJ7SyREkjD4TlBg1Dn1lb2DyC 3pJ/A3YWf81J6G0hQMOQwYxu+rkLeg7et2hpYbVH40kYVy7hEI8ape2YPLXWssjGz+JlcZ6nuiw vFGKUJA== X-Gm-Gg: AfdE7cnTAfGAxNftW5sr5wBrIEaRZI3597zKp7F+uvOqHLrfFzChBZPcIOnMLZ8VfnA t1yuwtE/f41JjFAKVqQuGaDo2TQOhlA3uVPK76nno44NDKDXcnlTENqKipF235JAuCeEUL3/sWS bzIrVHO+sczaF+DZmSx8YGsdhHF00Ih02nZTbx/WCcH+834zoAP7tx/tf5yYrujYqj4uupUPoum NnWTdw7WRpVmhuyTU7vIzA5iiLEJrQIdsBeerKsWbucXlsY15cd0QNLypqRypSp6oagwUwT0sp+ tghlpYkH/qeTk1reEZBfZ4GxwRkKduLwcnfTtYfBA85Amga9SLohdxB5pXIICssRt0t3VlcjcRs Q9lgkTaMM1+70xVl8bxYW8MtEkSwmzzy5KU447Evb/WNaj5W6uXFuwOURywf5t/9nQG3N8u1AjF XYLXXguwqUjLIwRNq+/NZIgPiymtDuJtoSCYCgYamdjY1VdX5jwOsg4+wOvKuc5Cv73suPjM+am NQPMnhzNw== X-Received: by 2002:a17:907:72c9:b0:c12:301a:30b6 with SMTP id a640c23a62f3a-c12301a3f67mr95952366b.12.1782484033295; Fri, 26 Jun 2026 07:27:13 -0700 (PDT) Received: from akuchynski.c.googlers.com.com (208.220.32.34.bc.googleusercontent.com. [34.32.220.208]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c11fbba6787sm355968666b.6.2026.06.26.07.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 07:27:12 -0700 (PDT) From: Andrei Kuchynski To: Heikki Krogerus , Benson Leung , Jameson Thies Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Andrei Kuchynski Subject: [PATCH v3 3/3] usb: typec: displayport: Check cable altmode support Date: Fri, 26 Jun 2026 14:27:02 +0000 Message-ID: <20260626142702.1941182-4-akuchynski@chromium.org> X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog In-Reply-To: <20260626142702.1941182-1-akuchynski@chromium.org> References: <20260626142702.1941182-1-akuchynski@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Update the probe function to utilize the new typec_cable_altmode_unsupported() helper. If the cable doesn't support DisplayPort altmode, don't initialize altmode_ops and prevent altmode from being activated. A captive cable shouldn't be checked; it may not provide discoverable capability information, but it is inherently designed to support the device's requirements. Signed-off-by: Andrei Kuchynski Reviewed-by: Benson Leung Reviewed-by: Heikki Krogerus --- drivers/usb/typec/altmodes/displayport.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c index 263a89c5f3243..5ee33a69b9cf7 100644 --- a/drivers/usb/typec/altmodes/displayport.c +++ b/drivers/usb/typec/altmodes/displayport.c @@ -790,7 +790,6 @@ int dp_altmode_probe(struct typec_altmode *alt) dp->alt = alt; alt->desc = "DisplayPort"; - typec_altmode_set_ops(alt, &dp_altmode_ops); if (plug) { plug->desc = "Displayport"; @@ -811,6 +810,10 @@ int dp_altmode_probe(struct typec_altmode *alt) if (plug) typec_altmode_set_drvdata(plug, dp); + if ((alt->vdo & DP_CAP_RECEPTACLE) && typec_cable_altmode_unsupported(alt)) + return 0; + + typec_altmode_set_ops(alt, &dp_altmode_ops); if (!alt->mode_selection) { dp->state = plug ? DP_STATE_ENTER_PRIME : DP_STATE_ENTER; schedule_work(&dp->work); -- 2.55.0.rc0.799.gd6f94ed593-goog