Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: typec: altmodes/displayport: Fix pin assignment calculation

Commit c1e5c2f0cb8a ("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: c1e5c2f0cb8a ("usb: typec: altmodes/displayport: correct pin assignment for UFP receptacles")
Cc: stable@vger.kernel.org
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Prashant Malani <pmalani@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20230111020546.3384569-2-pmalani@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Prashant Malani and committed by
Greg Kroah-Hartman
9682b41e 582836e3

+2 -2
+2 -2
drivers/usb/typec/altmodes/displayport.c
··· 426 426 static u8 get_current_pin_assignments(struct dp_altmode *dp) 427 427 { 428 428 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); 430 430 else 431 - return DP_CAP_DFP_D_PIN_ASSIGN(dp->alt->vdo); 431 + return DP_CAP_PIN_ASSIGN_UFP_D(dp->alt->vdo); 432 432 } 433 433 434 434 static ssize_t