usb: typec: tcpm: Fix error while calculating PPS out values
authorBadhri Jagan Sridharan <badhri@google.com>
Thu, 15 Apr 2021 05:01:21 +0000 (22:01 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:29:57 +0000 (10:29 +0200)
commit7c019a7f2a01855e77b2c026fc3b4418f79d6084
treedef6e7514fb767977112e5d5638488655a03139c
parent67c080e011c4026a8becf3cdab29d4e1169b4634
usb: typec: tcpm: Fix error while calculating PPS out values

commit 374157ff88ae1a7f7927331cbc72c1ec11994e8a upstream.

"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: e3a072022487 ("usb: typec: tcpm: Address incorrect values of tcpm psy for pps supply")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://lore.kernel.org/r/20210415050121.1928298-1-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c