From nobody Sun Jun 14 12:44:01 2026 Received: from mail-dy1-f202.google.com (mail-dy1-f202.google.com [74.125.82.202]) (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 EFDE6364055 for ; Thu, 2 Apr 2026 18:24:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775154285; cv=none; b=t4VkKfVBHniVSm4EGlFBRbSn2pxXPIkqmS3aWBAIyEqYfilCMscOPMnXTIWRQTtFTDUWKcy3+7oc64r9dDVeWLMTvydXJ1R9lhcbKB6+c55O+1YvLvaWlxIVzwy0sz041QFbHL6L3K4yWKJ3kdMfYHQbcrlTN/D/2TNVwHIALN0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775154285; c=relaxed/simple; bh=neDYEmiq1jNlLVPfYr/DxMz6+oxLr+J/ArGBVyjHcfA=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=thNNkFtY6Cd5wqcT/1zwINmJ4EVr7RU/TCAVor2fFpfjPMKMBLaaBWw4d3Iff8/GLG29irGiZHzFaDrOwrtLvLVZKd7dWyLlC1viutyXuO/EYKZ6uMTyboux3mgT68bNiiVfKK6ubIFvlwXHNZimlOAfRAGv7QV+AbNR/dG1wnc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jthies.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=wYkCW+Jq; arc=none smtp.client-ip=74.125.82.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jthies.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="wYkCW+Jq" Received: by mail-dy1-f202.google.com with SMTP id 5a478bee46e88-2c4cfe08c9dso6992498eec.1 for ; Thu, 02 Apr 2026 11:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1775154283; x=1775759083; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=H/GppnI5PJ9zcCt0/6kmbzD7q0Lab98aUuQ2hUohGxQ=; b=wYkCW+JqeoqqGckP8JBdNfVLuxVbo9dM3zu1Gb5A9t7QzjIGx//pEefKCgMtJyXVbT VvpkBWdmQEfynJ02oDxms02NrpMCdVGwBqkHDmH8FPXnAgEk+aadLQcgNygZ2p0znDHj bB+udLJDWAZ621HYI01v37Nlw6ejRvBTHXYitTu3TwAAVIn2CHy1hJT6oY7A1wvFVBud 8ijEVT5uA4IV42J6r+YLGBmfb9RQrO4gJx9ewot5dHeYBbfauTXF9M+ABGfxfW0NWau7 Z7AUkseXvAGLC5o4QchTYBjOBMMSe26hMib6khYenqRytGjWI68qbdbrTigydpnOl38q HdGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775154283; x=1775759083; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=H/GppnI5PJ9zcCt0/6kmbzD7q0Lab98aUuQ2hUohGxQ=; b=prrwpGeev8xU9rtfzGVSD2zKT0sWE5PEeQ9PQ9MlWhJb8021lAGpUaNeqdkOmjsjGO 9IGF0U3cdIvCW1ff/yERCrSJmnUrt/OPlKpW2s4wegd4pWH0K/41GMvPdqtCrGs4hhzI KUieW9Y89jhJGgD3G6EgrKSbzJtf9QMm/i7TSdbGlcuAnqKmy58EBk2ZZY6y0djbvcEa KyshAGhwfo2cw7Po0LZG1sXtGXSuq1Ox8JL+i8tbRQv5Bo4USbAhpV++f7OF1aY6vd2g Gu8axn+EUApY06G72DUkGFEeCRx+JBdGq4q2EzAcYpPVA8YwJvrJyhqKtb320VIWJu9W 6oHg== X-Forwarded-Encrypted: i=1; AJvYcCUqFV3+5FEwSb2zO47JWGhSxKcNVjy6riKyF/R08ZajVm676+m5XUNz2Z2T06ESreBjy4hvcZMx/S+6Z90=@vger.kernel.org X-Gm-Message-State: AOJu0YyHwAlmy33hnxK5OKWFQCk6/XhnDcg1xHmy0KJ7YPUCyof4a9DM uFIIjt2/umzsvulIvAPHaYYtpCv1CrolaCTjw79yderX26ecXZHnMCfe2dJqUGqiEYw25YNfBYu p75deXQ== X-Received: from dycmz22.prod.google.com ([2002:a05:7300:ea16:b0:2cb:45a9:2264]) (user=jthies job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7301:1688:b0:2c6:cdb3:bd5e with SMTP id 5a478bee46e88-2cbfc365473mr100512eec.28.1775154282763; Thu, 02 Apr 2026 11:24:42 -0700 (PDT) Date: Thu, 2 Apr 2026 18:24:38 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.53.0.1213.gd9a14994de-goog Message-ID: <20260402182438.867396-1-jthies@google.com> Subject: [PATCH v1] usb: typec: ucsi: Set usb mode on partner change From: Jameson Thies To: heikki.krogerus@linux.intel.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dmitry.baryshkov@oss.qualcomm.com, bleung@chromium.org, gregkh@linuxfoundation.org, akuchynski@chromium.org, abhishekpandit@chromium.org, Jameson Thies Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently the partner usb_mode is only set in ucsi_register_partner(). If the partner enters USB4 operation after it is registered, this is not reported to the typec class. The UCSI spec states that the Connector Partner Changed bit can represent a Connector Partner Flags change. When handling a UCSI partner change, check the partner flags for USB4 operation. Signed-off-by: Jameson Thies Reviewed-by: Benson Leung Reviewed-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index fe1fb8a68a1d..e6fd2e2eba94 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -1182,6 +1182,12 @@ static void ucsi_partner_change(struct ucsi_connecto= r *con) if (UCSI_CONSTAT(con, PARTNER_FLAG_USB)) typec_set_mode(con->port, TYPEC_STATE_USB); } + + if (((con->ucsi->version >=3D UCSI_VERSION_3_0 && + UCSI_CONSTAT(con, PARTNER_FLAG_USB4_GEN4)) || + (con->ucsi->version >=3D UCSI_VERSION_2_0 && + UCSI_CONSTAT(con, PARTNER_FLAG_USB4_GEN3))) && con->partner) + typec_partner_set_usb_mode(con->partner, USB_MODE_USB4); } =20 if ((!UCSI_CONSTAT(con, PARTNER_FLAG_USB)) && base-commit: 81ebd43cc0d6d106ce7b6ccbf7b5e40ca7f5503d --=20 2.53.0.1213.gd9a14994de-goog