Skip to content

Commit b08167d

Browse files
Prashant Malanigregkh
authored andcommitted
usb: typec: altmodes/displayport: Fix pin assignment calculation
commit 9682b41 upstream. Commit c1e5c2f ("usb: typec: altmodes/displayport: correct pin assignment for UFP receptacles") fixed the pin assignment calculation to take into account whether the peripheral was a plug or a receptacle. But the "pin_assignments" sysfs logic was not updated. Address this by using the macros introduced in the aforementioned commit in the sysfs logic too. Fixes: c1e5c2f ("usb: typec: altmodes/displayport: correct pin assignment for UFP receptacles") Cc: [email protected] Cc: Heikki Krogerus <[email protected]> Signed-off-by: Prashant Malani <[email protected]> Reviewed-by: Benson Leung <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7fb1322 commit b08167d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/typec/altmodes/displayport.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,9 @@ static const char * const pin_assignments[] = {
425425
static u8 get_current_pin_assignments(struct dp_altmode *dp)
426426
{
427427
if (DP_CONF_CURRENTLY(dp->data.conf) == DP_CONF_DFP_D)
428-
return DP_CAP_UFP_D_PIN_ASSIGN(dp->alt->vdo);
428+
return DP_CAP_PIN_ASSIGN_DFP_D(dp->alt->vdo);
429429
else
430-
return DP_CAP_DFP_D_PIN_ASSIGN(dp->alt->vdo);
430+
return DP_CAP_PIN_ASSIGN_UFP_D(dp->alt->vdo);
431431
}
432432

433433
static ssize_t

0 commit comments

Comments
 (0)