]> git.ipfire.org Git - thirdparty/linux.git/commit
usb: typec: ucsi: psy: Fix ucsi_psy_get_current_now in non-PD cases
authorBenson Leung <bleung@chromium.org>
Mon, 8 Dec 2025 17:48:47 +0000 (17:48 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Dec 2025 13:43:13 +0000 (14:43 +0100)
commit165fc0742b9c1d521d9482b9c43ed4755139f52e
treeeeaa08479fa83862994bbc3fbf9ff3e41e07014e
parentc616b709fa2391c48bab4eea3ec586bec27e0808
usb: typec: ucsi: psy: Fix ucsi_psy_get_current_now in non-PD cases

current_now would always return 0 in for non-PD power sources, and the
negotiated current based on the Request RDO in PD mode.

For USB Type-C current or legacy Default USB cases current_now will present
the max value of those modes, as that is the equivalent of the Request RDO
in PD.

Also, current_now will now return 0 when the port is disconnected to match
the same behavior of current_max.

Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://patch.msgid.link/20251208174918.289394-2-bleung@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/psy.c