diff options
Diffstat (limited to 'drivers/video/via/viafbdev.c')
-rw-r--r-- | drivers/video/via/viafbdev.c | 69 |
1 files changed, 14 insertions, 55 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index fa1004997c63..17a874f6ea1c 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
@@ -1731,8 +1731,9 @@ static int parse_mode(const char *str, u32 *xres, u32 *yres) | |||
1731 | return 0; | 1731 | return 0; |
1732 | } | 1732 | } |
1733 | 1733 | ||
1734 | static int __devinit via_pci_probe(struct pci_dev *pdev, | 1734 | |
1735 | const struct pci_device_id *ent) | 1735 | int __devinit via_fb_pci_probe(struct pci_dev *pdev, |
1736 | const struct pci_device_id *ent) | ||
1736 | { | 1737 | { |
1737 | u32 default_xres, default_yres; | 1738 | u32 default_xres, default_yres; |
1738 | struct VideoModeTable *vmode_entry; | 1739 | struct VideoModeTable *vmode_entry; |
@@ -1764,6 +1765,7 @@ static int __devinit via_pci_probe(struct pci_dev *pdev, | |||
1764 | &viaparinfo->shared->lvds_setting_info2; | 1765 | &viaparinfo->shared->lvds_setting_info2; |
1765 | viaparinfo->crt_setting_info = &viaparinfo->shared->crt_setting_info; | 1766 | viaparinfo->crt_setting_info = &viaparinfo->shared->crt_setting_info; |
1766 | viaparinfo->chip_info = &viaparinfo->shared->chip_info; | 1767 | viaparinfo->chip_info = &viaparinfo->shared->chip_info; |
1768 | spin_lock_init(&viaparinfo->reg_lock); | ||
1767 | 1769 | ||
1768 | if (viafb_dual_fb) | 1770 | if (viafb_dual_fb) |
1769 | viafb_SAMM_ON = 1; | 1771 | viafb_SAMM_ON = 1; |
@@ -1774,26 +1776,21 @@ static int __devinit via_pci_probe(struct pci_dev *pdev, | |||
1774 | if (!viafb_SAMM_ON) | 1776 | if (!viafb_SAMM_ON) |
1775 | viafb_dual_fb = 0; | 1777 | viafb_dual_fb = 0; |
1776 | 1778 | ||
1777 | /* Set up I2C bus stuff */ | ||
1778 | rc = viafb_create_i2c_busses(viaparinfo); | ||
1779 | if (rc) | ||
1780 | goto out_fb_release; | ||
1781 | |||
1782 | viafb_init_chip_info(pdev, ent); | 1779 | viafb_init_chip_info(pdev, ent); |
1783 | viaparinfo->fbmem = pci_resource_start(pdev, 0); | 1780 | viaparinfo->fbmem = pci_resource_start(pdev, 0); |
1784 | viaparinfo->memsize = viafb_get_fb_size_from_pci(); | 1781 | viaparinfo->memsize = viafb_get_fb_size_from_pci(); |
1785 | if (viaparinfo->memsize < 0) { | 1782 | if (viaparinfo->memsize < 0) { |
1786 | rc = viaparinfo->memsize; | 1783 | rc = viaparinfo->memsize; |
1787 | goto out_delete_i2c; | 1784 | goto out_fb_release; |
1788 | } | 1785 | } |
1789 | viaparinfo->fbmem_free = viaparinfo->memsize; | 1786 | viaparinfo->fbmem_free = viaparinfo->memsize; |
1790 | viaparinfo->fbmem_used = 0; | 1787 | viaparinfo->fbmem_used = 0; |
1791 | viafbinfo->screen_base = ioremap_nocache(viaparinfo->fbmem, | 1788 | viafbinfo->screen_base = ioremap_nocache(viaparinfo->fbmem, |
1792 | viaparinfo->memsize); | 1789 | viaparinfo->memsize); |
1793 | if (!viafbinfo->screen_base) { | 1790 | if (!viafbinfo->screen_base) { |
1794 | printk(KERN_INFO "ioremap failed\n"); | 1791 | printk(KERN_ERR "ioremap of fbmem failed\n"); |
1795 | rc = -ENOMEM; | 1792 | rc = -ENOMEM; |
1796 | goto out_delete_i2c; | 1793 | goto out_fb_release; |
1797 | } | 1794 | } |
1798 | 1795 | ||
1799 | viafbinfo->fix.mmio_start = pci_resource_start(pdev, 1); | 1796 | viafbinfo->fix.mmio_start = pci_resource_start(pdev, 1); |
@@ -1963,14 +1960,12 @@ out_fb1_release: | |||
1963 | framebuffer_release(viafbinfo1); | 1960 | framebuffer_release(viafbinfo1); |
1964 | out_unmap_screen: | 1961 | out_unmap_screen: |
1965 | iounmap(viafbinfo->screen_base); | 1962 | iounmap(viafbinfo->screen_base); |
1966 | out_delete_i2c: | ||
1967 | viafb_delete_i2c_busses(viaparinfo); | ||
1968 | out_fb_release: | 1963 | out_fb_release: |
1969 | framebuffer_release(viafbinfo); | 1964 | framebuffer_release(viafbinfo); |
1970 | return rc; | 1965 | return rc; |
1971 | } | 1966 | } |
1972 | 1967 | ||
1973 | static void __devexit via_pci_remove(struct pci_dev *pdev) | 1968 | void __devexit via_fb_pci_remove(struct pci_dev *pdev) |
1974 | { | 1969 | { |
1975 | DEBUG_MSG(KERN_INFO "via_pci_remove!\n"); | 1970 | DEBUG_MSG(KERN_INFO "via_pci_remove!\n"); |
1976 | fb_dealloc_cmap(&viafbinfo->cmap); | 1971 | fb_dealloc_cmap(&viafbinfo->cmap); |
@@ -1980,8 +1975,6 @@ static void __devexit via_pci_remove(struct pci_dev *pdev) | |||
1980 | iounmap((void *)viafbinfo->screen_base); | 1975 | iounmap((void *)viafbinfo->screen_base); |
1981 | iounmap(viaparinfo->shared->engine_mmio); | 1976 | iounmap(viaparinfo->shared->engine_mmio); |
1982 | 1977 | ||
1983 | viafb_delete_i2c_busses(viaparinfo); | ||
1984 | |||
1985 | framebuffer_release(viafbinfo); | 1978 | framebuffer_release(viafbinfo); |
1986 | if (viafb_dual_fb) | 1979 | if (viafb_dual_fb) |
1987 | framebuffer_release(viafbinfo1); | 1980 | framebuffer_release(viafbinfo1); |
@@ -2062,41 +2055,10 @@ static int __init viafb_setup(char *options) | |||
2062 | } | 2055 | } |
2063 | #endif | 2056 | #endif |
2064 | 2057 | ||
2065 | static struct pci_device_id viafb_pci_table[] __devinitdata = { | 2058 | /* |
2066 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CLE266_DID), | 2059 | * These are called out of via-core for now. |
2067 | .driver_data = UNICHROME_CLE266 }, | 2060 | */ |
2068 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_PM800_DID), | 2061 | int __init viafb_init(void) |
2069 | .driver_data = UNICHROME_PM800 }, | ||
2070 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K400_DID), | ||
2071 | .driver_data = UNICHROME_K400 }, | ||
2072 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K800_DID), | ||
2073 | .driver_data = UNICHROME_K800 }, | ||
2074 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_P4M890_DID), | ||
2075 | .driver_data = UNICHROME_CN700 }, | ||
2076 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K8M890_DID), | ||
2077 | .driver_data = UNICHROME_K8M890 }, | ||
2078 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CX700_DID), | ||
2079 | .driver_data = UNICHROME_CX700 }, | ||
2080 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_P4M900_DID), | ||
2081 | .driver_data = UNICHROME_P4M900 }, | ||
2082 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CN750_DID), | ||
2083 | .driver_data = UNICHROME_CN750 }, | ||
2084 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_VX800_DID), | ||
2085 | .driver_data = UNICHROME_VX800 }, | ||
2086 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_VX855_DID), | ||
2087 | .driver_data = UNICHROME_VX855 }, | ||
2088 | { } | ||
2089 | }; | ||
2090 | MODULE_DEVICE_TABLE(pci, viafb_pci_table); | ||
2091 | |||
2092 | static struct pci_driver viafb_driver = { | ||
2093 | .name = "viafb", | ||
2094 | .id_table = viafb_pci_table, | ||
2095 | .probe = via_pci_probe, | ||
2096 | .remove = __devexit_p(via_pci_remove), | ||
2097 | }; | ||
2098 | |||
2099 | static int __init viafb_init(void) | ||
2100 | { | 2062 | { |
2101 | u32 dummy; | 2063 | u32 dummy; |
2102 | #ifndef MODULE | 2064 | #ifndef MODULE |
@@ -2115,13 +2077,12 @@ static int __init viafb_init(void) | |||
2115 | printk(KERN_INFO | 2077 | printk(KERN_INFO |
2116 | "VIA Graphics Intergration Chipset framebuffer %d.%d initializing\n", | 2078 | "VIA Graphics Intergration Chipset framebuffer %d.%d initializing\n", |
2117 | VERSION_MAJOR, VERSION_MINOR); | 2079 | VERSION_MAJOR, VERSION_MINOR); |
2118 | return pci_register_driver(&viafb_driver); | 2080 | return 0; |
2119 | } | 2081 | } |
2120 | 2082 | ||
2121 | static void __exit viafb_exit(void) | 2083 | void __exit viafb_exit(void) |
2122 | { | 2084 | { |
2123 | DEBUG_MSG(KERN_INFO "viafb_exit!\n"); | 2085 | DEBUG_MSG(KERN_INFO "viafb_exit!\n"); |
2124 | pci_unregister_driver(&viafb_driver); | ||
2125 | } | 2086 | } |
2126 | 2087 | ||
2127 | static struct fb_ops viafb_ops = { | 2088 | static struct fb_ops viafb_ops = { |
@@ -2141,8 +2102,6 @@ static struct fb_ops viafb_ops = { | |||
2141 | .fb_sync = viafb_sync, | 2102 | .fb_sync = viafb_sync, |
2142 | }; | 2103 | }; |
2143 | 2104 | ||
2144 | module_init(viafb_init); | ||
2145 | module_exit(viafb_exit); | ||
2146 | 2105 | ||
2147 | #ifdef MODULE | 2106 | #ifdef MODULE |
2148 | module_param(viafb_mode, charp, S_IRUSR); | 2107 | module_param(viafb_mode, charp, S_IRUSR); |