aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Thomson <Adam.Thomson.Opensource@diasemi.com>2018-09-21 11:04:11 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-02 15:05:30 -0400
commit1b6af2f58c2b1522e0804b150ca95e50a9e80ea7 (patch)
tree650d9bfe23eaeb90d953ab6a45918f19b95ca618
parente0a2e73e501c77037c8756137e87b12c7c3c9793 (diff)
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: 2eadc33f40d4 ("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>
-rw-r--r--drivers/usb/typec/tcpm/tcpm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index 4f1f4215f3d6..c11b3befa87f 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -1430,8 +1430,8 @@ static enum pdo_err tcpm_caps_err(struct tcpm_port *port, const u32 *pdo,
1430 if (pdo_apdo_type(pdo[i]) != APDO_TYPE_PPS) 1430 if (pdo_apdo_type(pdo[i]) != APDO_TYPE_PPS)
1431 break; 1431 break;
1432 1432
1433 if (pdo_pps_apdo_max_current(pdo[i]) < 1433 if (pdo_pps_apdo_max_voltage(pdo[i]) <
1434 pdo_pps_apdo_max_current(pdo[i - 1])) 1434 pdo_pps_apdo_max_voltage(pdo[i - 1]))
1435 return PDO_ERR_PPS_APDO_NOT_SORTED; 1435 return PDO_ERR_PPS_APDO_NOT_SORTED;
1436 else if (pdo_pps_apdo_min_voltage(pdo[i]) == 1436 else if (pdo_pps_apdo_min_voltage(pdo[i]) ==
1437 pdo_pps_apdo_min_voltage(pdo[i - 1]) && 1437 pdo_pps_apdo_min_voltage(pdo[i - 1]) &&