usb: typec: tcpm: Refactor the PPS APDO selection
authorKyle Tso <kyletso@google.com>
Mon, 31 Jul 2023 16:21:59 +0000 (00:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Aug 2023 12:47:02 +0000 (14:47 +0200)
commit40f362ffa5e9ddf413825c99e9121db0ab59301f
tree2d47d777f4dedb3c9cf8f375b90af691e7ca4e7b
parentf2e5812fb4fb2bef665bd86dc579b292faae2029
usb: typec: tcpm: Refactor the PPS APDO selection

In current design of the PPS APDO selection, TCPM power supply only
accepts the requested voltage which is inside the range of the selected
PPS profile. To extend the flexibility and usability, remove the checks
about the voltage range in current profile. And try to search all PPS
APDOs of the Source that fit the requested voltage.

Also remove some redundant checks in tcpm_pd_build_pps_request.

Signed-off-by: Kyle Tso <kyletso@google.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230731162159.19483-1-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c