Skip to content

Commit 374157f

Browse files
Badhri Jagan Sridharangregkh
authored andcommitted
usb: typec: tcpm: Fix error while calculating PPS out values
"usb: typec: tcpm: Address incorrect values of tcpm psy for pps supply" introduced a regression for req_out_volt and req_op_curr calculation. req_out_volt should consider the newly calculated max voltage instead of previously accepted max voltage by the port partner. Likewise, req_op_curr should consider the newly calculated max current instead of previously accepted max current by the port partner. Fixes: e3a0720 ("usb: typec: tcpm: Address incorrect values of tcpm psy for pps supply") Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Badhri Jagan Sridharan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4b853c2 commit 374157f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/usb/typec/tcpm/tcpm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3138,10 +3138,10 @@ static unsigned int tcpm_pd_select_pps_apdo(struct tcpm_port *port)
31383138
port->pps_data.req_max_volt = min(pdo_pps_apdo_max_voltage(src),
31393139
pdo_pps_apdo_max_voltage(snk));
31403140
port->pps_data.req_max_curr = min_pps_apdo_current(src, snk);
3141-
port->pps_data.req_out_volt = min(port->pps_data.max_volt,
3142-
max(port->pps_data.min_volt,
3141+
port->pps_data.req_out_volt = min(port->pps_data.req_max_volt,
3142+
max(port->pps_data.req_min_volt,
31433143
port->pps_data.req_out_volt));
3144-
port->pps_data.req_op_curr = min(port->pps_data.max_curr,
3144+
port->pps_data.req_op_curr = min(port->pps_data.req_max_curr,
31453145
port->pps_data.req_op_curr);
31463146
}
31473147

0 commit comments

Comments
 (0)