diff options
| author | Dmitry Baryshkov <[email protected]> | 2024-03-29 08:15:34 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2024-04-04 17:07:03 +0200 |
| commit | 2a2eec558ec1a21c6263e291287ffa91c082e46a (patch) | |
| tree | f30d0be01b4319b624f04a3df3a5cc499c04db74 | |
| parent | 897d68d4ce7d50ca45a31e10c0e61597257b32d3 (diff) | |
usb: typec: ucsi: limit the UCSI_NO_PARTNER_PDOS even further
Reading Partner Source PDOs for the consumer Connectors appears to be
working. Permit getting PDOs in this case in order to populate
capabilities of the connected power supply in the sysfs.
Reviewed-by: Heikki Krogerus <[email protected]>
Signed-off-by: Dmitry Baryshkov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
| -rw-r--r-- | drivers/usb/typec/ucsi/ucsi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 29a7d71c9a40..cd0ed3938c21 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -620,7 +620,9 @@ static int ucsi_read_pdos(struct ucsi_connector *con, int ret; if (is_partner && - ucsi->quirks & UCSI_NO_PARTNER_PDOS) + ucsi->quirks & UCSI_NO_PARTNER_PDOS && + ((con->status.flags & UCSI_CONSTAT_PWR_DIR) || + !is_source(role))) return 0; command = UCSI_COMMAND(UCSI_GET_PDOS) | UCSI_CONNECTOR_NUMBER(con->num); |