Skip to content

FROMLIST: usb: typec: altmodes/displayport: correct pin assignment for UFP receptacles

Fix incorrect pin assignment values when connecting to a monitor with Type-C receptacle instead of a plug.

According to specification, an UFP_D receptacle's pin assignment should came from the UFP_D pin assignments field (bit 23:16), while an UFP_D plug's assignments are described in the DFP_D pin assignments (bit 15:8) during Mode Discovery.

For example the LG 27 UL850-W is a monitor with Type-C receptacle. The monitor responds to MODE DISCOVERY command with following DisplayPort Capability flag:

    dp->alt->vdo=0x140045

The existing logic only take cares of UPF_D plug case, and would take the bit 15:8 for this 0x140045 case.

This results in an non-existing pin assignment 0x0 in dp_altmode_configure.

To fix this problem a new set of macros are introduced to take plug/receptacle differences into consideration. Signed-off-by: Pablo Sun's avatarPablo Sun pablo.sun@mediatek.com Link: https://lore.kernel.org/all/20220727110503.5260-1-macpaul.lin@mediatek.com/ Bug: AIOT-1216

Edited by Pablo Sun

Merge request reports