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
);
39 static int drm_usb_get_irq(struct drm_device
*dev
)
44 static const char *drm_usb_get_name(struct drm_device
*dev
)
49 static int drm_usb_set_busid(struct drm_device
*dev
,
50 struct drm_master
*master
)
55 static struct drm_bus drm_usb_bus
= {
56 .bus_type
= DRIVER_BUS_USB
,
57 .get_irq
= drm_usb_get_irq
,
58 .get_name
= drm_usb_get_name
,
59 .set_busid
= drm_usb_set_busid
,
62 int drm_usb_init(struct drm_driver
*driver
, struct usb_driver
*udriver
)
67 driver
->kdriver
.usb
= udriver
;
68 driver
->bus
= &drm_usb_bus
;
70 res
= usb_register(udriver
);
73 EXPORT_SYMBOL(drm_usb_init
);
75 void drm_usb_exit(struct drm_driver
*driver
,
76 struct usb_driver
*udriver
)
78 usb_deregister(udriver
);
80 EXPORT_SYMBOL(drm_usb_exit
);
82 MODULE_AUTHOR("David Airlie");
83 MODULE_DESCRIPTION("USB DRM support");
84 MODULE_LICENSE("GPL and additional rights");