usb: typec: ucsi: support delaying GET_PDOS for device
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fri, 29 Mar 2024 06:15:39 +0000 (08:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Apr 2024 15:07:03 +0000 (17:07 +0200)
commit16cad519984140340375af6e0da7ef66d8a87193
tree357fd3ad87bbfcebabf2c924b236a1a660fd2145
parentad4bc68bef3e5b54a70ea60b60bc20032d508992
usb: typec: ucsi: support delaying GET_PDOS for device

Qualcomm firmware doesn't return sane information for device's PDOs
unless the partner is also using a PD mode. On SC8280XP this even
results in the Error bit being set in the UCSI response (with 0 error
status).

Add a quirk to delay reading USB PD capabilities for a device until we
detect a partner in PD mode.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240329-qcom-ucsi-fixes-v2-7-0f5d37ed04db@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi.c
drivers/usb/typec/ucsi/ucsi.h