From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (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 0F7083F58F4 for ; Thu, 11 Jun 2026 12:22:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781180530; cv=none; b=f6F5ZR/NaeT2AgWgepWBlMpksdTMM8aL6gkmc3E5nzS54Mx5u8w9EFZjeqR8rtHkziLOGyzxFpzE/Z+MTlmckMSuATtZPGFR/XoS3ENPHEBDm+uMjG1TdCKvtWBtTYT9Z/AW3VJ61NI/MCR9Qq0T8INE+RWNvKZWIBJvaV6kPgI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781180530; c=relaxed/simple; bh=omjlL2gFyfPmmEjvHJqHfrd1oebp0ripdj1saowjmBM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XzhfwQUaS1UFY8JbewKCdj/XjVw/rvG1S7dYPXuJZnW8vC8yInq3AU+kadJJthZbxJ9piUrELpuu7t5sTVJIQxLRPQkSSeJJLdIhwJWkuOkmVoY48F3Fsr+NhkfF4pkkl7iAKDbbgF/yPR0x+wuIKzs+AyLC2YAA7G4biTFlhgY= 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=GU4qWzGW; arc=none smtp.client-ip=209.85.208.45 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="GU4qWzGW" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-68c19f1f3ceso12814316a12.2 for ; Thu, 11 Jun 2026 05:22:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1781180525; x=1781785325; 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=dU0WIeEmv4jADnoXKywHegSdnlv2E7AO+U74bqUHkI8=; b=GU4qWzGW80mUIingwO8viRrA7nf1ACexYYYmK70rBBnKuW9kFEeWMd0jTPaa4qZv9R Qgo/zA8C5LK5bJXTtlY+ISffZ5sAZiVm6fr5JXY5uq4/hxhrxGexDLI4lTAfWBfX7jcm xu8IXomdpjGyuh5yysOu07MjP026uoCvzMhFk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781180525; x=1781785325; 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=dU0WIeEmv4jADnoXKywHegSdnlv2E7AO+U74bqUHkI8=; b=BXO1e6rO4Qb5IpCZQ9J6cxYuQ73e3q/EVHE5ggp48qVb5cnzSq5CqgMJ8ytQ7z/zPP 9lP+iwp4NbsAYhM+c2gxu7zOsmgkOEKIXtJASiQvuB/nPlwCZBAZ+osUZ8S6bs1Zq5Xk RHEvVn3TwFpTg3vIrGhAFUNUfqyNl4DtQRYoTsIxQKGXlFm8GEKbNv3I9cD0NZ4BmZTk m0QvUHFyC/r7Q7M5xC4EnAzCAf9NCeNwsxkWg6UQjQK0NL++pFhYDO8xFJTmPguM1mIT jdph4URiiE5TDucbMK3qM+2eQHeMxzMzlr3OgxqHTYESBksdHtPZLYxcLmJXJ2x78YBA 5Erw== X-Forwarded-Encrypted: i=1; AFNElJ+vLonwAlA2gcF5y0cbpbGyQU8nnkXfo34yqVfaTM1zRi7WZ3KWYHPWyGAdH9Kq1HjsGSA2PiR9vr5lJ4g=@vger.kernel.org X-Gm-Message-State: AOJu0YwsXX9+ujyZOGOC6nEEIUW8m6R8/WMSi6fFDEYxKNKDYyiPsWUp rfPe5iPfWT3geuTEhYZr+wgZCKwsmYZJ+7Rm1IrPOm92+tkQTTfa2qlnNTHeYG4DBg== X-Gm-Gg: Acq92OGU5WdcqiVstCh9FTUi9wvn1LQRhoMcLN71sLY9/lVQBg80iyo7zUyFOrzKuXI 7+7LCSMq4t1lup9+Y4mO6bmoLRyk9Enm4xyXcCcGfgxjVaSeFDcVJaN33YDoB9opRP7ksmzcNlf 6XwH5dh6GaEDnju8lO7empfPb6xtKazVJ1apAPwSRJhaIWlTAjF2J1nmiWNpzeP2fr6b4PReYyA ZWmxiSlszGXT+pnjQj70RLb/1DFLjEWRJ2+NQpZjzOAssTZ/yp1t7TNO+lyoZVtHzAYx2cv+Kg0 h3a+KwuMh0xydt/nWfzN7O4CKnnSeSNs3DnpJ1cT+4bt9il1gTf1fUYYn0tAkWfItBm+N2EIwOl FV1NDm4oSnjIPQAH/Xzn+DLeujDMox4aSdONFalH3PIwMI/LH47nq9sGILd2JL/sfIxod7J/x4I 4w5fdxKDrzUN0R99cj/gh3WiI9t4/6CX+qpSAzaoxvUFbaogw1XqBq/Mn5mTdvqqncAqyACpU67 ERw60WC82+ITV/HCNa/7SFAxyfTB1g= X-Received: by 2002:a05:6402:51cb:b0:68a:de40:26e4 with SMTP id 4fb4d7f45d1cf-6930e30d09amr1121873a12.25.1781180525179; Thu, 11 Jun 2026 05:22:05 -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 4fb4d7f45d1cf-6914f3b583bsm6853113a12.29.2026.06.11.05.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2026 05:22:04 -0700 (PDT) From: Andrei Kuchynski To: Heikki Krogerus Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Andrei Kuchynski Subject: [PATCH v1 3/3] usb: typec: displayport: Check cable altmode support Date: Thu, 11 Jun 2026 12:21:46 +0000 Message-ID: <20260611122146.262184-4-akuchynski@chromium.org> X-Mailer: git-send-email 2.54.0.1099.g489fc7bff1-goog In-Reply-To: <20260611122146.262184-1-akuchynski@chromium.org> References: <20260611122146.262184-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 --- 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.54.0.1099.g489fc7bff1-goog