]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: typec: ucsi: Report power supply change on sink path change
authorJameson Thies <jthies@google.com>
Thu, 16 Oct 2025 23:59:09 +0000 (23:59 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Oct 2025 08:58:31 +0000 (10:58 +0200)
Update the UCSI interface driver to report a power supply change when
the PPM sets the Sink Path Change bit.

Signed-off-by: Jameson Thies <jthies@google.com>
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-By: Kenneth R. Crudup <kenny@panix.com>
Link: https://patch.msgid.link/20251016235909.2092917-4-jthies@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi.c
drivers/usb/typec/ucsi/ucsi.h

index 04047038720e86b091187dc08ec14c27458711f5..ed23edab776354f08452c539d75d27132b8c44dd 100644 (file)
@@ -1293,7 +1293,7 @@ static void ucsi_handle_connector_change(struct work_struct *work)
        if (change & UCSI_CONSTAT_CAM_CHANGE)
                ucsi_partner_task(con, ucsi_check_altmodes, 1, HZ);
 
-       if (change & UCSI_CONSTAT_BC_CHANGE)
+       if (change & (UCSI_CONSTAT_BC_CHANGE | UCSI_CONSTAT_SINK_PATH_CHANGE))
                ucsi_port_psy_changed(con);
 
        if (con->ucsi->version >= UCSI_VERSION_2_1 &&
index cce93af7461b9f806b9e67704642ee25cc901183..35993bc34d4d59c9e795aa789211562229f5de78 100644 (file)
@@ -382,6 +382,7 @@ struct ucsi_cable_property {
 #define UCSI_CONSTAT_BC_CHANGE                 BIT(9)
 #define UCSI_CONSTAT_PARTNER_CHANGE            BIT(11)
 #define UCSI_CONSTAT_POWER_DIR_CHANGE          BIT(12)
+#define UCSI_CONSTAT_SINK_PATH_CHANGE          BIT(13)
 #define UCSI_CONSTAT_CONNECT_CHANGE            BIT(14)
 #define UCSI_CONSTAT_ERROR                     BIT(15)