From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (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 D28A539E18E for ; Mon, 22 Jun 2026 09:39:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782121165; cv=none; b=pA9ftvwlT5sR6rHHLWHnjI8e5E6IJanf7OHKtxdMCEkvm94IPOFhddPmTE225B0ILf5kIp84EMkNGo4usaOGH3uPzhaPelSz8b1MuvVgwHzjvoYLHOclkkrvlWMpzo/8iBq4eNXxX+aTbURyByeFA0Wt6zK+zzowcZnOt6UFCqU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782121165; c=relaxed/simple; bh=GKn99OYoElK84ZVJ7YP6UqBYdrLq7HXpoepjfR4DCt4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gt/m3uQaUCOWslFD7QYdcqdKL3aPJ3Z+c2INnk3Ytq2T69T+Dzn6y5qjWvhmPzYF6a98qAop2zIobFPJlQk9YyknpJDlytqv9onxBNDCH5NbwOrbkp4jBGaIqQkKc3thW9++RYNGGDHN/ailRxNEOvavWgw/WQjJUSTn+iFhyes= 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=GUXR4g3X; arc=none smtp.client-ip=209.85.218.53 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="GUXR4g3X" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-bed2195323cso642177666b.1 for ; Mon, 22 Jun 2026 02:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1782121162; x=1782725962; 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=KRBiib49+edyErnYaxFG8Uj2VeeIA+JfDglsGlUnnhw=; b=GUXR4g3XNFY8kFfOeA0kU94XtubFr4kDfilfgq4yv7yDUbLK+9Wg2kfI/9w6OzvNXQ Ez8HMuT7q1RHnlMe9Uf/QVI+nKScze01MeYwyYiXYlWZlKoYPoTd5G/9WJ5bZPhiqqM1 NhMThr9N8vaMt9g2qaFmUiPUgSTbG6FdltAEU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782121162; x=1782725962; 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=KRBiib49+edyErnYaxFG8Uj2VeeIA+JfDglsGlUnnhw=; b=jp96E/Ugd/82MG8D/QAYE3O9cq19j1l3A/iLETmxXeRHh6q6hqyy19tLvz+dyiYxIa ZR8rw/0EbJ47qQ1prYn+4B6qTw7+P1nRbRoSpBsUir8Yv2hXafv4fF/U+t3I4a/y53S2 AmLqwP+T/y2T8CK1Nz/rNbXGPRjk0Xi/Cf258mDAfn2tW9jslJWgR4zbnieoVJc78lTa CixXr8zHbKYGMtPWNXZWLdVapEYBTZfVwoVCoQ31l1PM7jbjX6tmy5hfvmSaaTZbWaSr +J2Bd2Tmc2sniQ1aVoMUdGwgYh0/GFW6TOszggwY/jWMwUh3OlU8l6leA5Ofyzjcxkv2 1cbQ== X-Forwarded-Encrypted: i=1; AFNElJ+fvQQEL4ajUPWspUr+ZNef7he0TyFzyneoSpjhnFIQPNebBVccbnCVE5HmLllaXqFxOPo85Yn6Fz0Gnjo=@vger.kernel.org X-Gm-Message-State: AOJu0Yz8HiCQ5JImpEd3veGYsnhFcynLCleDSlCaxRAQLEV0Nc7Qc1RC /3NadPoYiEqQs7853KjIIWuCjixnnl+brrGopFFqnLpwc5MSjsamA8io8kSMCFdFKw== X-Gm-Gg: AfdE7ckX7XMLRVi8MnZD/aIGdExvX6AfqOgrv/4jweGdpvr2DJKoyMxVwdAnQJF5Jor reDVuRFcSe/xor9Ai5+Kfrq4CaTW/IU0AdTqCvjbsx2dDXA1D28xw21xzmUpQVtVDpvaIiGQcqV lfm7kLONlnQgZBiCL6J7U+LN6DbOCjjFaoZAUyzxTpsBrZK+rG0NPHxlRjj94xnBp0P5yvkqFcL IWo3AvmVaCuyJwgNUvj0LmsY2xXRiyk/e/yGqmTJ10xZKh/t1oQ5/h5IpKJAM5IXM/gUBOn72o5 vIv+yFHJMgiPq2bAVKMp/Ii6zLhoCozphoyDtRpy9xCVHzfaDU5/FJl52dCCxpl0a63A7gUjwgf wf+WfXqNI2dpbbPvP/zixl524YaTHpWaxR93oSeoy9xXjNyP1MsipH4ZX32wA8pV9FFiDs2rKZa KrYzfq/1lvvwaKpdDSUZzzXl8A71Noo/6x+MjG6ASk1PK4Oso9V70PoRXsqc2AJvqXsz7tpbEjJ l5xdDeJX117yKg+7lnM X-Received: by 2002:a17:907:a78a:b0:c07:3582:bdb8 with SMTP id a640c23a62f3a-c0b6143ca3dmr529352166b.18.1782121162176; Mon, 22 Jun 2026 02:39:22 -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-c0c610e526asm324855566b.51.2026.06.22.02.39.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2026 02:39:21 -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 v2 3/3] usb: typec: displayport: Check cable altmode support Date: Mon, 22 Jun 2026 09:39:10 +0000 Message-ID: <20260622093910.1210089-4-akuchynski@chromium.org> X-Mailer: git-send-email 2.55.0.rc0.738.g0c8ab3ebcc-goog In-Reply-To: <20260622093910.1210089-1-akuchynski@chromium.org> References: <20260622093910.1210089-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.738.g0c8ab3ebcc-goog