Commit Graph

14 Commits

Author SHA1 Message Date
Kyle Tso 4c93cad8cc usb: typec: displayport: Fill the negotiated SVDM Version in the header
VDM header now requires SVDM Version. Get it from typec_partner.

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210205033415.3320439-6-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-09 11:48:55 +01:00
Kyle Tso 31737c27d6 usb: pd: Make SVDM Version configurable in VDM header
PD Rev 3.0 introduces SVDM Version 2.0. This patch makes the field
configuable in the header in order to be able to be compatible with
older SVDM version.

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210205033415.3320439-3-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-09 11:48:54 +01:00
Peter Robinson 41952a6601 usb: typec: Fix copy paste error for NVIDIA alt-mode description
The name of the module for the NVIDIA alt-mode is incorrect as it
looks to be a copy-paste error from the entry above, update it to
the correct typec_nvidia module name.

Cc: Ajay Gupta <ajayg@nvidia.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Link: https://lore.kernel.org/r/20210106001605.167917-1-pbrobinson@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-07 14:19:12 +01:00
Heikki Krogerus 5789051fc5 usb: typec: displayport: Reduce noise from the driver
It's not an error if the mode can't be entered because
another mode is already active, so no longer printing an
error message if that happens.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20200928133324.48841-1-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-02 11:30:10 +02:00
Lee Jones 318ebed297 usb: typec: altmodes: displayport: Supply missing displayport.h include file
If the header file containing a function's prototype isn't included by
the sourcefile containing the associated function, the build system
complains of missing prototypes.

Fixes the following W=1 kernel build warning(s):

 drivers/usb/typec/altmodes/displayport.c:511:5: warning: no previous prototype for ‘dp_altmode_probe’ [-Wmissing-prototypes]
 drivers/usb/typec/altmodes/displayport.c:551:6: warning: no previous prototype for ‘dp_altmode_remove’ [-Wmissing-prototypes]

Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20200703174148.2749969-22-lee.jones@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-09 16:46:59 +02:00
Lee Jones 50c9bd05df usb: typec: altmodes: displayport: File headers are not good candidates for kerneldoc
Demote displayport's file header to a standard comment block.

Fixes the following W=1 kernel build warning(s):

 drivers/usb/typec/altmodes/displayport.c:18: warning: Function parameter or member '_dp' not described in 'DP_HEADER'
 drivers/usb/typec/altmodes/displayport.c:18: warning: Function parameter or member 'cmd' not described in 'DP_HEADER'

Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20200703174148.2749969-21-lee.jones@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-09 16:46:59 +02:00
Heikki Krogerus 8face9aa57 usb: typec: Add parameter for the VDO to typec_altmode_enter()
Enter Mode Command may contain one VDO.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20191230142611.24921-3-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-09 10:48:19 +01:00
Ajay Gupta cf28369c63 usb: typec: Add driver for NVIDIA Alt Modes
Latest NVIDIA GPUs support VirtualLink device. Since USBIF
has not assigned a Standard ID (SID) for VirtualLink
so using NVIDA VID 0x955 as SVID.

Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25 11:04:56 +02:00
Ajay Gupta d266e96820 usb: typec: displayport: Export probe and remove functions
VirtualLink standard extends the DisplayPort Alt Mode by
utilizing also the USB 2 pins on the USB Type-C connector.
It uses the same messages as DisplayPort, but not the DP
SVID. At the time of writing, USB IF has not assigned a
Standard ID (SID) for VirtualLink, so the manufacturers of
VirtualLink adapters use their Vendor IDs as the SVID.

Since the SVID specific communication is exactly the same as
with DisplayPort alternate mode, there is no need to
implement separate driver for VirtualLink. We'll handle the
current VirtualLink adapters with probe drivers, and once
there is SVID assigned for it, we add it to the displayport
alt mode driver.

To support probing drivers, exporting the probe and remove
functions, and also changing the DP_HEADER helper macro to
use the SVID of the alternate mode device instead of the
DisplayPort alt mode SVID.

Suggested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25 11:04:55 +02:00
Hans de Goede 09fed4d64d usb: typec: altmodes/displayport: Fall back to multi-func pins
If our port-partner supports both DP-only operation (pin-assignment C)
and multi-func operation (pin-assignment D) and we only support
pin-assignment D and the port-partner prefers DP-only mode, then
before this commit we would and up masking out pin-assignment D from
the available pin-assignments and fail to pick a pin-assignment.

Instead only mask out the multi-func pin-assignments if we support
dp-only pin-assignments, so that we correctly fall-back to a multi-func
pin-assignment in this case (by picking pin-assignment D).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-19 15:00:34 +01:00
Heikki Krogerus 382e8fa80d usb: typec: displayport: Move the Configuration VDO helpers to the header
The helpers used for reading and writing the pin assignment
from and to the Configuration VDO will be useful in GPU
drivers, and also UCSI driver after DisplayPort alt mode
support is added to it.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-08 10:25:12 +01:00
Greg Kroah-Hartman cae8dc3b68 USB: add missing SPDX lines to Kconfig and Makefiles
There are a few remaining drivers/usb/ files that do not have SPDX
identifiers in them, all of these are either Kconfig or Makefiles.  Add
the correct GPL-2.0 identifier to them to make scanning tools happy.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-22 09:08:17 +01:00
Colin Ian King 98a1a0c7a3 usb: typec: unlock dp->lock on error exit path, and also zero ret if successful
One of the error handling paths forgets to unlock dp->lock on the error
exit path leading to a potential lock-up.  Also the return path for a
successful call to the function configuration_store can return an
uninitialized error return code if dp->alt->active is false, so ensure
ret is zeroed on the successful exit path to avoid garbage being returned.

Detected by CoverityScan, CID#1471597 ("Unitialized scalar variable")

Fixes: 0e3bb7d689 ("usb: typec: Add driver for DisplayPort alternate mode")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-06 16:36:19 +02:00
Heikki Krogerus 0e3bb7d689 usb: typec: Add driver for DisplayPort alternate mode
DisplayPort USB Type-C Alt Mode allows DisplayPort displays
and adapters to be attached to the USB Type-C ports on the
system.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-02 17:42:36 +02:00