Skip to content

Commit 9682b41

Browse files
Prashant Malanigregkh
authored andcommitted
usb: typec: altmodes/displayport: Fix pin assignment calculation
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 582836e commit 9682b41

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
@@ -426,9 +426,9 @@ static const char * const pin_assignments[] = {
426426
static u8 get_current_pin_assignments(struct dp_altmode *dp)
427427
{
428428
if (DP_CONF_CURRENTLY(dp->data.conf) == DP_CONF_DFP_D)
429-
return DP_CAP_UFP_D_PIN_ASSIGN(dp->alt->vdo);
429+
return DP_CAP_PIN_ASSIGN_DFP_D(dp->alt->vdo);
430430
else
431-
return DP_CAP_DFP_D_PIN_ASSIGN(dp->alt->vdo);
431+
return DP_CAP_PIN_ASSIGN_UFP_D(dp->alt->vdo);
432432
}
433433

434434
static ssize_t

0 commit comments

Comments
 (0)