Skip to content

Commit 1b6af2f

Browse files
Adam Thomsongregkh
authored andcommitted
usb: typec: tcpm: Fix APDO PPS order checking to be based on voltage
Current code mistakenly checks against max current to determine order but this should be max voltage. This commit fixes the issue so order is correctly determined, thus avoiding failure based on a higher voltage PPS APDO having a lower maximum current output, which is actually valid. Fixes: 2eadc33 ("typec: tcpm: Add core support for sink side PPS") Cc: <stable@vger.kernel.org> Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e0a2e73 commit 1b6af2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/typec/tcpm/tcpm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,8 +1430,8 @@ static enum pdo_err tcpm_caps_err(struct tcpm_port *port, const u32 *pdo,
14301430
if (pdo_apdo_type(pdo[i]) != APDO_TYPE_PPS)
14311431
break;
14321432

1433-
if (pdo_pps_apdo_max_current(pdo[i]) <
1434-
pdo_pps_apdo_max_current(pdo[i - 1]))
1433+
if (pdo_pps_apdo_max_voltage(pdo[i]) <
1434+
pdo_pps_apdo_max_voltage(pdo[i - 1]))
14351435
return PDO_ERR_PPS_APDO_NOT_SORTED;
14361436
else if (pdo_pps_apdo_min_voltage(pdo[i]) ==
14371437
pdo_pps_apdo_min_voltage(pdo[i - 1]) &&

0 commit comments

Comments
 (0)