-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Ajay Gupta
authored and
Greg Kroah-Hartman
committed
Apr 25, 2019
1 parent
d266e96
commit cf28369
Showing
5 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/* | ||
* Copyright (C) 2019 NVIDIA Corporation. All rights reserved. | ||
* | ||
* NVIDIA USB Type-C Alt Mode Driver | ||
*/ | ||
#include <linux/module.h> | ||
#include <linux/usb/typec_altmode.h> | ||
#include <linux/usb/typec_dp.h> | ||
#include "displayport.h" | ||
|
||
static int nvidia_altmode_probe(struct typec_altmode *alt) | ||
{ | ||
if (alt->svid == USB_TYPEC_NVIDIA_VLINK_SID) | ||
return dp_altmode_probe(alt); | ||
else | ||
return -ENOTSUPP; | ||
} | ||
|
||
static void nvidia_altmode_remove(struct typec_altmode *alt) | ||
{ | ||
if (alt->svid == USB_TYPEC_NVIDIA_VLINK_SID) | ||
dp_altmode_remove(alt); | ||
} | ||
|
||
static const struct typec_device_id nvidia_typec_id[] = { | ||
{ USB_TYPEC_NVIDIA_VLINK_SID, TYPEC_ANY_MODE }, | ||
{ }, | ||
}; | ||
MODULE_DEVICE_TABLE(typec, nvidia_typec_id); | ||
|
||
static struct typec_altmode_driver nvidia_altmode_driver = { | ||
.id_table = nvidia_typec_id, | ||
.probe = nvidia_altmode_probe, | ||
.remove = nvidia_altmode_remove, | ||
.driver = { | ||
.name = "typec_nvidia", | ||
.owner = THIS_MODULE, | ||
}, | ||
}; | ||
module_typec_altmode_driver(nvidia_altmode_driver); | ||
|
||
MODULE_LICENSE("GPL v2"); | ||
MODULE_DESCRIPTION("NVIDIA USB Type-C Alt Mode Driver"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters