aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-21 02:50:24 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-21 02:50:24 -0500
commite1d1ea549b57790a3d8cf6300e6ef86118d692a3 (patch)
tree0174210b1d2d00ab9f111aa8780b3d94238ccaf1
parentc633e898bde8990a34907c91b7d5245cab866c6e (diff)
parent5f215d252496543ba22299bccef5062d30d63cfe (diff)
Merge tag 'fbdev-v4.15' of git://github.com/bzolnier/linux
Pull fbdev updates from Bartlomiej Zolnierkiewicz: "There is nothing really major here (though removal of the dead igafb driver stands out in diffstat). Summary: - convert timers to use timer_setup() (Kees Cook, Thierry Reding) - fix panels support on iMX boards in mxsfb driver (Stefan Agner) - fix timeout on EDID read in udlfb driver (Ladislav Michl) - add missing modes to fix out of bounds access in controlfb driver (Geert Uytterhoeven) - update initialisation paths in sa1100fb driver to be more robust (Russell King) - fix error handling path of ->probe method in au1200fb driver (Christophe JAILLET) - fix handling of cases when either panel or crt is defined in sm501fb driver (Sudip Mukherjee, Colin Ian King) - add ability to the Goldfish FB driver to be recognized by OS via DT (Aleksandar Markovic) - structures constifications (Bhumika Goyal) - misc fixes (Allen Pais, Gustavo A. R. Silva, Dan Carpenter) - misc cleanups (Colin Ian King, Himanshu Jha, Markus Elfring) - remove dead igafb driver" * tag 'fbdev-v4.15' of git://github.com/bzolnier/linux: (42 commits) OMAPFB: prevent buffer underflow in omapfb_parse_vram_param() video: fbdev: sm501fb: fix potential null pointer dereference on fbi fbcon: Initialize ops->info early video: fbdev: Convert timers to use timer_setup() video: fbdev: pxa3xx_gcu: Convert timers to use timer_setup() fbdev: controlfb: Add missing modes to fix out of bounds access video: fbdev: sis_main: mark expected switch fall-throughs video: fbdev: cirrusfb: mark expected switch fall-throughs video: fbdev: aty: radeon_pm: mark expected switch fall-throughs video: fbdev: sm501fb: mark expected switch fall-through in sm501fb_blank_crt video: fbdev: intelfb: remove redundant variables video/fbdev/dnfb: Use common error handling code in dnfb_probe() sm501fb: suspend and resume fb if it exists sm501fb: unregister framebuffer only if registered sm501fb: deallocate colormap only if allocated video: goldfishfb: Add support for device tree bindings Documentation: Add device tree binding for Goldfish FB driver video: udlfb: Fix read EDID timeout video: fbdev: remove dead igafb driver video: fbdev: mxsfb: fix pixelclock polarity ...
-rw-r--r--Documentation/devicetree/bindings/display/google,goldfish-fb.txt17
-rw-r--r--drivers/video/fbdev/Kconfig10
-rw-r--r--drivers/video/fbdev/Makefile1
-rw-r--r--drivers/video/fbdev/aty/atyfb_base.c4
-rw-r--r--drivers/video/fbdev/aty/radeon_base.c10
-rw-r--r--drivers/video/fbdev/aty/radeon_pm.c3
-rw-r--r--drivers/video/fbdev/au1200fb.c43
-rw-r--r--drivers/video/fbdev/cirrusfb.c6
-rw-r--r--drivers/video/fbdev/controlfb.h2
-rw-r--r--drivers/video/fbdev/core/fbcon.c11
-rw-r--r--drivers/video/fbdev/core/fbcon.h1
-rw-r--r--drivers/video/fbdev/dnfb.c15
-rw-r--r--drivers/video/fbdev/goldfishfb.c8
-rw-r--r--drivers/video/fbdev/igafb.c579
-rw-r--r--drivers/video/fbdev/intelfb/intelfbhw.c9
-rw-r--r--drivers/video/fbdev/matrox/matroxfb_base.c2
-rw-r--r--drivers/video/fbdev/mxsfb.c13
-rw-r--r--drivers/video/fbdev/omap/hwa742.c6
-rw-r--r--drivers/video/fbdev/omap2/omapfb/dss/dsi.c6
-rw-r--r--drivers/video/fbdev/omap2/omapfb/omapfb-main.c2
-rw-r--r--drivers/video/fbdev/pxa3xx-gcu.c24
-rw-r--r--drivers/video/fbdev/sa1100fb.c75
-rw-r--r--drivers/video/fbdev/sa1100fb.h2
-rw-r--r--drivers/video/fbdev/sis/init301.c2
-rw-r--r--drivers/video/fbdev/sis/sis_main.c4
-rw-r--r--drivers/video/fbdev/sm501fb.c22
-rw-r--r--drivers/video/fbdev/udlfb.c10
-rw-r--r--include/video/iga.h25
28 files changed, 164 insertions, 748 deletions
diff --git a/Documentation/devicetree/bindings/display/google,goldfish-fb.txt b/Documentation/devicetree/bindings/display/google,goldfish-fb.txt
new file mode 100644
index 000000000000..751fa9f51e5d
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/google,goldfish-fb.txt
@@ -0,0 +1,17 @@
1Android Goldfish framebuffer
2
3Android Goldfish framebuffer device used by Android emulator.
4
5Required properties:
6
7- compatible : should contain "google,goldfish-fb"
8- reg : <registers mapping>
9- interrupts : <interrupt mapping>
10
11Example:
12
13 display-controller@1f008000 {
14 compatible = "google,goldfish-fb";
15 interrupts = <0x10>;
16 reg = <0x1f008000 0x100>;
17 };
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 5e58f5ec0a28..2f615b7f1c9f 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -905,16 +905,6 @@ config FB_LEO
905 This is the frame buffer device driver for the SBUS-based Sun ZX 905 This is the frame buffer device driver for the SBUS-based Sun ZX
906 (leo) frame buffer cards. 906 (leo) frame buffer cards.
907 907
908config FB_IGA
909 bool "IGA 168x display support"
910 depends on (FB = y) && SPARC32
911 select FB_CFB_FILLRECT
912 select FB_CFB_COPYAREA
913 select FB_CFB_IMAGEBLIT
914 help
915 This is the framebuffer device for the INTERGRAPHICS 1680 and
916 successor frame buffer cards.
917
918config FB_XVR500 908config FB_XVR500
919 bool "Sun XVR-500 3DLABS Wildcat support" 909 bool "Sun XVR-500 3DLABS Wildcat support"
920 depends on (FB = y) && PCI && SPARC64 910 depends on (FB = y) && PCI && SPARC64
diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile
index 8895536a20d6..115961e0721b 100644
--- a/drivers/video/fbdev/Makefile
+++ b/drivers/video/fbdev/Makefile
@@ -65,7 +65,6 @@ obj-$(CONFIG_FB_HGA) += hgafb.o
65obj-$(CONFIG_FB_XVR500) += sunxvr500.o 65obj-$(CONFIG_FB_XVR500) += sunxvr500.o
66obj-$(CONFIG_FB_XVR2500) += sunxvr2500.o 66obj-$(CONFIG_FB_XVR2500) += sunxvr2500.o
67obj-$(CONFIG_FB_XVR1000) += sunxvr1000.o 67obj-$(CONFIG_FB_XVR1000) += sunxvr1000.o
68obj-$(CONFIG_FB_IGA) += igafb.o
69obj-$(CONFIG_FB_APOLLO) += dnfb.o 68obj-$(CONFIG_FB_APOLLO) += dnfb.o
70obj-$(CONFIG_FB_Q40) += q40fb.o 69obj-$(CONFIG_FB_Q40) += q40fb.o
71obj-$(CONFIG_FB_TGA) += tgafb.o 70obj-$(CONFIG_FB_TGA) += tgafb.o
diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
index 3ec72f19114b..a9a8272f7a6e 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -2272,10 +2272,10 @@ static void aty_bl_exit(struct backlight_device *bd)
2272 2272
2273static void aty_calc_mem_refresh(struct atyfb_par *par, int xclk) 2273static void aty_calc_mem_refresh(struct atyfb_par *par, int xclk)
2274{ 2274{
2275 const int ragepro_tbl[] = { 2275 static const int ragepro_tbl[] = {
2276 44, 50, 55, 66, 75, 80, 100 2276 44, 50, 55, 66, 75, 80, 100
2277 }; 2277 };
2278 const int ragexl_tbl[] = { 2278 static const int ragexl_tbl[] = {
2279 50, 66, 75, 83, 90, 95, 100, 105, 2279 50, 66, 75, 83, 90, 95, 100, 105,
2280 110, 115, 120, 125, 133, 143, 166 2280 110, 115, 120, 125, 133, 143, 166
2281 }; 2281 };
diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c
index 1e2ec360f8c1..4d77daeecf99 100644
--- a/drivers/video/fbdev/aty/radeon_base.c
+++ b/drivers/video/fbdev/aty/radeon_base.c
@@ -1454,9 +1454,9 @@ static void radeon_write_pll_regs(struct radeonfb_info *rinfo, struct radeon_reg
1454/* 1454/*
1455 * Timer function for delayed LVDS panel power up/down 1455 * Timer function for delayed LVDS panel power up/down
1456 */ 1456 */
1457static void radeon_lvds_timer_func(unsigned long data) 1457static void radeon_lvds_timer_func(struct timer_list *t)
1458{ 1458{
1459 struct radeonfb_info *rinfo = (struct radeonfb_info *)data; 1459 struct radeonfb_info *rinfo = from_timer(rinfo, t, lvds_timer);
1460 1460
1461 radeon_engine_idle(); 1461 radeon_engine_idle();
1462 1462
@@ -1534,7 +1534,7 @@ void radeon_write_mode (struct radeonfb_info *rinfo, struct radeon_regs *mode,
1534static void radeon_calc_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs *regs, 1534static void radeon_calc_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs *regs,
1535 unsigned long freq) 1535 unsigned long freq)
1536{ 1536{
1537 const struct { 1537 static const struct {
1538 int divider; 1538 int divider;
1539 int bitvalue; 1539 int bitvalue;
1540 } *post_div, 1540 } *post_div,
@@ -2291,9 +2291,7 @@ static int radeonfb_pci_register(struct pci_dev *pdev,
2291 rinfo->pdev = pdev; 2291 rinfo->pdev = pdev;
2292 2292
2293 spin_lock_init(&rinfo->reg_lock); 2293 spin_lock_init(&rinfo->reg_lock);
2294 init_timer(&rinfo->lvds_timer); 2294 timer_setup(&rinfo->lvds_timer, radeon_lvds_timer_func, 0);
2295 rinfo->lvds_timer.function = radeon_lvds_timer_func;
2296 rinfo->lvds_timer.data = (unsigned long)rinfo;
2297 2295
2298 c1 = ent->device >> 8; 2296 c1 = ent->device >> 8;
2299 c2 = ent->device & 0xff; 2297 c2 = ent->device & 0xff;
diff --git a/drivers/video/fbdev/aty/radeon_pm.c b/drivers/video/fbdev/aty/radeon_pm.c
index f7c253dd5899..7137c12cbcee 100644
--- a/drivers/video/fbdev/aty/radeon_pm.c
+++ b/drivers/video/fbdev/aty/radeon_pm.c
@@ -1208,9 +1208,11 @@ static void radeon_pm_enable_dll_m10(struct radeonfb_info *rinfo)
1208 case 1: 1208 case 1:
1209 if (mc & 0x4) 1209 if (mc & 0x4)
1210 break; 1210 break;
1211 /* fall through */
1211 case 2: 1212 case 2:
1212 dll_sleep_mask |= MDLL_R300_RDCK__MRDCKB_SLEEP; 1213 dll_sleep_mask |= MDLL_R300_RDCK__MRDCKB_SLEEP;
1213 dll_reset_mask |= MDLL_R300_RDCK__MRDCKB_RESET; 1214 dll_reset_mask |= MDLL_R300_RDCK__MRDCKB_RESET;
1215 /* fall through */
1214 case 0: 1216 case 0:
1215 dll_sleep_mask |= MDLL_R300_RDCK__MRDCKA_SLEEP; 1217 dll_sleep_mask |= MDLL_R300_RDCK__MRDCKA_SLEEP;
1216 dll_reset_mask |= MDLL_R300_RDCK__MRDCKA_RESET; 1218 dll_reset_mask |= MDLL_R300_RDCK__MRDCKA_RESET;
@@ -1219,6 +1221,7 @@ static void radeon_pm_enable_dll_m10(struct radeonfb_info *rinfo)
1219 case 1: 1221 case 1:
1220 if (!(mc & 0x4)) 1222 if (!(mc & 0x4))
1221 break; 1223 break;
1224 /* fall through */
1222 case 2: 1225 case 2:
1223 dll_sleep_mask |= MDLL_R300_RDCK__MRDCKD_SLEEP; 1226 dll_sleep_mask |= MDLL_R300_RDCK__MRDCKD_SLEEP;
1224 dll_reset_mask |= MDLL_R300_RDCK__MRDCKD_RESET; 1227 dll_reset_mask |= MDLL_R300_RDCK__MRDCKD_RESET;
diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c
index 5f04b4096c42..87d5a62bf6ca 100644
--- a/drivers/video/fbdev/au1200fb.c
+++ b/drivers/video/fbdev/au1200fb.c
@@ -1518,7 +1518,7 @@ static irqreturn_t au1200fb_handle_irq(int irq, void* dev_id)
1518static int au1200fb_init_fbinfo(struct au1200fb_device *fbdev) 1518static int au1200fb_init_fbinfo(struct au1200fb_device *fbdev)
1519{ 1519{
1520 struct fb_info *fbi = fbdev->fb_info; 1520 struct fb_info *fbi = fbdev->fb_info;
1521 int bpp; 1521 int bpp, ret;
1522 1522
1523 fbi->fbops = &au1200fb_fb_ops; 1523 fbi->fbops = &au1200fb_fb_ops;
1524 1524
@@ -1546,15 +1546,14 @@ static int au1200fb_init_fbinfo(struct au1200fb_device *fbdev)
1546 } 1546 }
1547 1547
1548 fbi->pseudo_palette = kcalloc(16, sizeof(u32), GFP_KERNEL); 1548 fbi->pseudo_palette = kcalloc(16, sizeof(u32), GFP_KERNEL);
1549 if (!fbi->pseudo_palette) { 1549 if (!fbi->pseudo_palette)
1550 return -ENOMEM; 1550 return -ENOMEM;
1551 }
1552 1551
1553 if (fb_alloc_cmap(&fbi->cmap, AU1200_LCD_NBR_PALETTE_ENTRIES, 0) < 0) { 1552 ret = fb_alloc_cmap(&fbi->cmap, AU1200_LCD_NBR_PALETTE_ENTRIES, 0);
1553 if (ret < 0) {
1554 print_err("Fail to allocate colormap (%d entries)", 1554 print_err("Fail to allocate colormap (%d entries)",
1555 AU1200_LCD_NBR_PALETTE_ENTRIES); 1555 AU1200_LCD_NBR_PALETTE_ENTRIES);
1556 kfree(fbi->pseudo_palette); 1556 return ret;
1557 return -EFAULT;
1558 } 1557 }
1559 1558
1560 strncpy(fbi->fix.id, "AU1200", sizeof(fbi->fix.id)); 1559 strncpy(fbi->fix.id, "AU1200", sizeof(fbi->fix.id));
@@ -1668,10 +1667,6 @@ static int au1200fb_drv_probe(struct platform_device *dev)
1668 printk(DRIVER_NAME ": Panel %d %s\n", panel_index, panel->name); 1667 printk(DRIVER_NAME ": Panel %d %s\n", panel_index, panel->name);
1669 printk(DRIVER_NAME ": Win %d %s\n", window_index, win->name); 1668 printk(DRIVER_NAME ": Win %d %s\n", window_index, win->name);
1670 1669
1671 /* shut gcc up */
1672 ret = 0;
1673 fbdev = NULL;
1674
1675 for (plane = 0; plane < device_count; ++plane) { 1670 for (plane = 0; plane < device_count; ++plane) {
1676 bpp = winbpp(win->w[plane].mode_winctrl1); 1671 bpp = winbpp(win->w[plane].mode_winctrl1);
1677 if (win->w[plane].xres == 0) 1672 if (win->w[plane].xres == 0)
@@ -1681,8 +1676,10 @@ static int au1200fb_drv_probe(struct platform_device *dev)
1681 1676
1682 fbi = framebuffer_alloc(sizeof(struct au1200fb_device), 1677 fbi = framebuffer_alloc(sizeof(struct au1200fb_device),
1683 &dev->dev); 1678 &dev->dev);
1684 if (!fbi) 1679 if (!fbi) {
1680 ret = -ENOMEM;
1685 goto failed; 1681 goto failed;
1682 }
1686 1683
1687 _au1200fb_infos[plane] = fbi; 1684 _au1200fb_infos[plane] = fbi;
1688 fbdev = fbi->par; 1685 fbdev = fbi->par;
@@ -1701,7 +1698,8 @@ static int au1200fb_drv_probe(struct platform_device *dev)
1701 if (!fbdev->fb_mem) { 1698 if (!fbdev->fb_mem) {
1702 print_err("fail to allocate frambuffer (size: %dK))", 1699 print_err("fail to allocate frambuffer (size: %dK))",
1703 fbdev->fb_len / 1024); 1700 fbdev->fb_len / 1024);
1704 return -ENOMEM; 1701 ret = -ENOMEM;
1702 goto failed;
1705 } 1703 }
1706 1704
1707 /* 1705 /*
@@ -1718,7 +1716,8 @@ static int au1200fb_drv_probe(struct platform_device *dev)
1718 print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024); 1716 print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024);
1719 1717
1720 /* Init FB data */ 1718 /* Init FB data */
1721 if ((ret = au1200fb_init_fbinfo(fbdev)) < 0) 1719 ret = au1200fb_init_fbinfo(fbdev);
1720 if (ret < 0)
1722 goto failed; 1721 goto failed;
1723 1722
1724 /* Register new framebuffer */ 1723 /* Register new framebuffer */
@@ -1758,21 +1757,26 @@ static int au1200fb_drv_probe(struct platform_device *dev)
1758 return 0; 1757 return 0;
1759 1758
1760failed: 1759failed:
1761 /* NOTE: This only does the current plane/window that failed; others are still active */ 1760 for (plane = 0; plane < device_count; ++plane) {
1762 if (fbi) { 1761 fbi = _au1200fb_infos[plane];
1762 if (!fbi)
1763 break;
1764
1765 /* Clean up all probe data */
1766 unregister_framebuffer(fbi);
1763 if (fbi->cmap.len != 0) 1767 if (fbi->cmap.len != 0)
1764 fb_dealloc_cmap(&fbi->cmap); 1768 fb_dealloc_cmap(&fbi->cmap);
1765 kfree(fbi->pseudo_palette); 1769 kfree(fbi->pseudo_palette);
1770
1771 framebuffer_release(fbi);
1772 _au1200fb_infos[plane] = NULL;
1766 } 1773 }
1767 if (plane == 0)
1768 free_irq(AU1200_LCD_INT, (void*)dev);
1769 return ret; 1774 return ret;
1770} 1775}
1771 1776
1772static int au1200fb_drv_remove(struct platform_device *dev) 1777static int au1200fb_drv_remove(struct platform_device *dev)
1773{ 1778{
1774 struct au1200fb_platdata *pd = platform_get_drvdata(dev); 1779 struct au1200fb_platdata *pd = platform_get_drvdata(dev);
1775 struct au1200fb_device *fbdev;
1776 struct fb_info *fbi; 1780 struct fb_info *fbi;
1777 int plane; 1781 int plane;
1778 1782
@@ -1781,7 +1785,6 @@ static int au1200fb_drv_remove(struct platform_device *dev)
1781 1785
1782 for (plane = 0; plane < device_count; ++plane) { 1786 for (plane = 0; plane < device_count; ++plane) {
1783 fbi = _au1200fb_infos[plane]; 1787 fbi = _au1200fb_infos[plane];
1784 fbdev = fbi->par;
1785 1788
1786 /* Clean up all probe data */ 1789 /* Clean up all probe data */
1787 unregister_framebuffer(fbi); 1790 unregister_framebuffer(fbi);
diff --git a/drivers/video/fbdev/cirrusfb.c b/drivers/video/fbdev/cirrusfb.c
index d992aa5eb3f0..b3be06dd2908 100644
--- a/drivers/video/fbdev/cirrusfb.c
+++ b/drivers/video/fbdev/cirrusfb.c
@@ -1477,10 +1477,12 @@ static void init_vgachip(struct fb_info *info)
1477 mdelay(100); 1477 mdelay(100);
1478 /* mode */ 1478 /* mode */
1479 vga_wgfx(cinfo->regbase, CL_GR31, 0x00); 1479 vga_wgfx(cinfo->regbase, CL_GR31, 0x00);
1480 case BT_GD5480: /* fall through */ 1480 /* fall through */
1481 case BT_GD5480:
1481 /* from Klaus' NetBSD driver: */ 1482 /* from Klaus' NetBSD driver: */
1482 vga_wgfx(cinfo->regbase, CL_GR2F, 0x00); 1483 vga_wgfx(cinfo->regbase, CL_GR2F, 0x00);
1483 case BT_ALPINE: /* fall through */ 1484 /* fall through */
1485 case BT_ALPINE:
1484 /* put blitter into 542x compat */ 1486 /* put blitter into 542x compat */
1485 vga_wgfx(cinfo->regbase, CL_GR33, 0x00); 1487 vga_wgfx(cinfo->regbase, CL_GR33, 0x00);
1486 break; 1488 break;
diff --git a/drivers/video/fbdev/controlfb.h b/drivers/video/fbdev/controlfb.h
index 6026c60fc100..261522fabdac 100644
--- a/drivers/video/fbdev/controlfb.h
+++ b/drivers/video/fbdev/controlfb.h
@@ -141,5 +141,7 @@ static struct max_cmodes control_mac_modes[] = {
141 {{ 1, 2}}, /* 1152x870, 75Hz */ 141 {{ 1, 2}}, /* 1152x870, 75Hz */
142 {{ 0, 1}}, /* 1280x960, 75Hz */ 142 {{ 0, 1}}, /* 1280x960, 75Hz */
143 {{ 0, 1}}, /* 1280x1024, 75Hz */ 143 {{ 0, 1}}, /* 1280x1024, 75Hz */
144 {{ 1, 2}}, /* 1152x768, 60Hz */
145 {{ 0, 1}}, /* 1600x1024, 60Hz */
144}; 146};
145 147
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 04612f938bab..929ca472c524 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -395,10 +395,10 @@ static void fb_flashcursor(struct work_struct *work)
395 console_unlock(); 395 console_unlock();
396} 396}
397 397
398static void cursor_timer_handler(unsigned long dev_addr) 398static void cursor_timer_handler(struct timer_list *t)
399{ 399{
400 struct fb_info *info = (struct fb_info *) dev_addr; 400 struct fbcon_ops *ops = from_timer(ops, t, cursor_timer);
401 struct fbcon_ops *ops = info->fbcon_par; 401 struct fb_info *info = ops->info;
402 402
403 queue_work(system_power_efficient_wq, &info->queue); 403 queue_work(system_power_efficient_wq, &info->queue);
404 mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies); 404 mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies);
@@ -414,8 +414,7 @@ static void fbcon_add_cursor_timer(struct fb_info *info)
414 if (!info->queue.func) 414 if (!info->queue.func)
415 INIT_WORK(&info->queue, fb_flashcursor); 415 INIT_WORK(&info->queue, fb_flashcursor);
416 416
417 setup_timer(&ops->cursor_timer, cursor_timer_handler, 417 timer_setup(&ops->cursor_timer, cursor_timer_handler, 0);
418 (unsigned long) info);
419 mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies); 418 mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies);
420 ops->flags |= FBCON_FLAGS_CURSOR_TIMER; 419 ops->flags |= FBCON_FLAGS_CURSOR_TIMER;
421 } 420 }
@@ -714,6 +713,7 @@ static int con2fb_acquire_newinfo(struct vc_data *vc, struct fb_info *info,
714 713
715 if (!err) { 714 if (!err) {
716 ops->cur_blink_jiffies = HZ / 5; 715 ops->cur_blink_jiffies = HZ / 5;
716 ops->info = info;
717 info->fbcon_par = ops; 717 info->fbcon_par = ops;
718 718
719 if (vc) 719 if (vc)
@@ -962,6 +962,7 @@ static const char *fbcon_startup(void)
962 ops->graphics = 1; 962 ops->graphics = 1;
963 ops->cur_rotate = -1; 963 ops->cur_rotate = -1;
964 ops->cur_blink_jiffies = HZ / 5; 964 ops->cur_blink_jiffies = HZ / 5;
965 ops->info = info;
965 info->fbcon_par = ops; 966 info->fbcon_par = ops;
966 if (initial_rotation != -1) 967 if (initial_rotation != -1)
967 p->con_rotate = initial_rotation; 968 p->con_rotate = initial_rotation;
diff --git a/drivers/video/fbdev/core/fbcon.h b/drivers/video/fbdev/core/fbcon.h
index 18f3ac144237..9f7744fbc962 100644
--- a/drivers/video/fbdev/core/fbcon.h
+++ b/drivers/video/fbdev/core/fbcon.h
@@ -69,6 +69,7 @@ struct fbcon_ops {
69 struct timer_list cursor_timer; /* Cursor timer */ 69 struct timer_list cursor_timer; /* Cursor timer */
70 struct fb_cursor cursor_state; 70 struct fb_cursor cursor_state;
71 struct display *p; 71 struct display *p;
72 struct fb_info *info;
72 int currcon; /* Current VC. */ 73 int currcon; /* Current VC. */
73 int cur_blink_jiffies; 74 int cur_blink_jiffies;
74 int cursor_flash; 75 int cursor_flash;
diff --git a/drivers/video/fbdev/dnfb.c b/drivers/video/fbdev/dnfb.c
index 7b1492d34e98..5505fa00c634 100644
--- a/drivers/video/fbdev/dnfb.c
+++ b/drivers/video/fbdev/dnfb.c
@@ -115,7 +115,7 @@ static struct fb_ops dn_fb_ops = {
115 .fb_imageblit = cfb_imageblit, 115 .fb_imageblit = cfb_imageblit,
116}; 116};
117 117
118struct fb_var_screeninfo dnfb_var = { 118static const struct fb_var_screeninfo dnfb_var = {
119 .xres = 1280, 119 .xres = 1280,
120 .yres = 1024, 120 .yres = 1024,
121 .xres_virtual = 2048, 121 .xres_virtual = 2048,
@@ -242,16 +242,13 @@ static int dnfb_probe(struct platform_device *dev)
242 info->screen_base = (u_char *) info->fix.smem_start; 242 info->screen_base = (u_char *) info->fix.smem_start;
243 243
244 err = fb_alloc_cmap(&info->cmap, 2, 0); 244 err = fb_alloc_cmap(&info->cmap, 2, 0);
245 if (err < 0) { 245 if (err < 0)
246 framebuffer_release(info); 246 goto release_framebuffer;
247 return err;
248 }
249 247
250 err = register_framebuffer(info); 248 err = register_framebuffer(info);
251 if (err < 0) { 249 if (err < 0) {
252 fb_dealloc_cmap(&info->cmap); 250 fb_dealloc_cmap(&info->cmap);
253 framebuffer_release(info); 251 goto release_framebuffer;
254 return err;
255 } 252 }
256 platform_set_drvdata(dev, info); 253 platform_set_drvdata(dev, info);
257 254
@@ -265,6 +262,10 @@ static int dnfb_probe(struct platform_device *dev)
265 262
266 printk("apollo frame buffer alive and kicking !\n"); 263 printk("apollo frame buffer alive and kicking !\n");
267 return err; 264 return err;
265
266release_framebuffer:
267 framebuffer_release(info);
268 return err;
268} 269}
269 270
270static struct platform_driver dnfb_driver = { 271static struct platform_driver dnfb_driver = {
diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c
index 7f6c9e6cfc6c..3b70044773b6 100644
--- a/drivers/video/fbdev/goldfishfb.c
+++ b/drivers/video/fbdev/goldfishfb.c
@@ -304,12 +304,18 @@ static int goldfish_fb_remove(struct platform_device *pdev)
304 return 0; 304 return 0;
305} 305}
306 306
307static const struct of_device_id goldfish_fb_of_match[] = {
308 { .compatible = "google,goldfish-fb", },
309 {},
310};
311MODULE_DEVICE_TABLE(of, goldfish_fb_of_match);
307 312
308static struct platform_driver goldfish_fb_driver = { 313static struct platform_driver goldfish_fb_driver = {
309 .probe = goldfish_fb_probe, 314 .probe = goldfish_fb_probe,
310 .remove = goldfish_fb_remove, 315 .remove = goldfish_fb_remove,
311 .driver = { 316 .driver = {
312 .name = "goldfish_fb" 317 .name = "goldfish_fb",
318 .of_match_table = goldfish_fb_of_match,
313 } 319 }
314}; 320};
315 321
diff --git a/drivers/video/fbdev/igafb.c b/drivers/video/fbdev/igafb.c
deleted file mode 100644
index 486f18897414..000000000000
--- a/drivers/video/fbdev/igafb.c
+++ /dev/null
@@ -1,579 +0,0 @@
1/*
2 * linux/drivers/video/igafb.c -- Frame buffer device for IGA 1682
3 *
4 * Copyright (C) 1998 Vladimir Roganov and Gleb Raiko
5 *
6 * This driver is partly based on the Frame buffer device for ATI Mach64
7 * and partially on VESA-related code.
8 *
9 * Copyright (C) 1997-1998 Geert Uytterhoeven
10 * Copyright (C) 1998 Bernd Harries
11 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
12 *
13 * This file is subject to the terms and conditions of the GNU General Public
14 * License. See the file COPYING in the main directory of this archive for
15 * more details.
16 */
17
18/******************************************************************************
19
20 TODO:
21 Despite of IGA Card has advanced graphic acceleration,
22 initial version is almost dummy and does not support it.
23 Support for video modes and acceleration must be added
24 together with accelerated X-Windows driver implementation.
25
26 Most important thing at this moment is that we have working
27 JavaEngine1 console & X with new console interface.
28
29******************************************************************************/
30
31#include <linux/module.h>
32#include <linux/kernel.h>
33#include <linux/errno.h>
34#include <linux/string.h>
35#include <linux/mm.h>
36#include <linux/slab.h>
37#include <linux/vmalloc.h>
38#include <linux/delay.h>
39#include <linux/interrupt.h>
40#include <linux/fb.h>
41#include <linux/init.h>
42#include <linux/pci.h>
43#include <linux/nvram.h>
44
45#include <asm/io.h>
46
47#ifdef CONFIG_SPARC
48#include <asm/prom.h>
49#include <asm/pcic.h>
50#endif
51
52#include <video/iga.h>
53
54struct pci_mmap_map {
55 unsigned long voff;
56 unsigned long poff;
57 unsigned long size;
58 unsigned long prot_flag;
59 unsigned long prot_mask;
60};
61
62struct iga_par {
63 struct pci_mmap_map *mmap_map;
64 unsigned long frame_buffer_phys;
65 unsigned long io_base;
66};
67
68struct fb_info fb_info;
69
70struct fb_fix_screeninfo igafb_fix __initdata = {
71 .id = "IGA 1682",
72 .type = FB_TYPE_PACKED_PIXELS,
73 .mmio_len = 1000
74};
75
76struct fb_var_screeninfo default_var = {
77 /* 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock) */
78 .xres = 640,
79 .yres = 480,
80 .xres_virtual = 640,
81 .yres_virtual = 480,
82 .bits_per_pixel = 8,
83 .red = {0, 8, 0 },
84 .green = {0, 8, 0 },
85 .blue = {0, 8, 0 },
86 .height = -1,
87 .width = -1,
88 .accel_flags = FB_ACCEL_NONE,
89 .pixclock = 39722,
90 .left_margin = 48,
91 .right_margin = 16,
92 .upper_margin = 33,
93 .lower_margin = 10,
94 .hsync_len = 96,
95 .vsync_len = 2,
96 .vmode = FB_VMODE_NONINTERLACED
97};
98
99#ifdef CONFIG_SPARC
100struct fb_var_screeninfo default_var_1024x768 __initdata = {
101 /* 1024x768, 75 Hz, Non-Interlaced (78.75 MHz dotclock) */
102 .xres = 1024,
103 .yres = 768,
104 .xres_virtual = 1024,
105 .yres_virtual = 768,
106 .bits_per_pixel = 8,
107 .red = {0, 8, 0 },
108 .green = {0, 8, 0 },
109 .blue = {0, 8, 0 },
110 .height = -1,
111 .width = -1,
112 .accel_flags = FB_ACCEL_NONE,
113 .pixclock = 12699,
114 .left_margin = 176,
115 .right_margin = 16,
116 .upper_margin = 28,
117 .lower_margin = 1,
118 .hsync_len = 96,
119 .vsync_len = 3,
120 .vmode = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
121};
122
123struct fb_var_screeninfo default_var_1152x900 __initdata = {
124 /* 1152x900, 76 Hz, Non-Interlaced (110.0 MHz dotclock) */
125 .xres = 1152,
126 .yres = 900,
127 .xres_virtual = 1152,
128 .yres_virtual = 900,
129 .bits_per_pixel = 8,
130 .red = { 0, 8, 0 },
131 .green = { 0, 8, 0 },
132 .blue = { 0, 8, 0 },
133 .height = -1,
134 .width = -1,
135 .accel_flags = FB_ACCEL_NONE,
136 .pixclock = 9091,
137 .left_margin = 234,
138 .right_margin = 24,
139 .upper_margin = 34,
140 .lower_margin = 3,
141 .hsync_len = 100,
142 .vsync_len = 3,
143 .vmode = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
144};
145
146struct fb_var_screeninfo default_var_1280x1024 __initdata = {
147 /* 1280x1024, 75 Hz, Non-Interlaced (135.00 MHz dotclock) */
148 .xres = 1280,
149 .yres = 1024,
150 .xres_virtual = 1280,
151 .yres_virtual = 1024,
152 .bits_per_pixel = 8,
153 .red = {0, 8, 0 },
154 .green = {0, 8, 0 },
155 .blue = {0, 8, 0 },
156 .height = -1,
157 .width = -1,
158 .accel_flags = 0,
159 .pixclock = 7408,
160 .left_margin = 248,
161 .right_margin = 16,
162 .upper_margin = 38,
163 .lower_margin = 1,
164 .hsync_len = 144,
165 .vsync_len = 3,
166 .vmode = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
167};
168
169/*
170 * Memory-mapped I/O functions for Sparc PCI
171 *
172 * On sparc we happen to access I/O with memory mapped functions too.
173 */
174#define pci_inb(par, reg) readb(par->io_base+(reg))
175#define pci_outb(par, val, reg) writeb(val, par->io_base+(reg))
176
177static inline unsigned int iga_inb(struct iga_par *par, unsigned int reg,
178 unsigned int idx)
179{
180 pci_outb(par, idx, reg);
181 return pci_inb(par, reg + 1);
182}
183
184static inline void iga_outb(struct iga_par *par, unsigned char val,
185 unsigned int reg, unsigned int idx )
186{
187 pci_outb(par, idx, reg);
188 pci_outb(par, val, reg+1);
189}
190
191#endif /* CONFIG_SPARC */
192
193/*
194 * Very important functionality for the JavaEngine1 computer:
195 * make screen border black (usign special IGA registers)
196 */
197static void iga_blank_border(struct iga_par *par)
198{
199 int i;
200#if 0
201 /*
202 * PROM does this for us, so keep this code as a reminder
203 * about required read from 0x3DA and writing of 0x20 in the end.
204 */
205 (void) pci_inb(par, 0x3DA); /* required for every access */
206 pci_outb(par, IGA_IDX_VGA_OVERSCAN, IGA_ATTR_CTL);
207 (void) pci_inb(par, IGA_ATTR_CTL+1);
208 pci_outb(par, 0x38, IGA_ATTR_CTL);
209 pci_outb(par, 0x20, IGA_ATTR_CTL); /* re-enable visual */
210#endif
211 /*
212 * This does not work as it was designed because the overscan
213 * color is looked up in the palette. Therefore, under X11
214 * overscan changes color.
215 */
216 for (i=0; i < 3; i++)
217 iga_outb(par, 0, IGA_EXT_CNTRL, IGA_IDX_OVERSCAN_COLOR + i);
218}
219
220#ifdef CONFIG_SPARC
221static int igafb_mmap(struct fb_info *info,
222 struct vm_area_struct *vma)
223{
224 struct iga_par *par = (struct iga_par *)info->par;
225 unsigned int size, page, map_size = 0;
226 unsigned long map_offset = 0;
227 int i;
228
229 if (!par->mmap_map)
230 return -ENXIO;
231
232 size = vma->vm_end - vma->vm_start;
233
234 /* Each page, see which map applies */
235 for (page = 0; page < size; ) {
236 map_size = 0;
237 for (i = 0; par->mmap_map[i].size; i++) {
238 unsigned long start = par->mmap_map[i].voff;
239 unsigned long end = start + par->mmap_map[i].size;
240 unsigned long offset = (vma->vm_pgoff << PAGE_SHIFT) + page;
241
242 if (start > offset)
243 continue;
244 if (offset >= end)
245 continue;
246
247 map_size = par->mmap_map[i].size - (offset - start);
248 map_offset = par->mmap_map[i].poff + (offset - start);
249 break;
250 }
251 if (!map_size) {
252 page += PAGE_SIZE;
253 continue;
254 }
255 if (page + map_size > size)
256 map_size = size - page;
257
258 pgprot_val(vma->vm_page_prot) &= ~(par->mmap_map[i].prot_mask);
259 pgprot_val(vma->vm_page_prot) |= par->mmap_map[i].prot_flag;
260
261 if (remap_pfn_range(vma, vma->vm_start + page,
262 map_offset >> PAGE_SHIFT, map_size, vma->vm_page_prot))
263 return -EAGAIN;
264
265 page += map_size;
266 }
267
268 if (!map_size)
269 return -EINVAL;
270
271 vma->vm_flags |= VM_IO;
272 return 0;
273}
274#endif /* CONFIG_SPARC */
275
276static int igafb_setcolreg(unsigned regno, unsigned red, unsigned green,
277 unsigned blue, unsigned transp,
278 struct fb_info *info)
279{
280 /*
281 * Set a single color register. The values supplied are
282 * already rounded down to the hardware's capabilities
283 * (according to the entries in the `var' structure). Return
284 * != 0 for invalid regno.
285 */
286 struct iga_par *par = (struct iga_par *)info->par;
287
288 if (regno >= info->cmap.len)
289 return 1;
290
291 pci_outb(par, regno, DAC_W_INDEX);
292 pci_outb(par, red, DAC_DATA);
293 pci_outb(par, green, DAC_DATA);
294 pci_outb(par, blue, DAC_DATA);
295
296 if (regno < 16) {
297 switch (info->var.bits_per_pixel) {
298 case 16:
299 ((u16*)(info->pseudo_palette))[regno] =
300 (regno << 10) | (regno << 5) | regno;
301 break;
302 case 24:
303 ((u32*)(info->pseudo_palette))[regno] =
304 (regno << 16) | (regno << 8) | regno;
305 break;
306 case 32:
307 { int i;
308 i = (regno << 8) | regno;
309 ((u32*)(info->pseudo_palette))[regno] = (i << 16) | i;
310 }
311 break;
312 }
313 }
314 return 0;
315}
316
317/*
318 * Framebuffer option structure
319 */
320static struct fb_ops igafb_ops = {
321 .owner = THIS_MODULE,
322 .fb_setcolreg = igafb_setcolreg,
323 .fb_fillrect = cfb_fillrect,
324 .fb_copyarea = cfb_copyarea,
325 .fb_imageblit = cfb_imageblit,
326#ifdef CONFIG_SPARC
327 .fb_mmap = igafb_mmap,
328#endif
329};
330
331static int __init iga_init(struct fb_info *info, struct iga_par *par)
332{
333 char vramsz = iga_inb(par, IGA_EXT_CNTRL, IGA_IDX_EXT_BUS_CNTL)
334 & MEM_SIZE_ALIAS;
335 int video_cmap_len;
336
337 switch (vramsz) {
338 case MEM_SIZE_1M:
339 info->fix.smem_len = 0x100000;
340 break;
341 case MEM_SIZE_2M:
342 info->fix.smem_len = 0x200000;
343 break;
344 case MEM_SIZE_4M:
345 case MEM_SIZE_RESERVED:
346 info->fix.smem_len = 0x400000;
347 break;
348 }
349
350 if (info->var.bits_per_pixel > 8)
351 video_cmap_len = 16;
352 else
353 video_cmap_len = 256;
354
355 info->fbops = &igafb_ops;
356 info->flags = FBINFO_DEFAULT;
357
358 fb_alloc_cmap(&info->cmap, video_cmap_len, 0);
359
360 if (register_framebuffer(info) < 0)
361 return 0;
362
363 fb_info(info, "%s frame buffer device at 0x%08lx [%dMB VRAM]\n",
364 info->fix.id, par->frame_buffer_phys, info->fix.smem_len >> 20);
365
366 iga_blank_border(par);
367 return 1;
368}
369
370static int __init igafb_init(void)
371{
372 struct fb_info *info;
373 struct pci_dev *pdev;
374 struct iga_par *par;
375 unsigned long addr;
376 int size, iga2000 = 0;
377
378 if (fb_get_options("igafb", NULL))
379 return -ENODEV;
380
381 pdev = pci_get_device(PCI_VENDOR_ID_INTERG,
382 PCI_DEVICE_ID_INTERG_1682, 0);
383 if (pdev == NULL) {
384 /*
385 * XXX We tried to use cyber2000fb.c for IGS 2000.
386 * But it does not initialize the chip in JavaStation-E, alas.
387 */
388 pdev = pci_get_device(PCI_VENDOR_ID_INTERG, 0x2000, 0);
389 if(pdev == NULL) {
390 return -ENXIO;
391 }
392 iga2000 = 1;
393 }
394 /* We leak a reference here but as it cannot be unloaded this is
395 fine. If you write unload code remember to free it in unload */
396
397 size = sizeof(struct iga_par) + sizeof(u32)*16;
398
399 info = framebuffer_alloc(size, &pdev->dev);
400 if (!info) {
401 printk("igafb_init: can't alloc fb_info\n");
402 pci_dev_put(pdev);
403 return -ENOMEM;
404 }
405
406 par = info->par;
407
408 if ((addr = pdev->resource[0].start) == 0) {
409 printk("igafb_init: no memory start\n");
410 kfree(info);
411 pci_dev_put(pdev);
412 return -ENXIO;
413 }
414
415 if ((info->screen_base = ioremap(addr, 1024*1024*2)) == 0) {
416 printk("igafb_init: can't remap %lx[2M]\n", addr);
417 kfree(info);
418 pci_dev_put(pdev);
419 return -ENXIO;
420 }
421
422 par->frame_buffer_phys = addr & PCI_BASE_ADDRESS_MEM_MASK;
423
424#ifdef CONFIG_SPARC
425 /*
426 * The following is sparc specific and this is why:
427 *
428 * IGS2000 has its I/O memory mapped and we want
429 * to generate memory cycles on PCI, e.g. do ioremap(),
430 * then readb/writeb() as in Documentation/io-mapping.txt.
431 *
432 * IGS1682 is more traditional, it responds to PCI I/O
433 * cycles, so we want to access it with inb()/outb().
434 *
435 * On sparc, PCIC converts CPU memory access within
436 * phys window 0x3000xxxx into PCI I/O cycles. Therefore
437 * we may use readb/writeb to access them with IGS1682.
438 *
439 * We do not take io_base_phys from resource[n].start
440 * on IGS1682 because that chip is BROKEN. It does not
441 * have a base register for I/O. We just "know" what its
442 * I/O addresses are.
443 */
444 if (iga2000) {
445 igafb_fix.mmio_start = par->frame_buffer_phys | 0x00800000;
446 } else {
447 igafb_fix.mmio_start = 0x30000000; /* XXX */
448 }
449 if ((par->io_base = (int) ioremap(igafb_fix.mmio_start, igafb_fix.smem_len)) == 0) {
450 printk("igafb_init: can't remap %lx[4K]\n", igafb_fix.mmio_start);
451 iounmap((void *)info->screen_base);
452 kfree(info);
453 pci_dev_put(pdev);
454 return -ENXIO;
455 }
456
457 /*
458 * Figure mmap addresses from PCI config space.
459 * We need two regions: for video memory and for I/O ports.
460 * Later one can add region for video coprocessor registers.
461 * However, mmap routine loops until size != 0, so we put
462 * one additional region with size == 0.
463 */
464
465 par->mmap_map = kzalloc(4 * sizeof(*par->mmap_map), GFP_ATOMIC);
466 if (!par->mmap_map) {
467 printk("igafb_init: can't alloc mmap_map\n");
468 iounmap((void *)par->io_base);
469 iounmap(info->screen_base);
470 kfree(info);
471 pci_dev_put(pdev);
472 return -ENOMEM;
473 }
474
475 /*
476 * Set default vmode and cmode from PROM properties.
477 */
478 {
479 struct device_node *dp = pci_device_to_OF_node(pdev);
480 int node = dp->node;
481 int width = prom_getintdefault(node, "width", 1024);
482 int height = prom_getintdefault(node, "height", 768);
483 int depth = prom_getintdefault(node, "depth", 8);
484 switch (width) {
485 case 1024:
486 if (height == 768)
487 default_var = default_var_1024x768;
488 break;
489 case 1152:
490 if (height == 900)
491 default_var = default_var_1152x900;
492 break;
493 case 1280:
494 if (height == 1024)
495 default_var = default_var_1280x1024;
496 break;
497 default:
498 break;
499 }
500
501 switch (depth) {
502 case 8:
503 default_var.bits_per_pixel = 8;
504 break;
505 case 16:
506 default_var.bits_per_pixel = 16;
507 break;
508 case 24:
509 default_var.bits_per_pixel = 24;
510 break;
511 case 32:
512 default_var.bits_per_pixel = 32;
513 break;
514 default:
515 break;
516 }
517 }
518
519#endif
520 igafb_fix.smem_start = (unsigned long) info->screen_base;
521 igafb_fix.line_length = default_var.xres*(default_var.bits_per_pixel/8);
522 igafb_fix.visual = default_var.bits_per_pixel <= 8 ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR;
523
524 info->var = default_var;
525 info->fix = igafb_fix;
526 info->pseudo_palette = (void *)(par + 1);
527
528 if (!iga_init(info, par)) {
529 iounmap((void *)par->io_base);
530 iounmap(info->screen_base);
531 kfree(par->mmap_map);
532 kfree(info);
533 return -ENODEV;
534 }
535
536#ifdef CONFIG_SPARC
537 /*
538 * Add /dev/fb mmap values.
539 */
540
541 /* First region is for video memory */
542 par->mmap_map[0].voff = 0x0;
543 par->mmap_map[0].poff = par->frame_buffer_phys & PAGE_MASK;
544 par->mmap_map[0].size = info->fix.smem_len & PAGE_MASK;
545 par->mmap_map[0].prot_mask = SRMMU_CACHE;
546 par->mmap_map[0].prot_flag = SRMMU_WRITE;
547
548 /* Second region is for I/O ports */
549 par->mmap_map[1].voff = par->frame_buffer_phys & PAGE_MASK;
550 par->mmap_map[1].poff = info->fix.smem_start & PAGE_MASK;
551 par->mmap_map[1].size = PAGE_SIZE * 2; /* X wants 2 pages */
552 par->mmap_map[1].prot_mask = SRMMU_CACHE;
553 par->mmap_map[1].prot_flag = SRMMU_WRITE;
554#endif /* CONFIG_SPARC */
555
556 return 0;
557}
558
559static int __init igafb_setup(char *options)
560{
561 char *this_opt;
562
563 if (!options || !*options)
564 return 0;
565
566 while ((this_opt = strsep(&options, ",")) != NULL) {
567 }
568 return 0;
569}
570
571module_init(igafb_init);
572MODULE_LICENSE("GPL");
573static struct pci_device_id igafb_pci_tbl[] = {
574 { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682,
575 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
576 { }
577};
578
579MODULE_DEVICE_TABLE(pci, igafb_pci_tbl);
diff --git a/drivers/video/fbdev/intelfb/intelfbhw.c b/drivers/video/fbdev/intelfb/intelfbhw.c
index d31ed4e2c46f..83fec573cceb 100644
--- a/drivers/video/fbdev/intelfb/intelfbhw.c
+++ b/drivers/video/fbdev/intelfb/intelfbhw.c
@@ -937,15 +937,11 @@ static int calc_pll_params(int index, int clock, u32 *retm1, u32 *retm2,
937{ 937{
938 u32 m1, m2, n, p1, p2, n1, testm; 938 u32 m1, m2, n, p1, p2, n1, testm;
939 u32 f_vco, p, p_best = 0, m, f_out = 0; 939 u32 f_vco, p, p_best = 0, m, f_out = 0;
940 u32 err_max, err_target, err_best = 10000000; 940 u32 err_best = 10000000;
941 u32 n_best = 0, m_best = 0, f_best, f_err; 941 u32 n_best = 0, m_best = 0, f_err;
942 u32 p_min, p_max, p_inc, div_max; 942 u32 p_min, p_max, p_inc, div_max;
943 struct pll_min_max *pll = &plls[index]; 943 struct pll_min_max *pll = &plls[index];
944 944
945 /* Accept 0.5% difference, but aim for 0.1% */
946 err_max = 5 * clock / 1000;
947 err_target = clock / 1000;
948
949 DBG_MSG("Clock is %d\n", clock); 945 DBG_MSG("Clock is %d\n", clock);
950 946
951 div_max = pll->max_vco / clock; 947 div_max = pll->max_vco / clock;
@@ -992,7 +988,6 @@ static int calc_pll_params(int index, int clock, u32 *retm1, u32 *retm2,
992 m_best = testm; 988 m_best = testm;
993 n_best = n; 989 n_best = n;
994 p_best = p; 990 p_best = p;
995 f_best = f_out;
996 err_best = f_err; 991 err_best = f_err;
997 } 992 }
998 } 993 }
diff --git a/drivers/video/fbdev/matrox/matroxfb_base.c b/drivers/video/fbdev/matrox/matroxfb_base.c
index b9b284d79631..838869c6490c 100644
--- a/drivers/video/fbdev/matrox/matroxfb_base.c
+++ b/drivers/video/fbdev/matrox/matroxfb_base.c
@@ -2056,7 +2056,7 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm
2056 2056
2057 minfo = kzalloc(sizeof(*minfo), GFP_KERNEL); 2057 minfo = kzalloc(sizeof(*minfo), GFP_KERNEL);
2058 if (!minfo) 2058 if (!minfo)
2059 return -1; 2059 return -ENOMEM;
2060 2060
2061 minfo->pcidev = pdev; 2061 minfo->pcidev = pdev;
2062 minfo->dead = 0; 2062 minfo->dead = 0;
diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c
index 7846f0e8bbbb..79b1dc7f042b 100644
--- a/drivers/video/fbdev/mxsfb.c
+++ b/drivers/video/fbdev/mxsfb.c
@@ -150,7 +150,7 @@
150#define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */ 150#define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */
151 151
152#define MXSFB_SYNC_DATA_ENABLE_HIGH_ACT (1 << 6) 152#define MXSFB_SYNC_DATA_ENABLE_HIGH_ACT (1 << 6)
153#define MXSFB_SYNC_DOTCLK_FALLING_ACT (1 << 7) /* negtive edge sampling */ 153#define MXSFB_SYNC_DOTCLK_FALLING_ACT (1 << 7) /* negative edge sampling */
154 154
155enum mxsfb_devtype { 155enum mxsfb_devtype {
156 MXSFB_V3, 156 MXSFB_V3,
@@ -788,7 +788,16 @@ static int mxsfb_init_fbinfo_dt(struct mxsfb_info *host,
788 788
789 if (vm.flags & DISPLAY_FLAGS_DE_HIGH) 789 if (vm.flags & DISPLAY_FLAGS_DE_HIGH)
790 host->sync |= MXSFB_SYNC_DATA_ENABLE_HIGH_ACT; 790 host->sync |= MXSFB_SYNC_DATA_ENABLE_HIGH_ACT;
791 if (vm.flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE) 791
792 /*
793 * The PIXDATA flags of the display_flags enum are controller
794 * centric, e.g. NEGEDGE means drive data on negative edge.
795 * However, the drivers flag is display centric: Sample the
796 * data on negative (falling) edge. Therefore, check for the
797 * POSEDGE flag:
798 * drive on positive edge => sample on negative edge
799 */
800 if (vm.flags & DISPLAY_FLAGS_PIXDATA_POSEDGE)
792 host->sync |= MXSFB_SYNC_DOTCLK_FALLING_ACT; 801 host->sync |= MXSFB_SYNC_DOTCLK_FALLING_ACT;
793 802
794put_display_node: 803put_display_node:
diff --git a/drivers/video/fbdev/omap/hwa742.c b/drivers/video/fbdev/omap/hwa742.c
index a4ee65b8f918..6199d4806193 100644
--- a/drivers/video/fbdev/omap/hwa742.c
+++ b/drivers/video/fbdev/omap/hwa742.c
@@ -474,7 +474,7 @@ static void auto_update_complete(void *data)
474 jiffies + HWA742_AUTO_UPDATE_TIME); 474 jiffies + HWA742_AUTO_UPDATE_TIME);
475} 475}
476 476
477static void hwa742_update_window_auto(unsigned long arg) 477static void hwa742_update_window_auto(struct timer_list *unused)
478{ 478{
479 LIST_HEAD(req_list); 479 LIST_HEAD(req_list);
480 struct hwa742_request *last; 480 struct hwa742_request *last;
@@ -1002,9 +1002,7 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode,
1002 hwa742.auto_update_window.height = fbdev->panel->y_res; 1002 hwa742.auto_update_window.height = fbdev->panel->y_res;
1003 hwa742.auto_update_window.format = 0; 1003 hwa742.auto_update_window.format = 0;
1004 1004
1005 init_timer(&hwa742.auto_update_timer); 1005 timer_setup(&hwa742.auto_update_timer, hwa742_update_window_auto, 0);
1006 hwa742.auto_update_timer.function = hwa742_update_window_auto;
1007 hwa742.auto_update_timer.data = 0;
1008 1006
1009 hwa742.prev_color_mode = -1; 1007 hwa742.prev_color_mode = -1;
1010 hwa742.prev_flags = 0; 1008 hwa742.prev_flags = 0;
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
index 30d49f3800b3..8e1d60d48dbb 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
@@ -3988,7 +3988,7 @@ static void dsi_update_screen_dispc(struct platform_device *dsidev)
3988} 3988}
3989 3989
3990#ifdef DSI_CATCH_MISSING_TE 3990#ifdef DSI_CATCH_MISSING_TE
3991static void dsi_te_timeout(unsigned long arg) 3991static void dsi_te_timeout(struct timer_list *unused)
3992{ 3992{
3993 DSSERR("TE not received for 250ms!\n"); 3993 DSSERR("TE not received for 250ms!\n");
3994} 3994}
@@ -5298,9 +5298,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
5298 dsi_framedone_timeout_work_callback); 5298 dsi_framedone_timeout_work_callback);
5299 5299
5300#ifdef DSI_CATCH_MISSING_TE 5300#ifdef DSI_CATCH_MISSING_TE
5301 init_timer(&dsi->te_timer); 5301 timer_setup(&dsi->te_timer, dsi_te_timeout, 0);
5302 dsi->te_timer.function = dsi_te_timeout;
5303 dsi->te_timer.data = 0;
5304#endif 5302#endif
5305 5303
5306 res = platform_get_resource_byname(dsidev, IORESOURCE_MEM, "proto"); 5304 res = platform_get_resource_byname(dsidev, IORESOURCE_MEM, "proto");
diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
index 1d7c012f09db..e08e5664e330 100644
--- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
@@ -1477,7 +1477,7 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
1477static int omapfb_parse_vram_param(const char *param, int max_entries, 1477static int omapfb_parse_vram_param(const char *param, int max_entries,
1478 unsigned long *sizes, unsigned long *paddrs) 1478 unsigned long *sizes, unsigned long *paddrs)
1479{ 1479{
1480 int fbnum; 1480 unsigned int fbnum;
1481 unsigned long size; 1481 unsigned long size;
1482 unsigned long paddr = 0; 1482 unsigned long paddr = 0;
1483 char *p, *start; 1483 char *p, *start;
diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c
index 933619da1a94..55fbb432c053 100644
--- a/drivers/video/fbdev/pxa3xx-gcu.c
+++ b/drivers/video/fbdev/pxa3xx-gcu.c
@@ -512,28 +512,26 @@ pxa3xx_gcu_mmap(struct file *file, struct vm_area_struct *vma)
512 512
513#ifdef PXA3XX_GCU_DEBUG_TIMER 513#ifdef PXA3XX_GCU_DEBUG_TIMER
514static struct timer_list pxa3xx_gcu_debug_timer; 514static struct timer_list pxa3xx_gcu_debug_timer;
515static struct pxa3xx_gcu_priv *debug_timer_priv;
515 516
516static void pxa3xx_gcu_debug_timedout(unsigned long ptr) 517static void pxa3xx_gcu_debug_timedout(struct timer_list *unused)
517{ 518{
518 struct pxa3xx_gcu_priv *priv = (struct pxa3xx_gcu_priv *) ptr; 519 struct pxa3xx_gcu_priv *priv = debug_timer_priv;
519 520
520 QERROR("Timer DUMP"); 521 QERROR("Timer DUMP");
521 522
522 /* init the timer structure */ 523 mod_timer(&pxa3xx_gcu_debug_timer, jiffies + 5 * HZ);
523 init_timer(&pxa3xx_gcu_debug_timer);
524 pxa3xx_gcu_debug_timer.function = pxa3xx_gcu_debug_timedout;
525 pxa3xx_gcu_debug_timer.data = ptr;
526 pxa3xx_gcu_debug_timer.expires = jiffies + 5*HZ; /* one second */
527
528 add_timer(&pxa3xx_gcu_debug_timer);
529} 524}
530 525
531static void pxa3xx_gcu_init_debug_timer(void) 526static void pxa3xx_gcu_init_debug_timer(struct pxa3xx_gcu_priv *priv)
532{ 527{
533 pxa3xx_gcu_debug_timedout((unsigned long) &pxa3xx_gcu_debug_timer); 528 /* init the timer structure */
529 debug_timer_priv = priv;
530 timer_setup(&pxa3xx_gcu_debug_timer, pxa3xx_gcu_debug_timedout, 0);
531 pxa3xx_gcu_debug_timedout(NULL);
534} 532}
535#else 533#else
536static inline void pxa3xx_gcu_init_debug_timer(void) {} 534static inline void pxa3xx_gcu_init_debug_timer(struct pxa3xx_gcu_priv *priv) {}
537#endif 535#endif
538 536
539static int 537static int
@@ -670,7 +668,7 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
670 platform_set_drvdata(pdev, priv); 668 platform_set_drvdata(pdev, priv);
671 priv->resource_mem = r; 669 priv->resource_mem = r;
672 pxa3xx_gcu_reset(priv); 670 pxa3xx_gcu_reset(priv);
673 pxa3xx_gcu_init_debug_timer(); 671 pxa3xx_gcu_init_debug_timer(priv);
674 672
675 dev_info(dev, "registered @0x%p, DMA 0x%p (%d bytes), IRQ %d\n", 673 dev_info(dev, "registered @0x%p, DMA 0x%p (%d bytes), IRQ %d\n",
676 (void *) r->start, (void *) priv->shared_phys, 674 (void *) r->start, (void *) priv->shared_phys,
diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c
index fc2aaa5aca23..15ae50063296 100644
--- a/drivers/video/fbdev/sa1100fb.c
+++ b/drivers/video/fbdev/sa1100fb.c
@@ -323,13 +323,11 @@ sa1100fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
323 * according to the RGB bitfield information. 323 * according to the RGB bitfield information.
324 */ 324 */
325 if (regno < 16) { 325 if (regno < 16) {
326 u32 *pal = fbi->fb.pseudo_palette;
327
328 val = chan_to_field(red, &fbi->fb.var.red); 326 val = chan_to_field(red, &fbi->fb.var.red);
329 val |= chan_to_field(green, &fbi->fb.var.green); 327 val |= chan_to_field(green, &fbi->fb.var.green);
330 val |= chan_to_field(blue, &fbi->fb.var.blue); 328 val |= chan_to_field(blue, &fbi->fb.var.blue);
331 329
332 pal[regno] = val; 330 fbi->pseudo_palette[regno] = val;
333 ret = 0; 331 ret = 0;
334 } 332 }
335 break; 333 break;
@@ -1132,12 +1130,10 @@ static struct sa1100fb_info *sa1100fb_init_fbinfo(struct device *dev)
1132 struct sa1100fb_info *fbi; 1130 struct sa1100fb_info *fbi;
1133 unsigned i; 1131 unsigned i;
1134 1132
1135 fbi = kmalloc(sizeof(struct sa1100fb_info) + sizeof(u32) * 16, 1133 fbi = devm_kzalloc(dev, sizeof(struct sa1100fb_info), GFP_KERNEL);
1136 GFP_KERNEL);
1137 if (!fbi) 1134 if (!fbi)
1138 return NULL; 1135 return NULL;
1139 1136
1140 memset(fbi, 0, sizeof(struct sa1100fb_info));
1141 fbi->dev = dev; 1137 fbi->dev = dev;
1142 1138
1143 strcpy(fbi->fb.fix.id, SA1100_NAME); 1139 strcpy(fbi->fb.fix.id, SA1100_NAME);
@@ -1159,7 +1155,7 @@ static struct sa1100fb_info *sa1100fb_init_fbinfo(struct device *dev)
1159 fbi->fb.fbops = &sa1100fb_ops; 1155 fbi->fb.fbops = &sa1100fb_ops;
1160 fbi->fb.flags = FBINFO_DEFAULT; 1156 fbi->fb.flags = FBINFO_DEFAULT;
1161 fbi->fb.monspecs = monspecs; 1157 fbi->fb.monspecs = monspecs;
1162 fbi->fb.pseudo_palette = (fbi + 1); 1158 fbi->fb.pseudo_palette = fbi->pseudo_palette;
1163 1159
1164 fbi->rgb[RGB_4] = &rgb_4; 1160 fbi->rgb[RGB_4] = &rgb_4;
1165 fbi->rgb[RGB_8] = &rgb_8; 1161 fbi->rgb[RGB_8] = &rgb_8;
@@ -1218,48 +1214,42 @@ static int sa1100fb_probe(struct platform_device *pdev)
1218 return -EINVAL; 1214 return -EINVAL;
1219 } 1215 }
1220 1216
1221 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1222 irq = platform_get_irq(pdev, 0); 1217 irq = platform_get_irq(pdev, 0);
1223 if (irq < 0 || !res) 1218 if (irq < 0)
1224 return -EINVAL; 1219 return -EINVAL;
1225 1220
1226 if (!request_mem_region(res->start, resource_size(res), "LCD"))
1227 return -EBUSY;
1228
1229 fbi = sa1100fb_init_fbinfo(&pdev->dev); 1221 fbi = sa1100fb_init_fbinfo(&pdev->dev);
1230 ret = -ENOMEM;
1231 if (!fbi) 1222 if (!fbi)
1232 goto failed; 1223 return -ENOMEM;
1233
1234 fbi->clk = clk_get(&pdev->dev, NULL);
1235 if (IS_ERR(fbi->clk)) {
1236 ret = PTR_ERR(fbi->clk);
1237 fbi->clk = NULL;
1238 goto failed;
1239 }
1240 1224
1241 fbi->base = ioremap(res->start, resource_size(res)); 1225 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1242 if (!fbi->base) 1226 fbi->base = devm_ioremap_resource(&pdev->dev, res);
1243 goto failed; 1227 if (IS_ERR(fbi->base))
1228 return PTR_ERR(fbi->base);
1244 1229
1245 /* Initialize video memory */ 1230 fbi->clk = devm_clk_get(&pdev->dev, NULL);
1246 ret = sa1100fb_map_video_memory(fbi); 1231 if (IS_ERR(fbi->clk))
1247 if (ret) 1232 return PTR_ERR(fbi->clk);
1248 goto failed;
1249 1233
1250 ret = request_irq(irq, sa1100fb_handle_irq, 0, "LCD", fbi); 1234 ret = devm_request_irq(&pdev->dev, irq, sa1100fb_handle_irq, 0,
1235 "LCD", fbi);
1251 if (ret) { 1236 if (ret) {
1252 dev_err(&pdev->dev, "request_irq failed: %d\n", ret); 1237 dev_err(&pdev->dev, "request_irq failed: %d\n", ret);
1253 goto failed; 1238 return ret;
1254 } 1239 }
1255 1240
1256 if (machine_is_shannon()) { 1241 if (machine_is_shannon()) {
1257 ret = gpio_request_one(SHANNON_GPIO_DISP_EN, 1242 ret = devm_gpio_request_one(&pdev->dev, SHANNON_GPIO_DISP_EN,
1258 GPIOF_OUT_INIT_LOW, "display enable"); 1243 GPIOF_OUT_INIT_LOW, "display enable");
1259 if (ret) 1244 if (ret)
1260 goto err_free_irq; 1245 return ret;
1261 } 1246 }
1262 1247
1248 /* Initialize video memory */
1249 ret = sa1100fb_map_video_memory(fbi);
1250 if (ret)
1251 return ret;
1252
1263 /* 1253 /*
1264 * This makes sure that our colour bitfield 1254 * This makes sure that our colour bitfield
1265 * descriptors are correctly initialised. 1255 * descriptors are correctly initialised.
@@ -1269,8 +1259,11 @@ static int sa1100fb_probe(struct platform_device *pdev)
1269 platform_set_drvdata(pdev, fbi); 1259 platform_set_drvdata(pdev, fbi);
1270 1260
1271 ret = register_framebuffer(&fbi->fb); 1261 ret = register_framebuffer(&fbi->fb);
1272 if (ret < 0) 1262 if (ret < 0) {
1273 goto err_reg_fb; 1263 dma_free_wc(fbi->dev, fbi->map_size, fbi->map_cpu,
1264 fbi->map_dma);
1265 return ret;
1266 }
1274 1267
1275#ifdef CONFIG_CPU_FREQ 1268#ifdef CONFIG_CPU_FREQ
1276 fbi->freq_transition.notifier_call = sa1100fb_freq_transition; 1269 fbi->freq_transition.notifier_call = sa1100fb_freq_transition;
@@ -1281,20 +1274,6 @@ static int sa1100fb_probe(struct platform_device *pdev)
1281 1274
1282 /* This driver cannot be unloaded at the moment */ 1275 /* This driver cannot be unloaded at the moment */
1283 return 0; 1276 return 0;
1284
1285 err_reg_fb:
1286 if (machine_is_shannon())
1287 gpio_free(SHANNON_GPIO_DISP_EN);
1288 err_free_irq:
1289 free_irq(irq, fbi);
1290 failed:
1291 if (fbi)
1292 iounmap(fbi->base);
1293 if (fbi->clk)
1294 clk_put(fbi->clk);
1295 kfree(fbi);
1296 release_mem_region(res->start, resource_size(res));
1297 return ret;
1298} 1277}
1299 1278
1300static struct platform_driver sa1100fb_driver = { 1279static struct platform_driver sa1100fb_driver = {
diff --git a/drivers/video/fbdev/sa1100fb.h b/drivers/video/fbdev/sa1100fb.h
index 0139d13377a5..7a1a9ca33cec 100644
--- a/drivers/video/fbdev/sa1100fb.h
+++ b/drivers/video/fbdev/sa1100fb.h
@@ -69,6 +69,8 @@ struct sa1100fb_info {
69 69
70 const struct sa1100fb_mach_info *inf; 70 const struct sa1100fb_mach_info *inf;
71 struct clk *clk; 71 struct clk *clk;
72
73 u32 pseudo_palette[16];
72}; 74};
73 75
74#define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member) 76#define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member)
diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c
index 1ec9c3e0e1d8..02ee752d5000 100644
--- a/drivers/video/fbdev/sis/init301.c
+++ b/drivers/video/fbdev/sis/init301.c
@@ -6486,7 +6486,7 @@ SiS_SetTVSpecial(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
6486 6486
6487 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { 6487 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) {
6488 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) { 6488 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) {
6489 const unsigned char specialtv[] = { 6489 static const unsigned char specialtv[] = {
6490 0xa7,0x07,0xf2,0x6e,0x17,0x8b,0x73,0x53, 6490 0xa7,0x07,0xf2,0x6e,0x17,0x8b,0x73,0x53,
6491 0x13,0x40,0x34,0xf4,0x63,0xbb,0xcc,0x7a, 6491 0x13,0x40,0x34,0xf4,0x63,0xbb,0xcc,0x7a,
6492 0x58,0xe4,0x73,0xda,0x13 6492 0x58,0xe4,0x73,0xda,0x13
diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c
index e92303823a4b..ecdd054d8951 100644
--- a/drivers/video/fbdev/sis/sis_main.c
+++ b/drivers/video/fbdev/sis/sis_main.c
@@ -1702,6 +1702,7 @@ static int sisfb_ioctl(struct fb_info *info, unsigned int cmd,
1702 if(ivideo->warncount++ < 10) 1702 if(ivideo->warncount++ < 10)
1703 printk(KERN_INFO 1703 printk(KERN_INFO
1704 "sisfb: Deprecated ioctl call received - update your application!\n"); 1704 "sisfb: Deprecated ioctl call received - update your application!\n");
1705 /* fall through */
1705 case SISFB_GET_INFO: /* For communication with X driver */ 1706 case SISFB_GET_INFO: /* For communication with X driver */
1706 ivideo->sisfb_infoblock.sisfb_id = SISFB_ID; 1707 ivideo->sisfb_infoblock.sisfb_id = SISFB_ID;
1707 ivideo->sisfb_infoblock.sisfb_version = VER_MAJOR; 1708 ivideo->sisfb_infoblock.sisfb_version = VER_MAJOR;
@@ -1755,6 +1756,7 @@ static int sisfb_ioctl(struct fb_info *info, unsigned int cmd,
1755 if(ivideo->warncount++ < 10) 1756 if(ivideo->warncount++ < 10)
1756 printk(KERN_INFO 1757 printk(KERN_INFO
1757 "sisfb: Deprecated ioctl call received - update your application!\n"); 1758 "sisfb: Deprecated ioctl call received - update your application!\n");
1759 /* fall through */
1758 case SISFB_GET_VBRSTATUS: 1760 case SISFB_GET_VBRSTATUS:
1759 if(sisfb_CheckVBRetrace(ivideo)) 1761 if(sisfb_CheckVBRetrace(ivideo))
1760 return put_user((u32)1, argp); 1762 return put_user((u32)1, argp);
@@ -1765,6 +1767,7 @@ static int sisfb_ioctl(struct fb_info *info, unsigned int cmd,
1765 if(ivideo->warncount++ < 10) 1767 if(ivideo->warncount++ < 10)
1766 printk(KERN_INFO 1768 printk(KERN_INFO
1767 "sisfb: Deprecated ioctl call received - update your application!\n"); 1769 "sisfb: Deprecated ioctl call received - update your application!\n");
1770 /* fall through */
1768 case SISFB_GET_AUTOMAXIMIZE: 1771 case SISFB_GET_AUTOMAXIMIZE:
1769 if(ivideo->sisfb_max) 1772 if(ivideo->sisfb_max)
1770 return put_user((u32)1, argp); 1773 return put_user((u32)1, argp);
@@ -1775,6 +1778,7 @@ static int sisfb_ioctl(struct fb_info *info, unsigned int cmd,
1775 if(ivideo->warncount++ < 10) 1778 if(ivideo->warncount++ < 10)
1776 printk(KERN_INFO 1779 printk(KERN_INFO
1777 "sisfb: Deprecated ioctl call received - update your application!\n"); 1780 "sisfb: Deprecated ioctl call received - update your application!\n");
1781 /* fall through */
1778 case SISFB_SET_AUTOMAXIMIZE: 1782 case SISFB_SET_AUTOMAXIMIZE:
1779 if(get_user(gpu32, argp)) 1783 if(get_user(gpu32, argp))
1780 return -EFAULT; 1784 return -EFAULT;
diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index 076dd2711630..6f0a19501c6a 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -1008,6 +1008,7 @@ static int sm501fb_blank_crt(int blank_mode, struct fb_info *info)
1008 case FB_BLANK_POWERDOWN: 1008 case FB_BLANK_POWERDOWN:
1009 ctrl &= ~SM501_DC_CRT_CONTROL_ENABLE; 1009 ctrl &= ~SM501_DC_CRT_CONTROL_ENABLE;
1010 sm501_misc_control(fbi->dev->parent, SM501_MISC_DAC_POWER, 0); 1010 sm501_misc_control(fbi->dev->parent, SM501_MISC_DAC_POWER, 0);
1011 /* fall through */
1011 1012
1012 case FB_BLANK_NORMAL: 1013 case FB_BLANK_NORMAL:
1013 ctrl |= SM501_DC_CRT_CONTROL_BLANK; 1014 ctrl |= SM501_DC_CRT_CONTROL_BLANK;
@@ -1889,6 +1890,9 @@ static void sm501_free_init_fb(struct sm501fb_info *info,
1889{ 1890{
1890 struct fb_info *fbi = info->fb[head]; 1891 struct fb_info *fbi = info->fb[head];
1891 1892
1893 if (!fbi)
1894 return;
1895
1892 fb_dealloc_cmap(&fbi->cmap); 1896 fb_dealloc_cmap(&fbi->cmap);
1893} 1897}
1894 1898
@@ -2076,8 +2080,10 @@ static int sm501fb_remove(struct platform_device *pdev)
2076 sm501_free_init_fb(info, HEAD_CRT); 2080 sm501_free_init_fb(info, HEAD_CRT);
2077 sm501_free_init_fb(info, HEAD_PANEL); 2081 sm501_free_init_fb(info, HEAD_PANEL);
2078 2082
2079 unregister_framebuffer(fbinfo_crt); 2083 if (fbinfo_crt)
2080 unregister_framebuffer(fbinfo_pnl); 2084 unregister_framebuffer(fbinfo_crt);
2085 if (fbinfo_pnl)
2086 unregister_framebuffer(fbinfo_pnl);
2081 2087
2082 sm501fb_stop(info); 2088 sm501fb_stop(info);
2083 kfree(info); 2089 kfree(info);
@@ -2094,8 +2100,12 @@ static int sm501fb_suspend_fb(struct sm501fb_info *info,
2094 enum sm501_controller head) 2100 enum sm501_controller head)
2095{ 2101{
2096 struct fb_info *fbi = info->fb[head]; 2102 struct fb_info *fbi = info->fb[head];
2097 struct sm501fb_par *par = fbi->par; 2103 struct sm501fb_par *par;
2104
2105 if (!fbi)
2106 return 0;
2098 2107
2108 par = fbi->par;
2099 if (par->screen.size == 0) 2109 if (par->screen.size == 0)
2100 return 0; 2110 return 0;
2101 2111
@@ -2141,8 +2151,12 @@ static void sm501fb_resume_fb(struct sm501fb_info *info,
2141 enum sm501_controller head) 2151 enum sm501_controller head)
2142{ 2152{
2143 struct fb_info *fbi = info->fb[head]; 2153 struct fb_info *fbi = info->fb[head];
2144 struct sm501fb_par *par = fbi->par; 2154 struct sm501fb_par *par;
2155
2156 if (!fbi)
2157 return;
2145 2158
2159 par = fbi->par;
2146 if (par->screen.size == 0) 2160 if (par->screen.size == 0)
2147 return; 2161 return;
2148 2162
diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
index ef08a104fb42..d44f14242016 100644
--- a/drivers/video/fbdev/udlfb.c
+++ b/drivers/video/fbdev/udlfb.c
@@ -769,11 +769,11 @@ static int dlfb_get_edid(struct dlfb_data *dev, char *edid, int len)
769 769
770 for (i = 0; i < len; i++) { 770 for (i = 0; i < len; i++) {
771 ret = usb_control_msg(dev->udev, 771 ret = usb_control_msg(dev->udev,
772 usb_rcvctrlpipe(dev->udev, 0), (0x02), 772 usb_rcvctrlpipe(dev->udev, 0), 0x02,
773 (0x80 | (0x02 << 5)), i << 8, 0xA1, rbuf, 2, 773 (0x80 | (0x02 << 5)), i << 8, 0xA1,
774 HZ); 774 rbuf, 2, USB_CTRL_GET_TIMEOUT);
775 if (ret < 1) { 775 if (ret < 2) {
776 pr_err("Read EDID byte %d failed err %x\n", i, ret); 776 pr_err("Read EDID byte %d failed: %d\n", i, ret);
777 i--; 777 i--;
778 break; 778 break;
779 } 779 }
diff --git a/include/video/iga.h b/include/video/iga.h
deleted file mode 100644
index 83ca18492e00..000000000000
--- a/include/video/iga.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/* $Id: iga.h,v 1.2 1999/09/11 22:56:31 zaitcev Exp $
3 * iga1682.h: Sparc/PCI iga1682 driver constants etc.
4 *
5 * Copyleft 1998 V. Roganov and G. Raiko
6 */
7
8#ifndef _IGA1682_H
9#define _IGA1682_H 1
10
11#define IGA_ATTR_CTL 0x3C0
12#define IGA_IDX_VGA_OVERSCAN 0x11
13#define DAC_W_INDEX 0x03C8
14#define DAC_DATA 0x03C9
15#define IGA_EXT_CNTRL 0x3CE
16#define IGA_IDX_EXT_BUS_CNTL 0x30
17#define MEM_SIZE_ALIAS 0x3
18#define MEM_SIZE_1M 0x0
19#define MEM_SIZE_2M 0x1
20#define MEM_SIZE_4M 0x2
21#define MEM_SIZE_RESERVED 0x3
22#define IGA_IDX_OVERSCAN_COLOR 0x58
23#define IGA_IDX_EXT_MEM_2 0x72
24
25#endif /* !(_IGA1682_H) */