summaryrefslogtreecommitdiffstats
path: root/drivers/usb/typec/ucsi/ucsi.c
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2024-03-29 08:15:33 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-04 17:07:03 +0200
commit897d68d4ce7d50ca45a31e10c0e61597257b32d3 (patch)
tree981270f373a11dab061e4f705e6b41f671f53a20 /drivers/usb/typec/ucsi/ucsi.c
parentdb2ed6ec11a887dabffef0d5354e32902b704047 (diff)
downloadlinux-stable-897d68d4ce7d50ca45a31e10c0e61597257b32d3.tar.gz
linux-stable-897d68d4ce7d50ca45a31e10c0e61597257b32d3.tar.bz2
linux-stable-897d68d4ce7d50ca45a31e10c0e61597257b32d3.zip
usb: typec: ucsi: allow non-partner GET_PDOS for Qualcomm devices
The name and description of the USB_NO_PARTNER_PDOS quirk specifies that only retrieving PDOS of the attached device is crashing. Retrieving PDOS of the UCSI device works. Fix the condition to limit the workaround only to is_partner cases. Fixes: 1d103d6af241 ("usb: typec: ucsi: fix UCSI on buggy Qualcomm devices") Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20240329-qcom-ucsi-fixes-v2-1-0f5d37ed04db@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/typec/ucsi/ucsi.c')
-rw-r--r--drivers/usb/typec/ucsi/ucsi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index f7157215eed6..29a7d71c9a40 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -619,7 +619,8 @@ static int ucsi_read_pdos(struct ucsi_connector *con,
u64 command;
int ret;
- if (ucsi->quirks & UCSI_NO_PARTNER_PDOS)
+ if (is_partner &&
+ ucsi->quirks & UCSI_NO_PARTNER_PDOS)
return 0;
command = UCSI_COMMAND(UCSI_GET_PDOS) | UCSI_CONNECTOR_NUMBER(con->num);