aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/aty/aty128fb.c
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2006-09-05 17:20:21 -0400
committerDave Jones <davej@redhat.com>2006-09-05 17:20:21 -0400
commit115b384cf87249d76adb0b21aca11ee22128927d (patch)
treef39a2a54863e9d82d1196906f92c82ab5991c6af /drivers/video/aty/aty128fb.c
parent8eb7925f93af75e66a240d148efdec212f95bcb7 (diff)
parentc336923b668fdcf0312efbec3b44895d713f4d81 (diff)
Merge ../linus
Diffstat (limited to 'drivers/video/aty/aty128fb.c')
-rw-r--r--drivers/video/aty/aty128fb.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index c64a717e2d4b..276a21530b95 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -455,7 +455,10 @@ static void do_wait_for_fifo(u16 entries, struct aty128fb_par *par);
455static void wait_for_fifo(u16 entries, struct aty128fb_par *par); 455static void wait_for_fifo(u16 entries, struct aty128fb_par *par);
456static void wait_for_idle(struct aty128fb_par *par); 456static void wait_for_idle(struct aty128fb_par *par);
457static u32 depth_to_dst(u32 depth); 457static u32 depth_to_dst(u32 depth);
458
459#ifdef CONFIG_FB_ATY128_BACKLIGHT
458static void aty128_bl_set_power(struct fb_info *info, int power); 460static void aty128_bl_set_power(struct fb_info *info, int power);
461#endif
459 462
460#define BIOS_IN8(v) (readb(bios + (v))) 463#define BIOS_IN8(v) (readb(bios + (v)))
461#define BIOS_IN16(v) (readb(bios + (v)) | \ 464#define BIOS_IN16(v) (readb(bios + (v)) | \
@@ -1798,10 +1801,14 @@ static struct backlight_properties aty128_bl_data = {
1798static void aty128_bl_set_power(struct fb_info *info, int power) 1801static void aty128_bl_set_power(struct fb_info *info, int power)
1799{ 1802{
1800 mutex_lock(&info->bl_mutex); 1803 mutex_lock(&info->bl_mutex);
1801 up(&info->bl_dev->sem); 1804
1802 info->bl_dev->props->power = power; 1805 if (info->bl_dev) {
1803 __aty128_bl_update_status(info->bl_dev); 1806 down(&info->bl_dev->sem);
1804 down(&info->bl_dev->sem); 1807 info->bl_dev->props->power = power;
1808 __aty128_bl_update_status(info->bl_dev);
1809 up(&info->bl_dev->sem);
1810 }
1811
1805 mutex_unlock(&info->bl_mutex); 1812 mutex_unlock(&info->bl_mutex);
1806} 1813}
1807 1814
@@ -1825,7 +1832,7 @@ static void aty128_bl_init(struct aty128fb_par *par)
1825 bd = backlight_device_register(name, par, &aty128_bl_data); 1832 bd = backlight_device_register(name, par, &aty128_bl_data);
1826 if (IS_ERR(bd)) { 1833 if (IS_ERR(bd)) {
1827 info->bl_dev = NULL; 1834 info->bl_dev = NULL;
1828 printk("aty128: Backlight registration failed\n"); 1835 printk(KERN_WARNING "aty128: Backlight registration failed\n");
1829 goto error; 1836 goto error;
1830 } 1837 }
1831 1838
@@ -1836,11 +1843,11 @@ static void aty128_bl_init(struct aty128fb_par *par)
1836 219 * FB_BACKLIGHT_MAX / MAX_LEVEL); 1843 219 * FB_BACKLIGHT_MAX / MAX_LEVEL);
1837 mutex_unlock(&info->bl_mutex); 1844 mutex_unlock(&info->bl_mutex);
1838 1845
1839 up(&bd->sem); 1846 down(&bd->sem);
1840 bd->props->brightness = aty128_bl_data.max_brightness; 1847 bd->props->brightness = aty128_bl_data.max_brightness;
1841 bd->props->power = FB_BLANK_UNBLANK; 1848 bd->props->power = FB_BLANK_UNBLANK;
1842 bd->props->update_status(bd); 1849 bd->props->update_status(bd);
1843 down(&bd->sem); 1850 up(&bd->sem);
1844 1851
1845#ifdef CONFIG_PMAC_BACKLIGHT 1852#ifdef CONFIG_PMAC_BACKLIGHT
1846 mutex_lock(&pmac_backlight_mutex); 1853 mutex_lock(&pmac_backlight_mutex);
@@ -1910,9 +1917,6 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
1910 u8 chip_rev; 1917 u8 chip_rev;
1911 u32 dac; 1918 u32 dac;
1912 1919
1913 if (!par->vram_size) /* may have already been probed */
1914 par->vram_size = aty_ld_le32(CONFIG_MEMSIZE) & 0x03FFFFFF;
1915
1916 /* Get the chip revision */ 1920 /* Get the chip revision */
1917 chip_rev = (aty_ld_le32(CONFIG_CNTL) >> 16) & 0x1F; 1921 chip_rev = (aty_ld_le32(CONFIG_CNTL) >> 16) & 0x1F;
1918 1922
@@ -2025,9 +2029,6 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
2025 2029
2026 aty128_init_engine(par); 2030 aty128_init_engine(par);
2027 2031
2028 if (register_framebuffer(info) < 0)
2029 return 0;
2030
2031 par->pm_reg = pci_find_capability(pdev, PCI_CAP_ID_PM); 2032 par->pm_reg = pci_find_capability(pdev, PCI_CAP_ID_PM);
2032 par->pdev = pdev; 2033 par->pdev = pdev;
2033 par->asleep = 0; 2034 par->asleep = 0;
@@ -2037,6 +2038,9 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
2037 aty128_bl_init(par); 2038 aty128_bl_init(par);
2038#endif 2039#endif
2039 2040
2041 if (register_framebuffer(info) < 0)
2042 return 0;
2043
2040 printk(KERN_INFO "fb%d: %s frame buffer device on %s\n", 2044 printk(KERN_INFO "fb%d: %s frame buffer device on %s\n",
2041 info->node, info->fix.id, video_card); 2045 info->node, info->fix.id, video_card);
2042 2046
@@ -2086,7 +2090,6 @@ static int __devinit aty128_probe(struct pci_dev *pdev, const struct pci_device_
2086 par = info->par; 2090 par = info->par;
2087 2091
2088 info->pseudo_palette = par->pseudo_palette; 2092 info->pseudo_palette = par->pseudo_palette;
2089 info->fix = aty128fb_fix;
2090 2093
2091 /* Virtualize mmio region */ 2094 /* Virtualize mmio region */
2092 info->fix.mmio_start = reg_addr; 2095 info->fix.mmio_start = reg_addr;