Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: typec: ucsi: Add check for UCSI version

"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@intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20250905184401.3222530-1-venkat.jayaraman@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Venkat Jayaraman and committed by
Greg Kroah-Hartman
1bc28f01 87c5ff56

+2 -1
+2 -1
drivers/usb/typec/ucsi/ucsi.c
··· 1293 1293 if (change & UCSI_CONSTAT_BC_CHANGE) 1294 1294 ucsi_port_psy_changed(con); 1295 1295 1296 - if (UCSI_CONSTAT(con, PWR_READING_READY_V2_1)) { 1296 + if (con->ucsi->version >= UCSI_VERSION_2_1 && 1297 + UCSI_CONSTAT(con, PWR_READING_READY_V2_1)) { 1297 1298 curr_scale = UCSI_CONSTAT(con, CURRENT_SCALE_V2_1); 1298 1299 volt_scale = UCSI_CONSTAT(con, VOLTAGE_SCALE_V2_1); 1299 1300