2 #include <drm/drm_usb.h>
4 #include <linux/module.h>
6 int drm_get_usb_dev(struct usb_interface
*interface
,
7 const struct usb_device_id
*id
,
8 struct drm_driver
*driver
)
10 struct drm_device
*dev
;
15 dev
= drm_dev_alloc(driver
, &interface
->dev
);
19 dev
->usbdev
= interface_to_usbdev(interface
);
20 usb_set_intfdata(interface
, dev
);
22 ret
= drm_dev_register(dev
, 0);
26 DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
27 driver
->name
, driver
->major
, driver
->minor
, driver
->patchlevel
,
28 driver
->date
, dev
->primary
->index
);
37 EXPORT_SYMBOL(drm_get_usb_dev
);
40 * drm_usb_init - Register matching USB devices with the DRM subsystem
41 * @driver: DRM device driver
42 * @udriver: USB device driver
44 * Registers one or more devices matched by a USB driver with the DRM
47 * Return: 0 on success or a negative error code on failure.
49 int drm_usb_init(struct drm_driver
*driver
, struct usb_driver
*udriver
)
54 res
= usb_register(udriver
);
57 EXPORT_SYMBOL(drm_usb_init
);
60 * drm_usb_exit - Unregister matching USB devices from the DRM subsystem
61 * @driver: DRM device driver
62 * @udriver: USB device driver
64 * Unregisters one or more devices matched by a USB driver from the DRM
67 void drm_usb_exit(struct drm_driver
*driver
,
68 struct usb_driver
*udriver
)
70 usb_deregister(udriver
);
72 EXPORT_SYMBOL(drm_usb_exit
);
74 MODULE_AUTHOR("David Airlie");
75 MODULE_DESCRIPTION("USB DRM support");
76 MODULE_LICENSE("GPL and additional rights");