0001
0002
0003
0004
0005
0006
0007 #include <linux/module.h>
0008 #include <linux/usb/typec_altmode.h>
0009 #include <linux/usb/typec_dp.h>
0010 #include "displayport.h"
0011
0012 static int nvidia_altmode_probe(struct typec_altmode *alt)
0013 {
0014 if (alt->svid == USB_TYPEC_NVIDIA_VLINK_SID)
0015 return dp_altmode_probe(alt);
0016 else
0017 return -ENOTSUPP;
0018 }
0019
0020 static void nvidia_altmode_remove(struct typec_altmode *alt)
0021 {
0022 if (alt->svid == USB_TYPEC_NVIDIA_VLINK_SID)
0023 dp_altmode_remove(alt);
0024 }
0025
0026 static const struct typec_device_id nvidia_typec_id[] = {
0027 { USB_TYPEC_NVIDIA_VLINK_SID, TYPEC_ANY_MODE },
0028 { },
0029 };
0030 MODULE_DEVICE_TABLE(typec, nvidia_typec_id);
0031
0032 static struct typec_altmode_driver nvidia_altmode_driver = {
0033 .id_table = nvidia_typec_id,
0034 .probe = nvidia_altmode_probe,
0035 .remove = nvidia_altmode_remove,
0036 .driver = {
0037 .name = "typec_nvidia",
0038 .owner = THIS_MODULE,
0039 },
0040 };
0041 module_typec_altmode_driver(nvidia_altmode_driver);
0042
0043 MODULE_LICENSE("GPL v2");
0044 MODULE_DESCRIPTION("NVIDIA USB Type-C Alt Mode Driver");