linux-stable/include/linux/usb
Pablo Sun c1e5c2f0cb 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.

Fixes: 0e3bb7d689 ("usb: typec: Add driver for DisplayPort alternate mode")
Cc: stable@vger.kernel.org
Co-developed-by: Pablo Sun <pablo.sun@mediatek.com>
Co-developed-by: Macpaul Lin <macpaul.lin@mediatek.com>
Reviewed-by: Guillaume Ranquet <granquet@baylibre.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Pablo Sun <pablo.sun@mediatek.com>
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Link: https://lore.kernel.org/r/20220804034803.19486-1-macpaul.lin@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-18 21:20:07 +02:00
..
audio-v2.h
audio-v3.h
audio.h
c67x00.h
ccid.h
cdc-wdm.h
cdc.h
cdc_ncm.h
ch9.h
chipidea.h
composite.h
ehci-dbgp.h
ehci_def.h
ehci_pdriver.h
ezusb.h
functionfs.h
g_hid.h
gadget.h
gadget_configfs.h
hcd.h SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
input.h
iowarrior.h
irda.h
isp116x.h
isp1301.h
isp1362.h
m66592.h
musb-ux500.h
musb.h
net2280.h
of.h
ohci_pdriver.h
onboard_hub.h
otg-fsm.h
otg.h
pd.h
pd_ado.h
pd_bdo.h
pd_ext_sdb.h
pd_vdo.h
phy.h
phy_companion.h
quirks.h
r8a66597.h
r8152.h
renesas_usbhs.h
rndis_host.h
role.h
serial.h
sl811.h
storage.h
tcpci.h
tcpm.h
tegra_usb_phy.h
typec.h
typec_altmode.h
typec_dp.h usb: typec: altmodes/displayport: correct pin assignment for UFP receptacles 2022-08-18 21:20:07 +02:00
typec_mux.h
typec_retimer.h
typec_tbt.h
uas.h
ulpi.h
usb338x.h
usb_phy_generic.h
usbnet.h SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
xhci-dbgp.h