Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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
...

+168 -752
+17
Documentation/devicetree/bindings/display/google,goldfish-fb.txt
··· 1 + Android Goldfish framebuffer 2 + 3 + Android Goldfish framebuffer device used by Android emulator. 4 + 5 + Required properties: 6 + 7 + - compatible : should contain "google,goldfish-fb" 8 + - reg : <registers mapping> 9 + - interrupts : <interrupt mapping> 10 + 11 + Example: 12 + 13 + display-controller@1f008000 { 14 + compatible = "google,goldfish-fb"; 15 + interrupts = <0x10>; 16 + reg = <0x1f008000 0x100>; 17 + };
-10
drivers/video/fbdev/Kconfig
··· 905 905 This is the frame buffer device driver for the SBUS-based Sun ZX 906 906 (leo) frame buffer cards. 907 907 908 - config 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 - 918 908 config FB_XVR500 919 909 bool "Sun XVR-500 3DLABS Wildcat support" 920 910 depends on (FB = y) && PCI && SPARC64
-1
drivers/video/fbdev/Makefile
··· 65 65 obj-$(CONFIG_FB_XVR500) += sunxvr500.o 66 66 obj-$(CONFIG_FB_XVR2500) += sunxvr2500.o 67 67 obj-$(CONFIG_FB_XVR1000) += sunxvr1000.o 68 - obj-$(CONFIG_FB_IGA) += igafb.o 69 68 obj-$(CONFIG_FB_APOLLO) += dnfb.o 70 69 obj-$(CONFIG_FB_Q40) += q40fb.o 71 70 obj-$(CONFIG_FB_TGA) += tgafb.o
+2 -2
drivers/video/fbdev/aty/atyfb_base.c
··· 2272 2272 2273 2273 static 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 2276 44, 50, 55, 66, 75, 80, 100 2277 2277 }; 2278 - const int ragexl_tbl[] = { 2278 + static const int ragexl_tbl[] = { 2279 2279 50, 66, 75, 83, 90, 95, 100, 105, 2280 2280 110, 115, 120, 125, 133, 143, 166 2281 2281 };
+4 -6
drivers/video/fbdev/aty/radeon_base.c
··· 1454 1454 /* 1455 1455 * Timer function for delayed LVDS panel power up/down 1456 1456 */ 1457 - static void radeon_lvds_timer_func(unsigned long data) 1457 + static 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 1461 radeon_engine_idle(); 1462 1462 ··· 1534 1534 static void radeon_calc_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs *regs, 1535 1535 unsigned long freq) 1536 1536 { 1537 - const struct { 1537 + static const struct { 1538 1538 int divider; 1539 1539 int bitvalue; 1540 1540 } *post_div, ··· 2291 2291 rinfo->pdev = pdev; 2292 2292 2293 2293 spin_lock_init(&rinfo->reg_lock); 2294 - init_timer(&rinfo->lvds_timer); 2295 - rinfo->lvds_timer.function = radeon_lvds_timer_func; 2296 - rinfo->lvds_timer.data = (unsigned long)rinfo; 2294 + timer_setup(&rinfo->lvds_timer, radeon_lvds_timer_func, 0); 2297 2295 2298 2296 c1 = ent->device >> 8; 2299 2297 c2 = ent->device & 0xff;
+3
drivers/video/fbdev/aty/radeon_pm.c
··· 1208 1208 case 1: 1209 1209 if (mc & 0x4) 1210 1210 break; 1211 + /* fall through */ 1211 1212 case 2: 1212 1213 dll_sleep_mask |= MDLL_R300_RDCK__MRDCKB_SLEEP; 1213 1214 dll_reset_mask |= MDLL_R300_RDCK__MRDCKB_RESET; 1215 + /* fall through */ 1214 1216 case 0: 1215 1217 dll_sleep_mask |= MDLL_R300_RDCK__MRDCKA_SLEEP; 1216 1218 dll_reset_mask |= MDLL_R300_RDCK__MRDCKA_RESET; ··· 1221 1219 case 1: 1222 1220 if (!(mc & 0x4)) 1223 1221 break; 1222 + /* fall through */ 1224 1223 case 2: 1225 1224 dll_sleep_mask |= MDLL_R300_RDCK__MRDCKD_SLEEP; 1226 1225 dll_reset_mask |= MDLL_R300_RDCK__MRDCKD_RESET;
+23 -20
drivers/video/fbdev/au1200fb.c
··· 1518 1518 static int au1200fb_init_fbinfo(struct au1200fb_device *fbdev) 1519 1519 { 1520 1520 struct fb_info *fbi = fbdev->fb_info; 1521 - int bpp; 1521 + int bpp, ret; 1522 1522 1523 1523 fbi->fbops = &au1200fb_fb_ops; 1524 1524 ··· 1546 1546 } 1547 1547 1548 1548 fbi->pseudo_palette = kcalloc(16, sizeof(u32), GFP_KERNEL); 1549 - if (!fbi->pseudo_palette) { 1549 + if (!fbi->pseudo_palette) 1550 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 1554 print_err("Fail to allocate colormap (%d entries)", 1555 - AU1200_LCD_NBR_PALETTE_ENTRIES); 1556 - kfree(fbi->pseudo_palette); 1557 - return -EFAULT; 1555 + AU1200_LCD_NBR_PALETTE_ENTRIES); 1556 + return ret; 1558 1557 } 1559 1558 1560 1559 strncpy(fbi->fix.id, "AU1200", sizeof(fbi->fix.id)); ··· 1667 1668 printk(DRIVER_NAME ": Panel %d %s\n", panel_index, panel->name); 1668 1669 printk(DRIVER_NAME ": Win %d %s\n", window_index, win->name); 1669 1670 1670 - /* shut gcc up */ 1671 - ret = 0; 1672 - fbdev = NULL; 1673 - 1674 1671 for (plane = 0; plane < device_count; ++plane) { 1675 1672 bpp = winbpp(win->w[plane].mode_winctrl1); 1676 1673 if (win->w[plane].xres == 0) ··· 1676 1681 1677 1682 fbi = framebuffer_alloc(sizeof(struct au1200fb_device), 1678 1683 &dev->dev); 1679 - if (!fbi) 1684 + if (!fbi) { 1685 + ret = -ENOMEM; 1680 1686 goto failed; 1687 + } 1681 1688 1682 1689 _au1200fb_infos[plane] = fbi; 1683 1690 fbdev = fbi->par; ··· 1698 1701 if (!fbdev->fb_mem) { 1699 1702 print_err("fail to allocate frambuffer (size: %dK))", 1700 1703 fbdev->fb_len / 1024); 1701 - return -ENOMEM; 1704 + ret = -ENOMEM; 1705 + goto failed; 1702 1706 } 1703 1707 1704 1708 /* ··· 1716 1718 print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024); 1717 1719 1718 1720 /* Init FB data */ 1719 - if ((ret = au1200fb_init_fbinfo(fbdev)) < 0) 1721 + ret = au1200fb_init_fbinfo(fbdev); 1722 + if (ret < 0) 1720 1723 goto failed; 1721 1724 1722 1725 /* Register new framebuffer */ ··· 1757 1758 return 0; 1758 1759 1759 1760 failed: 1760 - /* NOTE: This only does the current plane/window that failed; others are still active */ 1761 - if (fbi) { 1761 + for (plane = 0; plane < device_count; ++plane) { 1762 + fbi = _au1200fb_infos[plane]; 1763 + if (!fbi) 1764 + break; 1765 + 1766 + /* Clean up all probe data */ 1767 + unregister_framebuffer(fbi); 1762 1768 if (fbi->cmap.len != 0) 1763 1769 fb_dealloc_cmap(&fbi->cmap); 1764 1770 kfree(fbi->pseudo_palette); 1771 + 1772 + framebuffer_release(fbi); 1773 + _au1200fb_infos[plane] = NULL; 1765 1774 } 1766 - if (plane == 0) 1767 - free_irq(AU1200_LCD_INT, (void*)dev); 1768 1775 return ret; 1769 1776 } 1770 1777 1771 1778 static int au1200fb_drv_remove(struct platform_device *dev) 1772 1779 { 1773 1780 struct au1200fb_platdata *pd = platform_get_drvdata(dev); 1774 - struct au1200fb_device *fbdev; 1775 1781 struct fb_info *fbi; 1776 1782 int plane; 1777 1783 ··· 1785 1781 1786 1782 for (plane = 0; plane < device_count; ++plane) { 1787 1783 fbi = _au1200fb_infos[plane]; 1788 - fbdev = fbi->par; 1789 1784 1790 1785 /* Clean up all probe data */ 1791 1786 unregister_framebuffer(fbi);
+4 -2
drivers/video/fbdev/cirrusfb.c
··· 1477 1477 mdelay(100); 1478 1478 /* mode */ 1479 1479 vga_wgfx(cinfo->regbase, CL_GR31, 0x00); 1480 - case BT_GD5480: /* fall through */ 1480 + /* fall through */ 1481 + case BT_GD5480: 1481 1482 /* from Klaus' NetBSD driver: */ 1482 1483 vga_wgfx(cinfo->regbase, CL_GR2F, 0x00); 1483 - case BT_ALPINE: /* fall through */ 1484 + /* fall through */ 1485 + case BT_ALPINE: 1484 1486 /* put blitter into 542x compat */ 1485 1487 vga_wgfx(cinfo->regbase, CL_GR33, 0x00); 1486 1488 break;
+2
drivers/video/fbdev/controlfb.h
··· 141 141 {{ 1, 2}}, /* 1152x870, 75Hz */ 142 142 {{ 0, 1}}, /* 1280x960, 75Hz */ 143 143 {{ 0, 1}}, /* 1280x1024, 75Hz */ 144 + {{ 1, 2}}, /* 1152x768, 60Hz */ 145 + {{ 0, 1}}, /* 1600x1024, 60Hz */ 144 146 }; 145 147
+6 -5
drivers/video/fbdev/core/fbcon.c
··· 395 395 console_unlock(); 396 396 } 397 397 398 - static void cursor_timer_handler(unsigned long dev_addr) 398 + static void cursor_timer_handler(struct timer_list *t) 399 399 { 400 - struct fb_info *info = (struct fb_info *) dev_addr; 401 - struct fbcon_ops *ops = info->fbcon_par; 400 + struct fbcon_ops *ops = from_timer(ops, t, cursor_timer); 401 + struct fb_info *info = ops->info; 402 402 403 403 queue_work(system_power_efficient_wq, &info->queue); 404 404 mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies); ··· 414 414 if (!info->queue.func) 415 415 INIT_WORK(&info->queue, fb_flashcursor); 416 416 417 - setup_timer(&ops->cursor_timer, cursor_timer_handler, 418 - (unsigned long) info); 417 + timer_setup(&ops->cursor_timer, cursor_timer_handler, 0); 419 418 mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies); 420 419 ops->flags |= FBCON_FLAGS_CURSOR_TIMER; 421 420 } ··· 713 714 714 715 if (!err) { 715 716 ops->cur_blink_jiffies = HZ / 5; 717 + ops->info = info; 716 718 info->fbcon_par = ops; 717 719 718 720 if (vc) ··· 962 962 ops->graphics = 1; 963 963 ops->cur_rotate = -1; 964 964 ops->cur_blink_jiffies = HZ / 5; 965 + ops->info = info; 965 966 info->fbcon_par = ops; 966 967 if (initial_rotation != -1) 967 968 p->con_rotate = initial_rotation;
+1
drivers/video/fbdev/core/fbcon.h
··· 69 69 struct timer_list cursor_timer; /* Cursor timer */ 70 70 struct fb_cursor cursor_state; 71 71 struct display *p; 72 + struct fb_info *info; 72 73 int currcon; /* Current VC. */ 73 74 int cur_blink_jiffies; 74 75 int cursor_flash;
+8 -7
drivers/video/fbdev/dnfb.c
··· 115 115 .fb_imageblit = cfb_imageblit, 116 116 }; 117 117 118 - struct fb_var_screeninfo dnfb_var = { 118 + static const struct fb_var_screeninfo dnfb_var = { 119 119 .xres = 1280, 120 120 .yres = 1024, 121 121 .xres_virtual = 2048, ··· 242 242 info->screen_base = (u_char *) info->fix.smem_start; 243 243 244 244 err = fb_alloc_cmap(&info->cmap, 2, 0); 245 - if (err < 0) { 246 - framebuffer_release(info); 247 - return err; 248 - } 245 + if (err < 0) 246 + goto release_framebuffer; 249 247 250 248 err = register_framebuffer(info); 251 249 if (err < 0) { 252 250 fb_dealloc_cmap(&info->cmap); 253 - framebuffer_release(info); 254 - return err; 251 + goto release_framebuffer; 255 252 } 256 253 platform_set_drvdata(dev, info); 257 254 ··· 261 264 out_be16(AP_ROP_1, SWAP(0x3)); 262 265 263 266 printk("apollo frame buffer alive and kicking !\n"); 267 + return err; 268 + 269 + release_framebuffer: 270 + framebuffer_release(info); 264 271 return err; 265 272 } 266 273
+7 -1
drivers/video/fbdev/goldfishfb.c
··· 304 304 return 0; 305 305 } 306 306 307 + static const struct of_device_id goldfish_fb_of_match[] = { 308 + { .compatible = "google,goldfish-fb", }, 309 + {}, 310 + }; 311 + MODULE_DEVICE_TABLE(of, goldfish_fb_of_match); 307 312 308 313 static struct platform_driver goldfish_fb_driver = { 309 314 .probe = goldfish_fb_probe, 310 315 .remove = goldfish_fb_remove, 311 316 .driver = { 312 - .name = "goldfish_fb" 317 + .name = "goldfish_fb", 318 + .of_match_table = goldfish_fb_of_match, 313 319 } 314 320 }; 315 321
-579
drivers/video/fbdev/igafb.c
··· 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 - 54 - struct 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 - 62 - struct iga_par { 63 - struct pci_mmap_map *mmap_map; 64 - unsigned long frame_buffer_phys; 65 - unsigned long io_base; 66 - }; 67 - 68 - struct fb_info fb_info; 69 - 70 - struct fb_fix_screeninfo igafb_fix __initdata = { 71 - .id = "IGA 1682", 72 - .type = FB_TYPE_PACKED_PIXELS, 73 - .mmio_len = 1000 74 - }; 75 - 76 - struct 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 100 - struct 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 - 123 - struct 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 - 146 - struct 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 - 177 - static 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 - 184 - static 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 - */ 197 - static 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 221 - static 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 - 276 - static 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 - */ 320 - static 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 - 331 - static 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 - 370 - static 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 - 559 - static 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 - 571 - module_init(igafb_init); 572 - MODULE_LICENSE("GPL"); 573 - static 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 - 579 - MODULE_DEVICE_TABLE(pci, igafb_pci_tbl);
+2 -7
drivers/video/fbdev/intelfb/intelfbhw.c
··· 937 937 { 938 938 u32 m1, m2, n, p1, p2, n1, testm; 939 939 u32 f_vco, p, p_best = 0, m, f_out = 0; 940 - u32 err_max, err_target, err_best = 10000000; 941 - u32 n_best = 0, m_best = 0, f_best, f_err; 940 + u32 err_best = 10000000; 941 + u32 n_best = 0, m_best = 0, f_err; 942 942 u32 p_min, p_max, p_inc, div_max; 943 943 struct pll_min_max *pll = &plls[index]; 944 - 945 - /* Accept 0.5% difference, but aim for 0.1% */ 946 - err_max = 5 * clock / 1000; 947 - err_target = clock / 1000; 948 944 949 945 DBG_MSG("Clock is %d\n", clock); 950 946 ··· 988 992 m_best = testm; 989 993 n_best = n; 990 994 p_best = p; 991 - f_best = f_out; 992 995 err_best = f_err; 993 996 } 994 997 }
+1 -1
drivers/video/fbdev/matrox/matroxfb_base.c
··· 2056 2056 2057 2057 minfo = kzalloc(sizeof(*minfo), GFP_KERNEL); 2058 2058 if (!minfo) 2059 - return -1; 2059 + return -ENOMEM; 2060 2060 2061 2061 minfo->pcidev = pdev; 2062 2062 minfo->dead = 0;
+11 -2
drivers/video/fbdev/mxsfb.c
··· 150 150 #define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */ 151 151 152 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 155 155 enum mxsfb_devtype { 156 156 MXSFB_V3, ··· 788 788 789 789 if (vm.flags & DISPLAY_FLAGS_DE_HIGH) 790 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 801 host->sync |= MXSFB_SYNC_DOTCLK_FALLING_ACT; 793 802 794 803 put_display_node:
+2 -4
drivers/video/fbdev/omap/hwa742.c
··· 474 474 jiffies + HWA742_AUTO_UPDATE_TIME); 475 475 } 476 476 477 - static void hwa742_update_window_auto(unsigned long arg) 477 + static void hwa742_update_window_auto(struct timer_list *unused) 478 478 { 479 479 LIST_HEAD(req_list); 480 480 struct hwa742_request *last; ··· 1002 1002 hwa742.auto_update_window.height = fbdev->panel->y_res; 1003 1003 hwa742.auto_update_window.format = 0; 1004 1004 1005 - init_timer(&hwa742.auto_update_timer); 1006 - hwa742.auto_update_timer.function = hwa742_update_window_auto; 1007 - hwa742.auto_update_timer.data = 0; 1005 + timer_setup(&hwa742.auto_update_timer, hwa742_update_window_auto, 0); 1008 1006 1009 1007 hwa742.prev_color_mode = -1; 1010 1008 hwa742.prev_flags = 0;
+2 -4
drivers/video/fbdev/omap2/omapfb/dss/dsi.c
··· 3988 3988 } 3989 3989 3990 3990 #ifdef DSI_CATCH_MISSING_TE 3991 - static void dsi_te_timeout(unsigned long arg) 3991 + static void dsi_te_timeout(struct timer_list *unused) 3992 3992 { 3993 3993 DSSERR("TE not received for 250ms!\n"); 3994 3994 } ··· 5298 5298 dsi_framedone_timeout_work_callback); 5299 5299 5300 5300 #ifdef DSI_CATCH_MISSING_TE 5301 - init_timer(&dsi->te_timer); 5302 - dsi->te_timer.function = dsi_te_timeout; 5303 - dsi->te_timer.data = 0; 5301 + timer_setup(&dsi->te_timer, dsi_te_timeout, 0); 5304 5302 #endif 5305 5303 5306 5304 res = platform_get_resource_byname(dsidev, IORESOURCE_MEM, "proto");
+1 -1
drivers/video/fbdev/omap2/omapfb/omapfb-main.c
··· 1477 1477 static int omapfb_parse_vram_param(const char *param, int max_entries, 1478 1478 unsigned long *sizes, unsigned long *paddrs) 1479 1479 { 1480 - int fbnum; 1480 + unsigned int fbnum; 1481 1481 unsigned long size; 1482 1482 unsigned long paddr = 0; 1483 1483 char *p, *start;
+11 -13
drivers/video/fbdev/pxa3xx-gcu.c
··· 512 512 513 513 #ifdef PXA3XX_GCU_DEBUG_TIMER 514 514 static struct timer_list pxa3xx_gcu_debug_timer; 515 + static struct pxa3xx_gcu_priv *debug_timer_priv; 515 516 516 - static void pxa3xx_gcu_debug_timedout(unsigned long ptr) 517 + static 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 521 QERROR("Timer DUMP"); 521 522 522 - /* init the timer structure */ 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); 523 + mod_timer(&pxa3xx_gcu_debug_timer, jiffies + 5 * HZ); 529 524 } 530 525 531 - static void pxa3xx_gcu_init_debug_timer(void) 526 + static 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 533 #else 536 - static inline void pxa3xx_gcu_init_debug_timer(void) {} 534 + static inline void pxa3xx_gcu_init_debug_timer(struct pxa3xx_gcu_priv *priv) {} 537 535 #endif 538 536 539 537 static int ··· 668 670 platform_set_drvdata(pdev, priv); 669 671 priv->resource_mem = r; 670 672 pxa3xx_gcu_reset(priv); 671 - pxa3xx_gcu_init_debug_timer(); 673 + pxa3xx_gcu_init_debug_timer(priv); 672 674 673 675 dev_info(dev, "registered @0x%p, DMA 0x%p (%d bytes), IRQ %d\n", 674 676 (void *) r->start, (void *) priv->shared_phys,
+31 -52
drivers/video/fbdev/sa1100fb.c
··· 323 323 * according to the RGB bitfield information. 324 324 */ 325 325 if (regno < 16) { 326 - u32 *pal = fbi->fb.pseudo_palette; 327 - 328 326 val = chan_to_field(red, &fbi->fb.var.red); 329 327 val |= chan_to_field(green, &fbi->fb.var.green); 330 328 val |= chan_to_field(blue, &fbi->fb.var.blue); 331 329 332 - pal[regno] = val; 330 + fbi->pseudo_palette[regno] = val; 333 331 ret = 0; 334 332 } 335 333 break; ··· 1130 1132 struct sa1100fb_info *fbi; 1131 1133 unsigned i; 1132 1134 1133 - fbi = kmalloc(sizeof(struct sa1100fb_info) + sizeof(u32) * 16, 1134 - GFP_KERNEL); 1135 + fbi = devm_kzalloc(dev, sizeof(struct sa1100fb_info), GFP_KERNEL); 1135 1136 if (!fbi) 1136 1137 return NULL; 1137 1138 1138 - memset(fbi, 0, sizeof(struct sa1100fb_info)); 1139 1139 fbi->dev = dev; 1140 1140 1141 1141 strcpy(fbi->fb.fix.id, SA1100_NAME); ··· 1155 1159 fbi->fb.fbops = &sa1100fb_ops; 1156 1160 fbi->fb.flags = FBINFO_DEFAULT; 1157 1161 fbi->fb.monspecs = monspecs; 1158 - fbi->fb.pseudo_palette = (fbi + 1); 1162 + fbi->fb.pseudo_palette = fbi->pseudo_palette; 1159 1163 1160 1164 fbi->rgb[RGB_4] = &rgb_4; 1161 1165 fbi->rgb[RGB_8] = &rgb_8; ··· 1214 1218 return -EINVAL; 1215 1219 } 1216 1220 1217 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1218 1221 irq = platform_get_irq(pdev, 0); 1219 - if (irq < 0 || !res) 1222 + if (irq < 0) 1220 1223 return -EINVAL; 1221 1224 1222 - if (!request_mem_region(res->start, resource_size(res), "LCD")) 1223 - return -EBUSY; 1224 - 1225 1225 fbi = sa1100fb_init_fbinfo(&pdev->dev); 1226 - ret = -ENOMEM; 1227 1226 if (!fbi) 1228 - goto failed; 1227 + return -ENOMEM; 1229 1228 1230 - fbi->clk = clk_get(&pdev->dev, NULL); 1231 - if (IS_ERR(fbi->clk)) { 1232 - ret = PTR_ERR(fbi->clk); 1233 - fbi->clk = NULL; 1234 - goto failed; 1229 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1230 + fbi->base = devm_ioremap_resource(&pdev->dev, res); 1231 + if (IS_ERR(fbi->base)) 1232 + return PTR_ERR(fbi->base); 1233 + 1234 + fbi->clk = devm_clk_get(&pdev->dev, NULL); 1235 + if (IS_ERR(fbi->clk)) 1236 + return PTR_ERR(fbi->clk); 1237 + 1238 + ret = devm_request_irq(&pdev->dev, irq, sa1100fb_handle_irq, 0, 1239 + "LCD", fbi); 1240 + if (ret) { 1241 + dev_err(&pdev->dev, "request_irq failed: %d\n", ret); 1242 + return ret; 1235 1243 } 1236 1244 1237 - fbi->base = ioremap(res->start, resource_size(res)); 1238 - if (!fbi->base) 1239 - goto failed; 1245 + if (machine_is_shannon()) { 1246 + ret = devm_gpio_request_one(&pdev->dev, SHANNON_GPIO_DISP_EN, 1247 + GPIOF_OUT_INIT_LOW, "display enable"); 1248 + if (ret) 1249 + return ret; 1250 + } 1240 1251 1241 1252 /* Initialize video memory */ 1242 1253 ret = sa1100fb_map_video_memory(fbi); 1243 1254 if (ret) 1244 - goto failed; 1245 - 1246 - ret = request_irq(irq, sa1100fb_handle_irq, 0, "LCD", fbi); 1247 - if (ret) { 1248 - dev_err(&pdev->dev, "request_irq failed: %d\n", ret); 1249 - goto failed; 1250 - } 1251 - 1252 - if (machine_is_shannon()) { 1253 - ret = gpio_request_one(SHANNON_GPIO_DISP_EN, 1254 - GPIOF_OUT_INIT_LOW, "display enable"); 1255 - if (ret) 1256 - goto err_free_irq; 1257 - } 1255 + return ret; 1258 1256 1259 1257 /* 1260 1258 * This makes sure that our colour bitfield ··· 1259 1269 platform_set_drvdata(pdev, fbi); 1260 1270 1261 1271 ret = register_framebuffer(&fbi->fb); 1262 - if (ret < 0) 1263 - goto err_reg_fb; 1272 + if (ret < 0) { 1273 + dma_free_wc(fbi->dev, fbi->map_size, fbi->map_cpu, 1274 + fbi->map_dma); 1275 + return ret; 1276 + } 1264 1277 1265 1278 #ifdef CONFIG_CPU_FREQ 1266 1279 fbi->freq_transition.notifier_call = sa1100fb_freq_transition; ··· 1274 1281 1275 1282 /* This driver cannot be unloaded at the moment */ 1276 1283 return 0; 1277 - 1278 - err_reg_fb: 1279 - if (machine_is_shannon()) 1280 - gpio_free(SHANNON_GPIO_DISP_EN); 1281 - err_free_irq: 1282 - free_irq(irq, fbi); 1283 - failed: 1284 - if (fbi) 1285 - iounmap(fbi->base); 1286 - if (fbi->clk) 1287 - clk_put(fbi->clk); 1288 - kfree(fbi); 1289 - release_mem_region(res->start, resource_size(res)); 1290 - return ret; 1291 1284 } 1292 1285 1293 1286 static struct platform_driver sa1100fb_driver = {
+2
drivers/video/fbdev/sa1100fb.h
··· 69 69 70 70 const struct sa1100fb_mach_info *inf; 71 71 struct clk *clk; 72 + 73 + u32 pseudo_palette[16]; 72 74 }; 73 75 74 76 #define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member)
+1 -1
drivers/video/fbdev/sis/init301.c
··· 6486 6486 6487 6487 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { 6488 6488 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) { 6489 - const unsigned char specialtv[] = { 6489 + static const unsigned char specialtv[] = { 6490 6490 0xa7,0x07,0xf2,0x6e,0x17,0x8b,0x73,0x53, 6491 6491 0x13,0x40,0x34,0xf4,0x63,0xbb,0xcc,0x7a, 6492 6492 0x58,0xe4,0x73,0xda,0x13
+4
drivers/video/fbdev/sis/sis_main.c
··· 1702 1702 if(ivideo->warncount++ < 10) 1703 1703 printk(KERN_INFO 1704 1704 "sisfb: Deprecated ioctl call received - update your application!\n"); 1705 + /* fall through */ 1705 1706 case SISFB_GET_INFO: /* For communication with X driver */ 1706 1707 ivideo->sisfb_infoblock.sisfb_id = SISFB_ID; 1707 1708 ivideo->sisfb_infoblock.sisfb_version = VER_MAJOR; ··· 1756 1755 if(ivideo->warncount++ < 10) 1757 1756 printk(KERN_INFO 1758 1757 "sisfb: Deprecated ioctl call received - update your application!\n"); 1758 + /* fall through */ 1759 1759 case SISFB_GET_VBRSTATUS: 1760 1760 if(sisfb_CheckVBRetrace(ivideo)) 1761 1761 return put_user((u32)1, argp); ··· 1767 1765 if(ivideo->warncount++ < 10) 1768 1766 printk(KERN_INFO 1769 1767 "sisfb: Deprecated ioctl call received - update your application!\n"); 1768 + /* fall through */ 1770 1769 case SISFB_GET_AUTOMAXIMIZE: 1771 1770 if(ivideo->sisfb_max) 1772 1771 return put_user((u32)1, argp); ··· 1778 1775 if(ivideo->warncount++ < 10) 1779 1776 printk(KERN_INFO 1780 1777 "sisfb: Deprecated ioctl call received - update your application!\n"); 1778 + /* fall through */ 1781 1779 case SISFB_SET_AUTOMAXIMIZE: 1782 1780 if(get_user(gpu32, argp)) 1783 1781 return -EFAULT;
+18 -4
drivers/video/fbdev/sm501fb.c
··· 1008 1008 case FB_BLANK_POWERDOWN: 1009 1009 ctrl &= ~SM501_DC_CRT_CONTROL_ENABLE; 1010 1010 sm501_misc_control(fbi->dev->parent, SM501_MISC_DAC_POWER, 0); 1011 + /* fall through */ 1011 1012 1012 1013 case FB_BLANK_NORMAL: 1013 1014 ctrl |= SM501_DC_CRT_CONTROL_BLANK; ··· 1890 1889 { 1891 1890 struct fb_info *fbi = info->fb[head]; 1892 1891 1892 + if (!fbi) 1893 + return; 1894 + 1893 1895 fb_dealloc_cmap(&fbi->cmap); 1894 1896 } 1895 1897 ··· 2080 2076 sm501_free_init_fb(info, HEAD_CRT); 2081 2077 sm501_free_init_fb(info, HEAD_PANEL); 2082 2078 2083 - unregister_framebuffer(fbinfo_crt); 2084 - unregister_framebuffer(fbinfo_pnl); 2079 + if (fbinfo_crt) 2080 + unregister_framebuffer(fbinfo_crt); 2081 + if (fbinfo_pnl) 2082 + unregister_framebuffer(fbinfo_pnl); 2085 2083 2086 2084 sm501fb_stop(info); 2087 2085 kfree(info); ··· 2100 2094 enum sm501_controller head) 2101 2095 { 2102 2096 struct fb_info *fbi = info->fb[head]; 2103 - struct sm501fb_par *par = fbi->par; 2097 + struct sm501fb_par *par; 2104 2098 2099 + if (!fbi) 2100 + return 0; 2101 + 2102 + par = fbi->par; 2105 2103 if (par->screen.size == 0) 2106 2104 return 0; 2107 2105 ··· 2151 2141 enum sm501_controller head) 2152 2142 { 2153 2143 struct fb_info *fbi = info->fb[head]; 2154 - struct sm501fb_par *par = fbi->par; 2144 + struct sm501fb_par *par; 2155 2145 2146 + if (!fbi) 2147 + return; 2148 + 2149 + par = fbi->par; 2156 2150 if (par->screen.size == 0) 2157 2151 return; 2158 2152
+5 -5
drivers/video/fbdev/udlfb.c
··· 769 769 770 770 for (i = 0; i < len; i++) { 771 771 ret = usb_control_msg(dev->udev, 772 - usb_rcvctrlpipe(dev->udev, 0), (0x02), 773 - (0x80 | (0x02 << 5)), i << 8, 0xA1, rbuf, 2, 774 - HZ); 775 - if (ret < 1) { 776 - pr_err("Read EDID byte %d failed err %x\n", i, ret); 772 + usb_rcvctrlpipe(dev->udev, 0), 0x02, 773 + (0x80 | (0x02 << 5)), i << 8, 0xA1, 774 + rbuf, 2, USB_CTRL_GET_TIMEOUT); 775 + if (ret < 2) { 776 + pr_err("Read EDID byte %d failed: %d\n", i, ret); 777 777 i--; 778 778 break; 779 779 }
-25
include/video/iga.h
··· 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) */