[SRU][Q][PATCH 2/2] usb: typec: ucsi: Add check for UCSI version

AceLan Kao acelan.kao at canonical.com
Mon Jan 12 01:06:54 UTC 2026


From: Venkat Jayaraman <venkat.jayaraman at intel.com>

BugLink: https://bugs.launchpad.net/bugs/2138192

"Power Reading" bit is introduced in UCSI v2.1 and so limit the
check for that bit only if version supported is 2.1 or above.

Fixes: c851b71fd6cd ("usb: typec: ucsi: Add support for READ_POWER_LEVEL command")
Signed-off-by: Venkat Jayaraman <venkat.jayaraman at intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus at linux.intel.com>
Link: https://lore.kernel.org/r/20250905184401.3222530-1-venkat.jayaraman@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
(cherry picked from commit 1bc28f015a19a10b7a305fc561c1143c34a1e04a)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao at canonical.com>
---
 drivers/usb/typec/ucsi/ucsi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 0d6b0cf5a7cd7..3f568f790f39b 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1293,7 +1293,8 @@ static void ucsi_handle_connector_change(struct work_struct *work)
 	if (change & UCSI_CONSTAT_BC_CHANGE)
 		ucsi_port_psy_changed(con);

-	if (UCSI_CONSTAT(con, PWR_READING_READY_V2_1)) {
+	if (con->ucsi->version >= UCSI_VERSION_2_1 &&
+	    UCSI_CONSTAT(con, PWR_READING_READY_V2_1)) {
 		curr_scale = UCSI_CONSTAT(con, CURRENT_SCALE_V2_1);
 		volt_scale = UCSI_CONSTAT(con, VOLTAGE_SCALE_V2_1);

--
2.51.0




More information about the kernel-team mailing list