diff options
Diffstat (limited to 'drivers/video/via/viafbdev.c')
-rw-r--r-- | drivers/video/via/viafbdev.c | 181 |
1 files changed, 87 insertions, 94 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 777b38a06d40..2bc40e682f95 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved. | 2 | * Copyright 1998-2009 VIA Technologies, Inc. All Rights Reserved. |
3 | * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved. | 3 | * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved. |
4 | 4 | ||
5 | * This program is free software; you can redistribute it and/or | 5 | * This program is free software; you can redistribute it and/or |
@@ -23,8 +23,9 @@ | |||
23 | #include <linux/seq_file.h> | 23 | #include <linux/seq_file.h> |
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/stat.h> | 25 | #include <linux/stat.h> |
26 | #define _MASTER_FILE | 26 | #include <linux/via-core.h> |
27 | 27 | ||
28 | #define _MASTER_FILE | ||
28 | #include "global.h" | 29 | #include "global.h" |
29 | 30 | ||
30 | static char *viafb_name = "Via"; | 31 | static char *viafb_name = "Via"; |
@@ -221,7 +222,7 @@ static int viafb_check_var(struct fb_var_screeninfo *var, | |||
221 | /* Adjust var according to our driver's own table */ | 222 | /* Adjust var according to our driver's own table */ |
222 | viafb_fill_var_timing_info(var, viafb_refresh, vmode_entry); | 223 | viafb_fill_var_timing_info(var, viafb_refresh, vmode_entry); |
223 | if (info->var.accel_flags & FB_ACCELF_TEXT && | 224 | if (info->var.accel_flags & FB_ACCELF_TEXT && |
224 | !ppar->shared->engine_mmio) | 225 | !ppar->shared->vdev->engine_mmio) |
225 | info->var.accel_flags = 0; | 226 | info->var.accel_flags = 0; |
226 | 227 | ||
227 | return 0; | 228 | return 0; |
@@ -317,12 +318,12 @@ static int viafb_pan_display(struct fb_var_screeninfo *var, | |||
317 | 318 | ||
318 | DEBUG_MSG(KERN_DEBUG "viafb_pan_display, address = %d\n", vram_addr); | 319 | DEBUG_MSG(KERN_DEBUG "viafb_pan_display, address = %d\n", vram_addr); |
319 | if (!viafb_dual_fb) { | 320 | if (!viafb_dual_fb) { |
320 | viafb_set_primary_address(vram_addr); | 321 | via_set_primary_address(vram_addr); |
321 | viafb_set_secondary_address(vram_addr); | 322 | via_set_secondary_address(vram_addr); |
322 | } else if (viapar->iga_path == IGA1) | 323 | } else if (viapar->iga_path == IGA1) |
323 | viafb_set_primary_address(vram_addr); | 324 | via_set_primary_address(vram_addr); |
324 | else | 325 | else |
325 | viafb_set_secondary_address(vram_addr); | 326 | via_set_secondary_address(vram_addr); |
326 | 327 | ||
327 | return 0; | 328 | return 0; |
328 | } | 329 | } |
@@ -696,7 +697,7 @@ static void viafb_fillrect(struct fb_info *info, | |||
696 | rop = 0xF0; | 697 | rop = 0xF0; |
697 | 698 | ||
698 | DEBUG_MSG(KERN_DEBUG "viafb 2D engine: fillrect\n"); | 699 | DEBUG_MSG(KERN_DEBUG "viafb 2D engine: fillrect\n"); |
699 | if (shared->hw_bitblt(shared->engine_mmio, VIA_BITBLT_FILL, | 700 | if (shared->hw_bitblt(shared->vdev->engine_mmio, VIA_BITBLT_FILL, |
700 | rect->width, rect->height, info->var.bits_per_pixel, | 701 | rect->width, rect->height, info->var.bits_per_pixel, |
701 | viapar->vram_addr, info->fix.line_length, rect->dx, rect->dy, | 702 | viapar->vram_addr, info->fix.line_length, rect->dx, rect->dy, |
702 | NULL, 0, 0, 0, 0, fg_color, 0, rop)) | 703 | NULL, 0, 0, 0, 0, fg_color, 0, rop)) |
@@ -718,7 +719,7 @@ static void viafb_copyarea(struct fb_info *info, | |||
718 | return; | 719 | return; |
719 | 720 | ||
720 | DEBUG_MSG(KERN_DEBUG "viafb 2D engine: copyarea\n"); | 721 | DEBUG_MSG(KERN_DEBUG "viafb 2D engine: copyarea\n"); |
721 | if (shared->hw_bitblt(shared->engine_mmio, VIA_BITBLT_COLOR, | 722 | if (shared->hw_bitblt(shared->vdev->engine_mmio, VIA_BITBLT_COLOR, |
722 | area->width, area->height, info->var.bits_per_pixel, | 723 | area->width, area->height, info->var.bits_per_pixel, |
723 | viapar->vram_addr, info->fix.line_length, area->dx, area->dy, | 724 | viapar->vram_addr, info->fix.line_length, area->dx, area->dy, |
724 | NULL, viapar->vram_addr, info->fix.line_length, | 725 | NULL, viapar->vram_addr, info->fix.line_length, |
@@ -755,7 +756,7 @@ static void viafb_imageblit(struct fb_info *info, | |||
755 | op = VIA_BITBLT_COLOR; | 756 | op = VIA_BITBLT_COLOR; |
756 | 757 | ||
757 | DEBUG_MSG(KERN_DEBUG "viafb 2D engine: imageblit\n"); | 758 | DEBUG_MSG(KERN_DEBUG "viafb 2D engine: imageblit\n"); |
758 | if (shared->hw_bitblt(shared->engine_mmio, op, | 759 | if (shared->hw_bitblt(shared->vdev->engine_mmio, op, |
759 | image->width, image->height, info->var.bits_per_pixel, | 760 | image->width, image->height, info->var.bits_per_pixel, |
760 | viapar->vram_addr, info->fix.line_length, image->dx, image->dy, | 761 | viapar->vram_addr, info->fix.line_length, image->dx, image->dy, |
761 | (u32 *)image->data, 0, 0, 0, 0, fg_color, bg_color, 0)) | 762 | (u32 *)image->data, 0, 0, 0, 0, fg_color, bg_color, 0)) |
@@ -765,7 +766,7 @@ static void viafb_imageblit(struct fb_info *info, | |||
765 | static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) | 766 | static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) |
766 | { | 767 | { |
767 | struct viafb_par *viapar = info->par; | 768 | struct viafb_par *viapar = info->par; |
768 | void __iomem *engine = viapar->shared->engine_mmio; | 769 | void __iomem *engine = viapar->shared->vdev->engine_mmio; |
769 | u32 temp, xx, yy, bg_color = 0, fg_color = 0, | 770 | u32 temp, xx, yy, bg_color = 0, fg_color = 0, |
770 | chip_name = viapar->shared->chip_info.gfx_chip_name; | 771 | chip_name = viapar->shared->chip_info.gfx_chip_name; |
771 | int i, j = 0, cur_size = 64; | 772 | int i, j = 0, cur_size = 64; |
@@ -1018,8 +1019,8 @@ static void viafb_set_device(struct device_t active_dev) | |||
1018 | viafb_SAMM_ON = active_dev.samm; | 1019 | viafb_SAMM_ON = active_dev.samm; |
1019 | viafb_primary_dev = active_dev.primary_dev; | 1020 | viafb_primary_dev = active_dev.primary_dev; |
1020 | 1021 | ||
1021 | viafb_set_primary_address(0); | 1022 | via_set_primary_address(0); |
1022 | viafb_set_secondary_address(viafb_SAMM_ON ? viafb_second_offset : 0); | 1023 | via_set_secondary_address(viafb_SAMM_ON ? viafb_second_offset : 0); |
1023 | viafb_set_iga_path(); | 1024 | viafb_set_iga_path(); |
1024 | } | 1025 | } |
1025 | 1026 | ||
@@ -1165,8 +1166,9 @@ static int apply_device_setting(struct viafb_ioctl_setting setting_info, | |||
1165 | if (viafb_SAMM_ON) | 1166 | if (viafb_SAMM_ON) |
1166 | viafb_primary_dev = setting_info.primary_device; | 1167 | viafb_primary_dev = setting_info.primary_device; |
1167 | 1168 | ||
1168 | viafb_set_primary_address(0); | 1169 | via_set_primary_address(0); |
1169 | viafb_set_secondary_address(viafb_SAMM_ON ? viafb_second_offset : 0); | 1170 | via_set_secondary_address(viafb_SAMM_ON ? |
1171 | viafb_second_offset : 0); | ||
1170 | viafb_set_iga_path(); | 1172 | viafb_set_iga_path(); |
1171 | } | 1173 | } |
1172 | need_set_mode = 1; | 1174 | need_set_mode = 1; |
@@ -1325,6 +1327,8 @@ static void parse_dvi_port(void) | |||
1325 | output_interface); | 1327 | output_interface); |
1326 | } | 1328 | } |
1327 | 1329 | ||
1330 | #ifdef CONFIG_FB_VIA_DIRECT_PROCFS | ||
1331 | |||
1328 | /* | 1332 | /* |
1329 | * The proc filesystem read/write function, a simple proc implement to | 1333 | * The proc filesystem read/write function, a simple proc implement to |
1330 | * get/set the value of DPA DVP0, DVP0DataDriving, DVP0ClockDriving, DVP1, | 1334 | * get/set the value of DPA DVP0, DVP0DataDriving, DVP0ClockDriving, DVP1, |
@@ -1701,16 +1705,21 @@ static void viafb_init_proc(struct proc_dir_entry **viafb_entry) | |||
1701 | } | 1705 | } |
1702 | static void viafb_remove_proc(struct proc_dir_entry *viafb_entry) | 1706 | static void viafb_remove_proc(struct proc_dir_entry *viafb_entry) |
1703 | { | 1707 | { |
1704 | /* no problem if it was not registered */ | 1708 | struct chip_information *chip_info = &viaparinfo->shared->chip_info; |
1709 | |||
1705 | remove_proc_entry("dvp0", viafb_entry);/* parent dir */ | 1710 | remove_proc_entry("dvp0", viafb_entry);/* parent dir */ |
1706 | remove_proc_entry("dvp1", viafb_entry); | 1711 | remove_proc_entry("dvp1", viafb_entry); |
1707 | remove_proc_entry("dfph", viafb_entry); | 1712 | remove_proc_entry("dfph", viafb_entry); |
1708 | remove_proc_entry("dfpl", viafb_entry); | 1713 | remove_proc_entry("dfpl", viafb_entry); |
1709 | remove_proc_entry("vt1636", viafb_entry); | 1714 | if (chip_info->lvds_chip_info.lvds_chip_name == VT1636_LVDS |
1710 | remove_proc_entry("vt1625", viafb_entry); | 1715 | || chip_info->lvds_chip_info2.lvds_chip_name == VT1636_LVDS) |
1716 | remove_proc_entry("vt1636", viafb_entry); | ||
1717 | |||
1711 | remove_proc_entry("viafb", NULL); | 1718 | remove_proc_entry("viafb", NULL); |
1712 | } | 1719 | } |
1713 | 1720 | ||
1721 | #endif /* CONFIG_FB_VIA_DIRECT_PROCFS */ | ||
1722 | |||
1714 | static int parse_mode(const char *str, u32 *xres, u32 *yres) | 1723 | static int parse_mode(const char *str, u32 *xres, u32 *yres) |
1715 | { | 1724 | { |
1716 | char *ptr; | 1725 | char *ptr; |
@@ -1732,12 +1741,13 @@ static int parse_mode(const char *str, u32 *xres, u32 *yres) | |||
1732 | return 0; | 1741 | return 0; |
1733 | } | 1742 | } |
1734 | 1743 | ||
1735 | static int __devinit via_pci_probe(struct pci_dev *pdev, | 1744 | |
1736 | const struct pci_device_id *ent) | 1745 | int __devinit via_fb_pci_probe(struct viafb_dev *vdev) |
1737 | { | 1746 | { |
1738 | u32 default_xres, default_yres; | 1747 | u32 default_xres, default_yres; |
1739 | struct VideoModeTable *vmode_entry; | 1748 | struct VideoModeTable *vmode_entry; |
1740 | struct fb_var_screeninfo default_var; | 1749 | struct fb_var_screeninfo default_var; |
1750 | int rc; | ||
1741 | u32 viafb_par_length; | 1751 | u32 viafb_par_length; |
1742 | 1752 | ||
1743 | DEBUG_MSG(KERN_INFO "VIAFB PCI Probe!!\n"); | 1753 | DEBUG_MSG(KERN_INFO "VIAFB PCI Probe!!\n"); |
@@ -1749,14 +1759,15 @@ static int __devinit via_pci_probe(struct pci_dev *pdev, | |||
1749 | */ | 1759 | */ |
1750 | viafbinfo = framebuffer_alloc(viafb_par_length + | 1760 | viafbinfo = framebuffer_alloc(viafb_par_length + |
1751 | ALIGN(sizeof(struct viafb_shared), BITS_PER_LONG/8), | 1761 | ALIGN(sizeof(struct viafb_shared), BITS_PER_LONG/8), |
1752 | &pdev->dev); | 1762 | &vdev->pdev->dev); |
1753 | if (!viafbinfo) { | 1763 | if (!viafbinfo) { |
1754 | printk(KERN_ERR"Could not allocate memory for viafb_info.\n"); | 1764 | printk(KERN_ERR"Could not allocate memory for viafb_info.\n"); |
1755 | return -ENODEV; | 1765 | return -ENOMEM; |
1756 | } | 1766 | } |
1757 | 1767 | ||
1758 | viaparinfo = (struct viafb_par *)viafbinfo->par; | 1768 | viaparinfo = (struct viafb_par *)viafbinfo->par; |
1759 | viaparinfo->shared = viafbinfo->par + viafb_par_length; | 1769 | viaparinfo->shared = viafbinfo->par + viafb_par_length; |
1770 | viaparinfo->shared->vdev = vdev; | ||
1760 | viaparinfo->vram_addr = 0; | 1771 | viaparinfo->vram_addr = 0; |
1761 | viaparinfo->tmds_setting_info = &viaparinfo->shared->tmds_setting_info; | 1772 | viaparinfo->tmds_setting_info = &viaparinfo->shared->tmds_setting_info; |
1762 | viaparinfo->lvds_setting_info = &viaparinfo->shared->lvds_setting_info; | 1773 | viaparinfo->lvds_setting_info = &viaparinfo->shared->lvds_setting_info; |
@@ -1774,23 +1785,20 @@ static int __devinit via_pci_probe(struct pci_dev *pdev, | |||
1774 | if (!viafb_SAMM_ON) | 1785 | if (!viafb_SAMM_ON) |
1775 | viafb_dual_fb = 0; | 1786 | viafb_dual_fb = 0; |
1776 | 1787 | ||
1777 | /* Set up I2C bus stuff */ | 1788 | viafb_init_chip_info(vdev->chip_type); |
1778 | viafb_create_i2c_bus(viaparinfo); | 1789 | /* |
1779 | 1790 | * The framebuffer will have been successfully mapped by | |
1780 | viafb_init_chip_info(pdev, ent); | 1791 | * the core (or we'd not be here), but we still need to |
1781 | viaparinfo->fbmem = pci_resource_start(pdev, 0); | 1792 | * set up our own accounting. |
1782 | viaparinfo->memsize = viafb_get_fb_size_from_pci(); | 1793 | */ |
1794 | viaparinfo->fbmem = vdev->fbmem_start; | ||
1795 | viaparinfo->memsize = vdev->fbmem_len; | ||
1783 | viaparinfo->fbmem_free = viaparinfo->memsize; | 1796 | viaparinfo->fbmem_free = viaparinfo->memsize; |
1784 | viaparinfo->fbmem_used = 0; | 1797 | viaparinfo->fbmem_used = 0; |
1785 | viafbinfo->screen_base = ioremap_nocache(viaparinfo->fbmem, | 1798 | viafbinfo->screen_base = vdev->fbmem; |
1786 | viaparinfo->memsize); | ||
1787 | if (!viafbinfo->screen_base) { | ||
1788 | printk(KERN_INFO "ioremap failed\n"); | ||
1789 | return -ENOMEM; | ||
1790 | } | ||
1791 | 1799 | ||
1792 | viafbinfo->fix.mmio_start = pci_resource_start(pdev, 1); | 1800 | viafbinfo->fix.mmio_start = vdev->engine_start; |
1793 | viafbinfo->fix.mmio_len = pci_resource_len(pdev, 1); | 1801 | viafbinfo->fix.mmio_len = vdev->engine_len; |
1794 | viafbinfo->node = 0; | 1802 | viafbinfo->node = 0; |
1795 | viafbinfo->fbops = &viafb_ops; | 1803 | viafbinfo->fbops = &viafb_ops; |
1796 | viafbinfo->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; | 1804 | viafbinfo->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; |
@@ -1858,12 +1866,13 @@ static int __devinit via_pci_probe(struct pci_dev *pdev, | |||
1858 | viafbinfo->var = default_var; | 1866 | viafbinfo->var = default_var; |
1859 | 1867 | ||
1860 | if (viafb_dual_fb) { | 1868 | if (viafb_dual_fb) { |
1861 | viafbinfo1 = framebuffer_alloc(viafb_par_length, &pdev->dev); | 1869 | viafbinfo1 = framebuffer_alloc(viafb_par_length, |
1870 | &vdev->pdev->dev); | ||
1862 | if (!viafbinfo1) { | 1871 | if (!viafbinfo1) { |
1863 | printk(KERN_ERR | 1872 | printk(KERN_ERR |
1864 | "allocate the second framebuffer struct error\n"); | 1873 | "allocate the second framebuffer struct error\n"); |
1865 | framebuffer_release(viafbinfo); | 1874 | rc = -ENOMEM; |
1866 | return -ENOMEM; | 1875 | goto out_fb_release; |
1867 | } | 1876 | } |
1868 | viaparinfo1 = viafbinfo1->par; | 1877 | viaparinfo1 = viafbinfo1->par; |
1869 | memcpy(viaparinfo1, viaparinfo, viafb_par_length); | 1878 | memcpy(viaparinfo1, viaparinfo, viafb_par_length); |
@@ -1914,48 +1923,66 @@ static int __devinit via_pci_probe(struct pci_dev *pdev, | |||
1914 | viaparinfo->depth = fb_get_color_depth(&viafbinfo->var, | 1923 | viaparinfo->depth = fb_get_color_depth(&viafbinfo->var, |
1915 | &viafbinfo->fix); | 1924 | &viafbinfo->fix); |
1916 | default_var.activate = FB_ACTIVATE_NOW; | 1925 | default_var.activate = FB_ACTIVATE_NOW; |
1917 | fb_alloc_cmap(&viafbinfo->cmap, 256, 0); | 1926 | rc = fb_alloc_cmap(&viafbinfo->cmap, 256, 0); |
1927 | if (rc) | ||
1928 | goto out_fb1_release; | ||
1918 | 1929 | ||
1919 | if (viafb_dual_fb && (viafb_primary_dev == LCD_Device) | 1930 | if (viafb_dual_fb && (viafb_primary_dev == LCD_Device) |
1920 | && (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266)) { | 1931 | && (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266)) { |
1921 | if (register_framebuffer(viafbinfo1) < 0) | 1932 | rc = register_framebuffer(viafbinfo1); |
1922 | return -EINVAL; | 1933 | if (rc) |
1934 | goto out_dealloc_cmap; | ||
1923 | } | 1935 | } |
1924 | if (register_framebuffer(viafbinfo) < 0) | 1936 | rc = register_framebuffer(viafbinfo); |
1925 | return -EINVAL; | 1937 | if (rc) |
1938 | goto out_fb1_unreg_lcd_cle266; | ||
1926 | 1939 | ||
1927 | if (viafb_dual_fb && ((viafb_primary_dev != LCD_Device) | 1940 | if (viafb_dual_fb && ((viafb_primary_dev != LCD_Device) |
1928 | || (viaparinfo->chip_info->gfx_chip_name != | 1941 | || (viaparinfo->chip_info->gfx_chip_name != |
1929 | UNICHROME_CLE266))) { | 1942 | UNICHROME_CLE266))) { |
1930 | if (register_framebuffer(viafbinfo1) < 0) | 1943 | rc = register_framebuffer(viafbinfo1); |
1931 | return -EINVAL; | 1944 | if (rc) |
1945 | goto out_fb_unreg; | ||
1932 | } | 1946 | } |
1933 | DEBUG_MSG(KERN_INFO "fb%d: %s frame buffer device %dx%d-%dbpp\n", | 1947 | DEBUG_MSG(KERN_INFO "fb%d: %s frame buffer device %dx%d-%dbpp\n", |
1934 | viafbinfo->node, viafbinfo->fix.id, default_var.xres, | 1948 | viafbinfo->node, viafbinfo->fix.id, default_var.xres, |
1935 | default_var.yres, default_var.bits_per_pixel); | 1949 | default_var.yres, default_var.bits_per_pixel); |
1936 | 1950 | ||
1951 | #ifdef CONFIG_FB_VIA_DIRECT_PROCFS | ||
1937 | viafb_init_proc(&viaparinfo->shared->proc_entry); | 1952 | viafb_init_proc(&viaparinfo->shared->proc_entry); |
1953 | #endif | ||
1938 | viafb_init_dac(IGA2); | 1954 | viafb_init_dac(IGA2); |
1939 | return 0; | 1955 | return 0; |
1956 | |||
1957 | out_fb_unreg: | ||
1958 | unregister_framebuffer(viafbinfo); | ||
1959 | out_fb1_unreg_lcd_cle266: | ||
1960 | if (viafb_dual_fb && (viafb_primary_dev == LCD_Device) | ||
1961 | && (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266)) | ||
1962 | unregister_framebuffer(viafbinfo1); | ||
1963 | out_dealloc_cmap: | ||
1964 | fb_dealloc_cmap(&viafbinfo->cmap); | ||
1965 | out_fb1_release: | ||
1966 | if (viafbinfo1) | ||
1967 | framebuffer_release(viafbinfo1); | ||
1968 | out_fb_release: | ||
1969 | framebuffer_release(viafbinfo); | ||
1970 | return rc; | ||
1940 | } | 1971 | } |
1941 | 1972 | ||
1942 | static void __devexit via_pci_remove(struct pci_dev *pdev) | 1973 | void __devexit via_fb_pci_remove(struct pci_dev *pdev) |
1943 | { | 1974 | { |
1944 | DEBUG_MSG(KERN_INFO "via_pci_remove!\n"); | 1975 | DEBUG_MSG(KERN_INFO "via_pci_remove!\n"); |
1945 | fb_dealloc_cmap(&viafbinfo->cmap); | 1976 | fb_dealloc_cmap(&viafbinfo->cmap); |
1946 | unregister_framebuffer(viafbinfo); | 1977 | unregister_framebuffer(viafbinfo); |
1947 | if (viafb_dual_fb) | 1978 | if (viafb_dual_fb) |
1948 | unregister_framebuffer(viafbinfo1); | 1979 | unregister_framebuffer(viafbinfo1); |
1949 | iounmap((void *)viafbinfo->screen_base); | 1980 | #ifdef CONFIG_FB_VIA_DIRECT_PROCFS |
1950 | iounmap(viaparinfo->shared->engine_mmio); | 1981 | viafb_remove_proc(viaparinfo->shared->proc_entry); |
1951 | 1982 | #endif | |
1952 | viafb_delete_i2c_buss(viaparinfo); | ||
1953 | |||
1954 | framebuffer_release(viafbinfo); | 1983 | framebuffer_release(viafbinfo); |
1955 | if (viafb_dual_fb) | 1984 | if (viafb_dual_fb) |
1956 | framebuffer_release(viafbinfo1); | 1985 | framebuffer_release(viafbinfo1); |
1957 | |||
1958 | viafb_remove_proc(viaparinfo->shared->proc_entry); | ||
1959 | } | 1986 | } |
1960 | 1987 | ||
1961 | #ifndef MODULE | 1988 | #ifndef MODULE |
@@ -2031,41 +2058,10 @@ static int __init viafb_setup(char *options) | |||
2031 | } | 2058 | } |
2032 | #endif | 2059 | #endif |
2033 | 2060 | ||
2034 | static struct pci_device_id viafb_pci_table[] __devinitdata = { | 2061 | /* |
2035 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CLE266_DID), | 2062 | * These are called out of via-core for now. |
2036 | .driver_data = UNICHROME_CLE266 }, | 2063 | */ |
2037 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_PM800_DID), | 2064 | int __init viafb_init(void) |
2038 | .driver_data = UNICHROME_PM800 }, | ||
2039 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K400_DID), | ||
2040 | .driver_data = UNICHROME_K400 }, | ||
2041 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K800_DID), | ||
2042 | .driver_data = UNICHROME_K800 }, | ||
2043 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_P4M890_DID), | ||
2044 | .driver_data = UNICHROME_CN700 }, | ||
2045 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K8M890_DID), | ||
2046 | .driver_data = UNICHROME_K8M890 }, | ||
2047 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CX700_DID), | ||
2048 | .driver_data = UNICHROME_CX700 }, | ||
2049 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_P4M900_DID), | ||
2050 | .driver_data = UNICHROME_P4M900 }, | ||
2051 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CN750_DID), | ||
2052 | .driver_data = UNICHROME_CN750 }, | ||
2053 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_VX800_DID), | ||
2054 | .driver_data = UNICHROME_VX800 }, | ||
2055 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_VX855_DID), | ||
2056 | .driver_data = UNICHROME_VX855 }, | ||
2057 | { } | ||
2058 | }; | ||
2059 | MODULE_DEVICE_TABLE(pci, viafb_pci_table); | ||
2060 | |||
2061 | static struct pci_driver viafb_driver = { | ||
2062 | .name = "viafb", | ||
2063 | .id_table = viafb_pci_table, | ||
2064 | .probe = via_pci_probe, | ||
2065 | .remove = __devexit_p(via_pci_remove), | ||
2066 | }; | ||
2067 | |||
2068 | static int __init viafb_init(void) | ||
2069 | { | 2065 | { |
2070 | u32 dummy; | 2066 | u32 dummy; |
2071 | #ifndef MODULE | 2067 | #ifndef MODULE |
@@ -2084,13 +2080,12 @@ static int __init viafb_init(void) | |||
2084 | printk(KERN_INFO | 2080 | printk(KERN_INFO |
2085 | "VIA Graphics Intergration Chipset framebuffer %d.%d initializing\n", | 2081 | "VIA Graphics Intergration Chipset framebuffer %d.%d initializing\n", |
2086 | VERSION_MAJOR, VERSION_MINOR); | 2082 | VERSION_MAJOR, VERSION_MINOR); |
2087 | return pci_register_driver(&viafb_driver); | 2083 | return 0; |
2088 | } | 2084 | } |
2089 | 2085 | ||
2090 | static void __exit viafb_exit(void) | 2086 | void __exit viafb_exit(void) |
2091 | { | 2087 | { |
2092 | DEBUG_MSG(KERN_INFO "viafb_exit!\n"); | 2088 | DEBUG_MSG(KERN_INFO "viafb_exit!\n"); |
2093 | pci_unregister_driver(&viafb_driver); | ||
2094 | } | 2089 | } |
2095 | 2090 | ||
2096 | static struct fb_ops viafb_ops = { | 2091 | static struct fb_ops viafb_ops = { |
@@ -2110,8 +2105,6 @@ static struct fb_ops viafb_ops = { | |||
2110 | .fb_sync = viafb_sync, | 2105 | .fb_sync = viafb_sync, |
2111 | }; | 2106 | }; |
2112 | 2107 | ||
2113 | module_init(viafb_init); | ||
2114 | module_exit(viafb_exit); | ||
2115 | 2108 | ||
2116 | #ifdef MODULE | 2109 | #ifdef MODULE |
2117 | module_param(viafb_mode, charp, S_IRUSR); | 2110 | module_param(viafb_mode, charp, S_IRUSR); |