]> Pileus Git - ~andy/linux/blobdiff - drivers/video/hyperv_fb.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
[~andy/linux] / drivers / video / hyperv_fb.c
index 8ac99b87c07e07b9737934fcb380e6ab3f7855f7..130708f96430e2806fa0c4eed32264cd61309995 100644 (file)
@@ -575,6 +575,10 @@ static int hvfb_setcolreg(unsigned regno, unsigned red, unsigned green,
        return 0;
 }
 
+static int hvfb_blank(int blank, struct fb_info *info)
+{
+       return 1;       /* get fb_blank to set the colormap to all black */
+}
 
 static struct fb_ops hvfb_ops = {
        .owner = THIS_MODULE,
@@ -584,6 +588,7 @@ static struct fb_ops hvfb_ops = {
        .fb_fillrect = cfb_fillrect,
        .fb_copyarea = cfb_copyarea,
        .fb_imageblit = cfb_imageblit,
+       .fb_blank = hvfb_blank,
 };
 
 
@@ -795,12 +800,21 @@ static int hvfb_remove(struct hv_device *hdev)
 }
 
 
+static DEFINE_PCI_DEVICE_TABLE(pci_stub_id_table) = {
+       {
+               .vendor      = PCI_VENDOR_ID_MICROSOFT,
+               .device      = PCI_DEVICE_ID_HYPERV_VIDEO,
+       },
+       { /* end of list */ }
+};
+
 static const struct hv_vmbus_device_id id_table[] = {
        /* Synthetic Video Device GUID */
        {HV_SYNTHVID_GUID},
        {}
 };
 
+MODULE_DEVICE_TABLE(pci, pci_stub_id_table);
 MODULE_DEVICE_TABLE(vmbus, id_table);
 
 static struct hv_driver hvfb_drv = {
@@ -810,14 +824,43 @@ static struct hv_driver hvfb_drv = {
        .remove = hvfb_remove,
 };
 
+static int hvfb_pci_stub_probe(struct pci_dev *pdev,
+                              const struct pci_device_id *ent)
+{
+       return 0;
+}
+
+static void hvfb_pci_stub_remove(struct pci_dev *pdev)
+{
+}
+
+static struct pci_driver hvfb_pci_stub_driver = {
+       .name =         KBUILD_MODNAME,
+       .id_table =     pci_stub_id_table,
+       .probe =        hvfb_pci_stub_probe,
+       .remove =       hvfb_pci_stub_remove,
+};
 
 static int __init hvfb_drv_init(void)
 {
-       return vmbus_driver_register(&hvfb_drv);
+       int ret;
+
+       ret = vmbus_driver_register(&hvfb_drv);
+       if (ret != 0)
+               return ret;
+
+       ret = pci_register_driver(&hvfb_pci_stub_driver);
+       if (ret != 0) {
+               vmbus_driver_unregister(&hvfb_drv);
+               return ret;
+       }
+
+       return 0;
 }
 
 static void __exit hvfb_drv_exit(void)
 {
+       pci_unregister_driver(&hvfb_pci_stub_driver);
        vmbus_driver_unregister(&hvfb_drv);
 }