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

Merge tag 'fbdev-v4.11' of git://github.com/bzolnier/linux

Pull fbdev updates from Bartlomiej Zolnierkiewicz:

- fix for font color when console is switched to another fb driver

- deferred probing fixes for simplefb driver

- preparations to add support of an optional GPIO to enable panel for
ARM CLCD driver

- some improvements for ssd1307fb driver

- cleanups for OMAP fbdev LCD drivers

- misc fixes/cleanups for various fb drivers

* tag 'fbdev-v4.11' of git://github.com/bzolnier/linux: (30 commits)
video: fbdev: fsl-diu-fb: fix spelling mistake "palette"
fbdev: ssd1307fb: include linux/gpio/consumer.h
video: fbdev: fsl-diu-fb: remove impossible condition
video: fbdev: amifb: remove impossible condition
fbdev/ssd1307fb: clear screen in probe
fbdev/ssd1307fb: add support to enable VBAT
fbdev: ssd1307fb: Make reset gpio devicetree property optional
fbdev: ssd1307fb: Remove reset-active-low from the DT binding document
fbdev: ssd1307fb: Start to use gpiod API for reset gpio
video: fbdev: sh_mobile_lcdcfb: fix error return code in sh_mobile_lcdc_probe()
video: fbdev: offb: switch to using for_each_node_by_type
video/console: use setup_timer and mod_timer instead of init_timer
fbdev: omap/lcd: Make callbacks optional
fbdev: omap/lcd: Staticize non-exported lcd_panel structs
fbdev: omap/lcd: Remove no-op driver callbacks
video/mbx: use simple_open()
video: fbdev: stifb: handle NULL return value from ioremap_nocache
video: fbdev: pmagb-b-fb: Remove bad `__init' annotation
video: fbdev: pmag-ba-fb: Remove bad `__init' annotation
video: ARM CLCD: use panel device node for getting backlight and mode
...

+225 -531
+3 -2
Documentation/devicetree/bindings/display/ssd1307fb.txt
··· 8 8 0x3c or 0x3d 9 9 - pwm: Should contain the pwm to use according to the OF device tree PWM 10 10 specification [0]. Only required for the ssd1307. 11 - - reset-gpios: Should contain the GPIO used to reset the OLED display 12 11 - solomon,height: Height in pixel of the screen driven by the controller 13 12 - solomon,width: Width in pixel of the screen driven by the controller 14 13 - solomon,page-offset: Offset of pages (band of 8 pixels) that the screen is 15 14 mapped to. 16 15 17 16 Optional properties: 18 - - reset-active-low: Is the reset gpio is active on physical low? 17 + - reset-gpios: The GPIO used to reset the OLED display, if available. See 18 + Documentation/devicetree/bindings/gpio/gpio.txt for details. 19 + - vbat-supply: The supply for VBAT 19 20 - solomon,segment-no-remap: Display needs normal (non-inverted) data column 20 21 to segment mapping 21 22 - solomon,com-seq: Display uses sequential COM pin configuration
+43 -32
drivers/video/console/fbcon.c
··· 412 412 if (!info->queue.func) 413 413 INIT_WORK(&info->queue, fb_flashcursor); 414 414 415 - init_timer(&ops->cursor_timer); 416 - ops->cursor_timer.function = cursor_timer_handler; 417 - ops->cursor_timer.expires = jiffies + ops->cur_blink_jiffies; 418 - ops->cursor_timer.data = (unsigned long ) info; 419 - add_timer(&ops->cursor_timer); 415 + setup_timer(&ops->cursor_timer, cursor_timer_handler, 416 + (unsigned long) info); 417 + mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies); 420 418 ops->flags |= FBCON_FLAGS_CURSOR_TIMER; 421 419 } 422 420 } ··· 1163 1165 p->userfont = 0; 1164 1166 } 1165 1167 1168 + static void set_vc_hi_font(struct vc_data *vc, bool set); 1169 + 1166 1170 static void fbcon_deinit(struct vc_data *vc) 1167 1171 { 1168 1172 struct display *p = &fb_display[vc->vc_num]; ··· 1199 1199 fbcon_free_font(p, free_font); 1200 1200 if (free_font) 1201 1201 vc->vc_font.data = NULL; 1202 + 1203 + if (vc->vc_hi_font_mask) 1204 + set_vc_hi_font(vc, false); 1202 1205 1203 1206 if (!con_is_bound(&fb_con)) 1204 1207 fbcon_exit(); ··· 2439 2436 return 0; 2440 2437 } 2441 2438 2442 - static int fbcon_do_set_font(struct vc_data *vc, int w, int h, 2443 - const u8 * data, int userfont) 2439 + /* set/clear vc_hi_font_mask and update vc attrs accordingly */ 2440 + static void set_vc_hi_font(struct vc_data *vc, bool set) 2444 2441 { 2445 - struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; 2446 - struct fbcon_ops *ops = info->fbcon_par; 2447 - struct display *p = &fb_display[vc->vc_num]; 2448 - int resize; 2449 - int cnt; 2450 - char *old_data = NULL; 2451 - 2452 - if (con_is_visible(vc) && softback_lines) 2453 - fbcon_set_origin(vc); 2454 - 2455 - resize = (w != vc->vc_font.width) || (h != vc->vc_font.height); 2456 - if (p->userfont) 2457 - old_data = vc->vc_font.data; 2458 - if (userfont) 2459 - cnt = FNTCHARCNT(data); 2460 - else 2461 - cnt = 256; 2462 - vc->vc_font.data = (void *)(p->fontdata = data); 2463 - if ((p->userfont = userfont)) 2464 - REFCOUNT(data)++; 2465 - vc->vc_font.width = w; 2466 - vc->vc_font.height = h; 2467 - if (vc->vc_hi_font_mask && cnt == 256) { 2442 + if (!set) { 2468 2443 vc->vc_hi_font_mask = 0; 2469 2444 if (vc->vc_can_do_color) { 2470 2445 vc->vc_complement_mask >>= 1; ··· 2465 2484 ((c & 0xfe00) >> 1) | (c & 0xff); 2466 2485 vc->vc_attr >>= 1; 2467 2486 } 2468 - } else if (!vc->vc_hi_font_mask && cnt == 512) { 2487 + } else { 2469 2488 vc->vc_hi_font_mask = 0x100; 2470 2489 if (vc->vc_can_do_color) { 2471 2490 vc->vc_complement_mask <<= 1; ··· 2497 2516 } else 2498 2517 vc->vc_video_erase_char = c & ~0x100; 2499 2518 } 2500 - 2501 2519 } 2520 + } 2521 + 2522 + static int fbcon_do_set_font(struct vc_data *vc, int w, int h, 2523 + const u8 * data, int userfont) 2524 + { 2525 + struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; 2526 + struct fbcon_ops *ops = info->fbcon_par; 2527 + struct display *p = &fb_display[vc->vc_num]; 2528 + int resize; 2529 + int cnt; 2530 + char *old_data = NULL; 2531 + 2532 + if (con_is_visible(vc) && softback_lines) 2533 + fbcon_set_origin(vc); 2534 + 2535 + resize = (w != vc->vc_font.width) || (h != vc->vc_font.height); 2536 + if (p->userfont) 2537 + old_data = vc->vc_font.data; 2538 + if (userfont) 2539 + cnt = FNTCHARCNT(data); 2540 + else 2541 + cnt = 256; 2542 + vc->vc_font.data = (void *)(p->fontdata = data); 2543 + if ((p->userfont = userfont)) 2544 + REFCOUNT(data)++; 2545 + vc->vc_font.width = w; 2546 + vc->vc_font.height = h; 2547 + if (vc->vc_hi_font_mask && cnt == 256) 2548 + set_vc_hi_font(vc, false); 2549 + else if (!vc->vc_hi_font_mask && cnt == 512) 2550 + set_vc_hi_font(vc, true); 2502 2551 2503 2552 if (resize) { 2504 2553 int cols, rows;
+1 -8
drivers/video/fbdev/amba-clcd-nomadik.c
··· 213 213 board->disable = tpg110_disable; 214 214 } 215 215 216 - int nomadik_clcd_init_panel(struct clcd_fb *fb, 217 - struct device_node *endpoint) 216 + int nomadik_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel) 218 217 { 219 - struct device_node *panel; 220 - 221 - panel = of_graph_get_remote_port_parent(endpoint); 222 - if (!panel) 223 - return -ENODEV; 224 - 225 218 if (of_device_is_compatible(panel, "tpo,tpg110")) 226 219 tpg110_init(&fb->dev->dev, panel, fb->board); 227 220 else
+2 -3
drivers/video/fbdev/amba-clcd-nomadik.h
··· 6 6 #ifdef CONFIG_ARCH_NOMADIK 7 7 int nomadik_clcd_init_board(struct amba_device *adev, 8 8 struct clcd_board *board); 9 - int nomadik_clcd_init_panel(struct clcd_fb *fb, 10 - struct device_node *endpoint); 9 + int nomadik_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel); 11 10 #else 12 11 static inline int nomadik_clcd_init_board(struct amba_device *adev, 13 12 struct clcd_board *board) ··· 14 15 return 0; 15 16 } 16 17 static inline int nomadik_clcd_init_panel(struct clcd_fb *fb, 17 - struct device_node *endpoint) 18 + struct device_node *panel) 18 19 { 19 20 return 0; 20 21 }
+3 -11
drivers/video/fbdev/amba-clcd-versatile.c
··· 452 452 }, 453 453 }; 454 454 455 - static void versatile_panel_probe(struct device *dev, 456 - struct device_node *endpoint) 455 + static void versatile_panel_probe(struct device *dev, struct device_node *panel) 457 456 { 458 457 struct versatile_panel const *vpanel = NULL; 459 - struct device_node *panel = NULL; 460 458 u32 val; 461 459 int ret; 462 460 int i; ··· 486 488 return; 487 489 } 488 490 489 - panel = of_graph_get_remote_port_parent(endpoint); 490 - if (!panel) { 491 - dev_err(dev, "could not locate panel in DT\n"); 492 - return; 493 - } 494 491 if (!of_device_is_compatible(panel, vpanel->compatible)) 495 492 dev_err(dev, "panel in DT is not compatible with the " 496 493 "auto-detected panel, continuing anyway\n"); ··· 507 514 } 508 515 } 509 516 510 - int versatile_clcd_init_panel(struct clcd_fb *fb, 511 - struct device_node *endpoint) 517 + int versatile_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel) 512 518 { 513 519 const struct of_device_id *clcd_id; 514 520 enum versatile_clcd versatile_clcd_type; ··· 543 551 fb->board->enable = versatile_clcd_enable; 544 552 fb->board->disable = versatile_clcd_disable; 545 553 fb->board->decode = versatile_clcd_decode; 546 - versatile_panel_probe(dev, endpoint); 554 + versatile_panel_probe(dev, panel); 547 555 dev_info(dev, "set up callbacks for Versatile\n"); 548 556 break; 549 557 case REALVIEW_CLCD_EB:
+2 -3
drivers/video/fbdev/amba-clcd-versatile.h
··· 6 6 #include <linux/platform_data/video-clcd-versatile.h> 7 7 8 8 #if defined(CONFIG_PLAT_VERSATILE_CLCD) && defined(CONFIG_OF) 9 - int versatile_clcd_init_panel(struct clcd_fb *fb, 10 - struct device_node *endpoint); 9 + int versatile_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel); 11 10 #else 12 11 static inline int versatile_clcd_init_panel(struct clcd_fb *fb, 13 - struct device_node *endpoint) 12 + struct device_node *panel) 14 13 { 15 14 return 0; 16 15 }
+20 -31
drivers/video/fbdev/amba-clcd.c
··· 10 10 * 11 11 * ARM PrimeCell PL110 Color LCD Controller 12 12 */ 13 - #include <linux/dma-mapping.h> 14 - #include <linux/module.h> 15 - #include <linux/kernel.h> 16 - #include <linux/errno.h> 17 - #include <linux/string.h> 18 - #include <linux/slab.h> 13 + #include <linux/amba/bus.h> 14 + #include <linux/amba/clcd.h> 15 + #include <linux/backlight.h> 16 + #include <linux/clk.h> 19 17 #include <linux/delay.h> 20 - #include <linux/mm.h> 18 + #include <linux/dma-mapping.h> 21 19 #include <linux/fb.h> 22 20 #include <linux/init.h> 23 21 #include <linux/ioport.h> 24 22 #include <linux/list.h> 25 - #include <linux/amba/bus.h> 26 - #include <linux/amba/clcd.h> 27 - #include <linux/bitops.h> 28 - #include <linux/clk.h> 29 - #include <linux/hardirq.h> 30 - #include <linux/of.h> 23 + #include <linux/mm.h> 24 + #include <linux/module.h> 31 25 #include <linux/of_address.h> 32 26 #include <linux/of_graph.h> 33 - #include <linux/backlight.h> 27 + #include <linux/slab.h> 28 + #include <linux/string.h> 34 29 #include <video/display_timing.h> 35 30 #include <video/of_display_timing.h> 36 31 #include <video/videomode.h> ··· 624 629 mode->refresh); 625 630 } 626 631 627 - static int clcdfb_of_get_backlight(struct device_node *endpoint, 632 + static int clcdfb_of_get_backlight(struct device_node *panel, 628 633 struct clcd_panel *clcd_panel) 629 634 { 630 - struct device_node *panel; 631 635 struct device_node *backlight; 632 - 633 - panel = of_graph_get_remote_port_parent(endpoint); 634 - if (!panel) 635 - return -ENODEV; 636 636 637 637 /* Look up the optional backlight phandle */ 638 638 backlight = of_parse_phandle(panel, "backlight", 0); ··· 641 651 return 0; 642 652 } 643 653 644 - static int clcdfb_of_get_mode(struct device *dev, struct device_node *endpoint, 645 - struct clcd_panel *clcd_panel) 654 + static int clcdfb_of_get_mode(struct device *dev, struct device_node *panel, 655 + struct clcd_panel *clcd_panel) 646 656 { 647 657 int err; 648 - struct device_node *panel; 649 658 struct fb_videomode *mode; 650 659 char *name; 651 660 int len; 652 - 653 - panel = of_graph_get_remote_port_parent(endpoint); 654 - if (!panel) 655 - return -ENODEV; 656 661 657 662 /* Only directly connected DPI panels supported for now */ 658 663 if (of_device_is_compatible(panel, "panel-dpi")) ··· 754 769 755 770 static int clcdfb_of_init_display(struct clcd_fb *fb) 756 771 { 757 - struct device_node *endpoint; 772 + struct device_node *endpoint, *panel; 758 773 int err; 759 774 unsigned int bpp; 760 775 u32 max_bandwidth; ··· 771 786 if (!endpoint) 772 787 return -ENODEV; 773 788 789 + panel = of_graph_get_remote_port_parent(endpoint); 790 + if (!panel) 791 + return -ENODEV; 792 + 774 793 if (fb->vendor->init_panel) { 775 - err = fb->vendor->init_panel(fb, endpoint); 794 + err = fb->vendor->init_panel(fb, panel); 776 795 if (err) 777 796 return err; 778 797 } 779 798 780 - err = clcdfb_of_get_backlight(endpoint, fb->panel); 799 + err = clcdfb_of_get_backlight(panel, fb->panel); 781 800 if (err) 782 801 return err; 783 802 784 - err = clcdfb_of_get_mode(&fb->dev->dev, endpoint, fb->panel); 803 + err = clcdfb_of_get_mode(&fb->dev->dev, panel, fb->panel); 785 804 if (err) 786 805 return err; 787 806
+3 -5
drivers/video/fbdev/amifb.c
··· 1484 1484 par->xoffset = var->xoffset; 1485 1485 par->yoffset = var->yoffset; 1486 1486 if (par->vmode & FB_VMODE_YWRAP) { 1487 - if (par->xoffset || par->yoffset < 0 || 1488 - par->yoffset >= par->vyres) 1487 + if (par->yoffset >= par->vyres) 1489 1488 par->xoffset = par->yoffset = 0; 1490 1489 } else { 1491 - if (par->xoffset < 0 || 1492 - par->xoffset > upx(16 << maxfmode, par->vxres - par->xres) || 1493 - par->yoffset < 0 || par->yoffset > par->vyres - par->yres) 1490 + if (par->xoffset > upx(16 << maxfmode, par->vxres - par->xres) || 1491 + par->yoffset > par->vyres - par->yres) 1494 1492 par->xoffset = par->yoffset = 0; 1495 1493 } 1496 1494 } else
+3 -10
drivers/video/fbdev/fsl-diu-fb.c
··· 439 439 static void __attribute__ ((unused)) fsl_diu_dump(struct diu __iomem *hw) 440 440 { 441 441 mb(); 442 - pr_debug("DIU: desc=%08x,%08x,%08x, gamma=%08x pallete=%08x " 442 + pr_debug("DIU: desc=%08x,%08x,%08x, gamma=%08x palette=%08x " 443 443 "cursor=%08x curs_pos=%08x diu_mode=%08x bgnd=%08x " 444 444 "disp_size=%08x hsyn_para=%08x vsyn_para=%08x syn_pol=%08x " 445 445 "thresholds=%08x int_mask=%08x plut=%08x\n", 446 446 hw->desc[0], hw->desc[1], hw->desc[2], hw->gamma, 447 - hw->pallete, hw->cursor, hw->curs_pos, hw->diu_mode, 447 + hw->palette, hw->cursor, hw->curs_pos, hw->diu_mode, 448 448 hw->bgnd, hw->disp_size, hw->hsyn_para, hw->vsyn_para, 449 449 hw->syn_pol, hw->thresholds, hw->int_mask, hw->plut); 450 450 rmb(); ··· 702 702 var->xres_virtual = var->xres; 703 703 if (var->yres_virtual < var->yres) 704 704 var->yres_virtual = var->yres; 705 - 706 - if (var->xoffset < 0) 707 - var->xoffset = 0; 708 - 709 - if (var->yoffset < 0) 710 - var->yoffset = 0; 711 705 712 706 if (var->xoffset + info->var.xres > info->var.xres_virtual) 713 707 var->xoffset = info->var.xres_virtual - info->var.xres; ··· 1248 1254 (info->var.yoffset == var->yoffset)) 1249 1255 return 0; /* No change, do nothing */ 1250 1256 1251 - if (var->xoffset < 0 || var->yoffset < 0 1252 - || var->xoffset + info->var.xres > info->var.xres_virtual 1257 + if (var->xoffset + info->var.xres > info->var.xres_virtual 1253 1258 || var->yoffset + info->var.yres > info->var.yres_virtual) 1254 1259 return -EINVAL; 1255 1260
+5 -1
drivers/video/fbdev/imxfb.c
··· 985 985 */ 986 986 imxfb_check_var(&info->var, info); 987 987 988 - ret = fb_alloc_cmap(&info->cmap, 1 << info->var.bits_per_pixel, 0); 988 + /* 989 + * For modes > 8bpp, the color map is bypassed. 990 + * Therefore, 256 entries are enough. 991 + */ 992 + ret = fb_alloc_cmap(&info->cmap, 256, 0); 989 993 if (ret < 0) 990 994 goto failed_cmap; 991 995
+8 -2
drivers/video/fbdev/matrox/matroxfb_DAC1064.c
··· 1088 1088 1089 1089 #ifdef CONFIG_FB_MATROX_MYSTIQUE 1090 1090 struct matrox_switch matrox_mystique = { 1091 - MGA1064_preinit, MGA1064_reset, MGA1064_init, MGA1064_restore, 1091 + .preinit = MGA1064_preinit, 1092 + .reset = MGA1064_reset, 1093 + .init = MGA1064_init, 1094 + .restore = MGA1064_restore, 1092 1095 }; 1093 1096 EXPORT_SYMBOL(matrox_mystique); 1094 1097 #endif 1095 1098 1096 1099 #ifdef CONFIG_FB_MATROX_G 1097 1100 struct matrox_switch matrox_G100 = { 1098 - MGAG100_preinit, MGAG100_reset, MGAG100_init, MGAG100_restore, 1101 + .preinit = MGAG100_preinit, 1102 + .reset = MGAG100_reset, 1103 + .init = MGAG100_init, 1104 + .restore = MGAG100_restore, 1099 1105 }; 1100 1106 EXPORT_SYMBOL(matrox_G100); 1101 1107 #endif
+4 -1
drivers/video/fbdev/matrox/matroxfb_Ti3026.c
··· 738 738 } 739 739 740 740 struct matrox_switch matrox_millennium = { 741 - Ti3026_preinit, Ti3026_reset, Ti3026_init, Ti3026_restore 741 + .preinit = Ti3026_preinit, 742 + .reset = Ti3026_reset, 743 + .init = Ti3026_init, 744 + .restore = Ti3026_restore 742 745 }; 743 746 EXPORT_SYMBOL(matrox_millennium); 744 747 #endif
+1 -1
drivers/video/fbdev/maxinefb.c
··· 51 51 .vmode = FB_VMODE_NONINTERLACED, 52 52 }; 53 53 54 - static struct fb_fix_screeninfo maxinefb_fix = { 54 + static struct fb_fix_screeninfo maxinefb_fix __initdata = { 55 55 .id = "Maxine", 56 56 .smem_len = (1024*768), 57 57 .type = FB_TYPE_PACKED_PIXELS,
+6 -12
drivers/video/fbdev/mbx/mbxdebugfs.c
··· 15 15 struct dentry *misc; 16 16 }; 17 17 18 - static int open_file_generic(struct inode *inode, struct file *file) 19 - { 20 - file->private_data = inode->i_private; 21 - return 0; 22 - } 23 - 24 18 static ssize_t write_file_dummy(struct file *file, const char __user *buf, 25 19 size_t count, loff_t *ppos) 26 20 { ··· 168 174 static const struct file_operations sysconf_fops = { 169 175 .read = sysconf_read_file, 170 176 .write = write_file_dummy, 171 - .open = open_file_generic, 177 + .open = simple_open, 172 178 .llseek = default_llseek, 173 179 }; 174 180 175 181 static const struct file_operations clock_fops = { 176 182 .read = clock_read_file, 177 183 .write = write_file_dummy, 178 - .open = open_file_generic, 184 + .open = simple_open, 179 185 .llseek = default_llseek, 180 186 }; 181 187 182 188 static const struct file_operations display_fops = { 183 189 .read = display_read_file, 184 190 .write = write_file_dummy, 185 - .open = open_file_generic, 191 + .open = simple_open, 186 192 .llseek = default_llseek, 187 193 }; 188 194 189 195 static const struct file_operations gsctl_fops = { 190 196 .read = gsctl_read_file, 191 197 .write = write_file_dummy, 192 - .open = open_file_generic, 198 + .open = simple_open, 193 199 .llseek = default_llseek, 194 200 }; 195 201 196 202 static const struct file_operations sdram_fops = { 197 203 .read = sdram_read_file, 198 204 .write = write_file_dummy, 199 - .open = open_file_generic, 205 + .open = simple_open, 200 206 .llseek = default_llseek, 201 207 }; 202 208 203 209 static const struct file_operations misc_fops = { 204 210 .read = misc_read_file, 205 211 .write = write_file_dummy, 206 - .open = open_file_generic, 212 + .open = simple_open, 207 213 .llseek = default_llseek, 208 214 }; 209 215
+2 -2
drivers/video/fbdev/offb.c
··· 668 668 offb_init_nodriver(of_chosen, 1); 669 669 } 670 670 671 - for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { 671 + for_each_node_by_type(dp, "display") { 672 672 if (of_get_property(dp, "linux,opened", NULL) && 673 673 of_get_property(dp, "linux,boot-display", NULL)) { 674 674 boot_disp = dp; 675 675 offb_init_nodriver(dp, 0); 676 676 } 677 677 } 678 - for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { 678 + for_each_node_by_type(dp, "display") { 679 679 if (of_get_property(dp, "linux,opened", NULL) && 680 680 dp != boot_disp) 681 681 offb_init_nodriver(dp, 0);
-25
drivers/video/fbdev/omap/lcd_ams_delta.c
··· 136 136 gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 0); 137 137 } 138 138 139 - static unsigned long ams_delta_panel_get_caps(struct lcd_panel *panel) 140 - { 141 - return 0; 142 - } 143 - 144 139 static struct lcd_panel ams_delta_panel = { 145 140 .name = "ams-delta", 146 141 .config = 0, ··· 158 163 .cleanup = ams_delta_panel_cleanup, 159 164 .enable = ams_delta_panel_enable, 160 165 .disable = ams_delta_panel_disable, 161 - .get_caps = ams_delta_panel_get_caps, 162 166 }; 163 167 164 168 ··· 189 195 return 0; 190 196 } 191 197 192 - static int ams_delta_panel_remove(struct platform_device *pdev) 193 - { 194 - return 0; 195 - } 196 - 197 - static int ams_delta_panel_suspend(struct platform_device *pdev, 198 - pm_message_t mesg) 199 - { 200 - return 0; 201 - } 202 - 203 - static int ams_delta_panel_resume(struct platform_device *pdev) 204 - { 205 - return 0; 206 - } 207 - 208 198 static struct platform_driver ams_delta_panel_driver = { 209 199 .probe = ams_delta_panel_probe, 210 - .remove = ams_delta_panel_remove, 211 - .suspend = ams_delta_panel_suspend, 212 - .resume = ams_delta_panel_resume, 213 200 .driver = { 214 201 .name = "lcd_ams_delta", 215 202 },
+1 -36
drivers/video/fbdev/omap/lcd_h3.c
··· 28 28 29 29 #define MODULE_NAME "omapfb-lcd_h3" 30 30 31 - static int h3_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev) 32 - { 33 - return 0; 34 - } 35 - 36 - static void h3_panel_cleanup(struct lcd_panel *panel) 37 - { 38 - } 39 - 40 31 static int h3_panel_enable(struct lcd_panel *panel) 41 32 { 42 33 int r = 0; ··· 54 63 pr_err(MODULE_NAME ": Unable to turn off LCD panel\n"); 55 64 } 56 65 57 - static unsigned long h3_panel_get_caps(struct lcd_panel *panel) 58 - { 59 - return 0; 60 - } 61 - 62 - struct lcd_panel h3_panel = { 66 + static struct lcd_panel h3_panel = { 63 67 .name = "h3", 64 68 .config = OMAP_LCDC_PANEL_TFT, 65 69 ··· 71 85 .vbp = 0, 72 86 .pcd = 0, 73 87 74 - .init = h3_panel_init, 75 - .cleanup = h3_panel_cleanup, 76 88 .enable = h3_panel_enable, 77 89 .disable = h3_panel_disable, 78 - .get_caps = h3_panel_get_caps, 79 90 }; 80 91 81 92 static int h3_panel_probe(struct platform_device *pdev) ··· 81 98 return 0; 82 99 } 83 100 84 - static int h3_panel_remove(struct platform_device *pdev) 85 - { 86 - return 0; 87 - } 88 - 89 - static int h3_panel_suspend(struct platform_device *pdev, pm_message_t mesg) 90 - { 91 - return 0; 92 - } 93 - 94 - static int h3_panel_resume(struct platform_device *pdev) 95 - { 96 - return 0; 97 - } 98 - 99 101 static struct platform_driver h3_panel_driver = { 100 102 .probe = h3_panel_probe, 101 - .remove = h3_panel_remove, 102 - .suspend = h3_panel_suspend, 103 - .resume = h3_panel_resume, 104 103 .driver = { 105 104 .name = "lcd_h3", 106 105 },
+1 -50
drivers/video/fbdev/omap/lcd_htcherald.c
··· 31 31 32 32 #include "omapfb.h" 33 33 34 - static int htcherald_panel_init(struct lcd_panel *panel, 35 - struct omapfb_device *fbdev) 36 - { 37 - return 0; 38 - } 39 - 40 - static void htcherald_panel_cleanup(struct lcd_panel *panel) 41 - { 42 - } 43 - 44 - static int htcherald_panel_enable(struct lcd_panel *panel) 45 - { 46 - return 0; 47 - } 48 - 49 - static void htcherald_panel_disable(struct lcd_panel *panel) 50 - { 51 - } 52 - 53 - static unsigned long htcherald_panel_get_caps(struct lcd_panel *panel) 54 - { 55 - return 0; 56 - } 57 - 58 34 /* Found on WIZ200 (miknix) and some HERA110 models (darkstar62) */ 59 - struct lcd_panel htcherald_panel_1 = { 35 + static struct lcd_panel htcherald_panel_1 = { 60 36 .name = "lcd_herald", 61 37 .config = OMAP_LCDC_PANEL_TFT | 62 38 OMAP_LCDC_INV_HSYNC | ··· 50 74 .vsw = 3, 51 75 .vfp = 2, 52 76 .vbp = 2, 53 - 54 - .init = htcherald_panel_init, 55 - .cleanup = htcherald_panel_cleanup, 56 - .enable = htcherald_panel_enable, 57 - .disable = htcherald_panel_disable, 58 - .get_caps = htcherald_panel_get_caps, 59 77 }; 60 78 61 79 static int htcherald_panel_probe(struct platform_device *pdev) ··· 58 88 return 0; 59 89 } 60 90 61 - static int htcherald_panel_remove(struct platform_device *pdev) 62 - { 63 - return 0; 64 - } 65 - 66 - static int htcherald_panel_suspend(struct platform_device *pdev, 67 - pm_message_t mesg) 68 - { 69 - return 0; 70 - } 71 - 72 - static int htcherald_panel_resume(struct platform_device *pdev) 73 - { 74 - return 0; 75 - } 76 - 77 91 static struct platform_driver htcherald_panel_driver = { 78 92 .probe = htcherald_panel_probe, 79 - .remove = htcherald_panel_remove, 80 - .suspend = htcherald_panel_suspend, 81 - .resume = htcherald_panel_resume, 82 93 .driver = { 83 94 .name = "lcd_htcherald", 84 95 },
+1 -38
drivers/video/fbdev/omap/lcd_inn1510.c
··· 27 27 28 28 #include "omapfb.h" 29 29 30 - static int innovator1510_panel_init(struct lcd_panel *panel, 31 - struct omapfb_device *fbdev) 32 - { 33 - return 0; 34 - } 35 - 36 - static void innovator1510_panel_cleanup(struct lcd_panel *panel) 37 - { 38 - } 39 - 40 30 static int innovator1510_panel_enable(struct lcd_panel *panel) 41 31 { 42 32 __raw_writeb(0x7, OMAP1510_FPGA_LCD_PANEL_CONTROL); ··· 38 48 __raw_writeb(0x0, OMAP1510_FPGA_LCD_PANEL_CONTROL); 39 49 } 40 50 41 - static unsigned long innovator1510_panel_get_caps(struct lcd_panel *panel) 42 - { 43 - return 0; 44 - } 45 - 46 - struct lcd_panel innovator1510_panel = { 51 + static struct lcd_panel innovator1510_panel = { 47 52 .name = "inn1510", 48 53 .config = OMAP_LCDC_PANEL_TFT, 49 54 ··· 55 70 .vbp = 0, 56 71 .pcd = 12, 57 72 58 - .init = innovator1510_panel_init, 59 - .cleanup = innovator1510_panel_cleanup, 60 73 .enable = innovator1510_panel_enable, 61 74 .disable = innovator1510_panel_disable, 62 - .get_caps = innovator1510_panel_get_caps, 63 75 }; 64 76 65 77 static int innovator1510_panel_probe(struct platform_device *pdev) ··· 65 83 return 0; 66 84 } 67 85 68 - static int innovator1510_panel_remove(struct platform_device *pdev) 69 - { 70 - return 0; 71 - } 72 - 73 - static int innovator1510_panel_suspend(struct platform_device *pdev, 74 - pm_message_t mesg) 75 - { 76 - return 0; 77 - } 78 - 79 - static int innovator1510_panel_resume(struct platform_device *pdev) 80 - { 81 - return 0; 82 - } 83 - 84 86 static struct platform_driver innovator1510_panel_driver = { 85 87 .probe = innovator1510_panel_probe, 86 - .remove = innovator1510_panel_remove, 87 - .suspend = innovator1510_panel_suspend, 88 - .resume = innovator1510_panel_resume, 89 88 .driver = { 90 89 .name = "lcd_inn1510", 91 90 },
+1 -26
drivers/video/fbdev/omap/lcd_inn1610.c
··· 69 69 gpio_set_value(15, 0); 70 70 } 71 71 72 - static unsigned long innovator1610_panel_get_caps(struct lcd_panel *panel) 73 - { 74 - return 0; 75 - } 76 - 77 - struct lcd_panel innovator1610_panel = { 72 + static struct lcd_panel innovator1610_panel = { 78 73 .name = "inn1610", 79 74 .config = OMAP_LCDC_PANEL_TFT, 80 75 ··· 90 95 .cleanup = innovator1610_panel_cleanup, 91 96 .enable = innovator1610_panel_enable, 92 97 .disable = innovator1610_panel_disable, 93 - .get_caps = innovator1610_panel_get_caps, 94 98 }; 95 99 96 100 static int innovator1610_panel_probe(struct platform_device *pdev) ··· 98 104 return 0; 99 105 } 100 106 101 - static int innovator1610_panel_remove(struct platform_device *pdev) 102 - { 103 - return 0; 104 - } 105 - 106 - static int innovator1610_panel_suspend(struct platform_device *pdev, 107 - pm_message_t mesg) 108 - { 109 - return 0; 110 - } 111 - 112 - static int innovator1610_panel_resume(struct platform_device *pdev) 113 - { 114 - return 0; 115 - } 116 - 117 107 static struct platform_driver innovator1610_panel_driver = { 118 108 .probe = innovator1610_panel_probe, 119 - .remove = innovator1610_panel_remove, 120 - .suspend = innovator1610_panel_suspend, 121 - .resume = innovator1610_panel_resume, 122 109 .driver = { 123 110 .name = "lcd_inn1610", 124 111 },
+1 -37
drivers/video/fbdev/omap/lcd_osk.c
··· 29 29 30 30 #include "omapfb.h" 31 31 32 - static int osk_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev) 33 - { 34 - /* gpio2 was allocated in board init */ 35 - return 0; 36 - } 37 - 38 - static void osk_panel_cleanup(struct lcd_panel *panel) 39 - { 40 - } 41 - 42 32 static int osk_panel_enable(struct lcd_panel *panel) 43 33 { 44 34 /* configure PWL pin */ ··· 58 68 gpio_set_value(2, 0); 59 69 } 60 70 61 - static unsigned long osk_panel_get_caps(struct lcd_panel *panel) 62 - { 63 - return 0; 64 - } 65 - 66 - struct lcd_panel osk_panel = { 71 + static struct lcd_panel osk_panel = { 67 72 .name = "osk", 68 73 .config = OMAP_LCDC_PANEL_TFT, 69 74 ··· 75 90 .vbp = 0, 76 91 .pcd = 12, 77 92 78 - .init = osk_panel_init, 79 - .cleanup = osk_panel_cleanup, 80 93 .enable = osk_panel_enable, 81 94 .disable = osk_panel_disable, 82 - .get_caps = osk_panel_get_caps, 83 95 }; 84 96 85 97 static int osk_panel_probe(struct platform_device *pdev) ··· 85 103 return 0; 86 104 } 87 105 88 - static int osk_panel_remove(struct platform_device *pdev) 89 - { 90 - return 0; 91 - } 92 - 93 - static int osk_panel_suspend(struct platform_device *pdev, pm_message_t mesg) 94 - { 95 - return 0; 96 - } 97 - 98 - static int osk_panel_resume(struct platform_device *pdev) 99 - { 100 - return 0; 101 - } 102 - 103 106 static struct platform_driver osk_panel_driver = { 104 107 .probe = osk_panel_probe, 105 - .remove = osk_panel_remove, 106 - .suspend = osk_panel_suspend, 107 - .resume = osk_panel_resume, 108 108 .driver = { 109 109 .name = "lcd_osk", 110 110 },
+1 -49
drivers/video/fbdev/omap/lcd_palmte.c
··· 25 25 26 26 #include "omapfb.h" 27 27 28 - static int palmte_panel_init(struct lcd_panel *panel, 29 - struct omapfb_device *fbdev) 30 - { 31 - return 0; 32 - } 33 - 34 - static void palmte_panel_cleanup(struct lcd_panel *panel) 35 - { 36 - } 37 - 38 - static int palmte_panel_enable(struct lcd_panel *panel) 39 - { 40 - return 0; 41 - } 42 - 43 - static void palmte_panel_disable(struct lcd_panel *panel) 44 - { 45 - } 46 - 47 - static unsigned long palmte_panel_get_caps(struct lcd_panel *panel) 48 - { 49 - return 0; 50 - } 51 - 52 - struct lcd_panel palmte_panel = { 28 + static struct lcd_panel palmte_panel = { 53 29 .name = "palmte", 54 30 .config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC | 55 31 OMAP_LCDC_INV_HSYNC | OMAP_LCDC_HSVS_RISING_EDGE | ··· 43 67 .vfp = 8, 44 68 .vbp = 7, 45 69 .pcd = 0, 46 - 47 - .init = palmte_panel_init, 48 - .cleanup = palmte_panel_cleanup, 49 - .enable = palmte_panel_enable, 50 - .disable = palmte_panel_disable, 51 - .get_caps = palmte_panel_get_caps, 52 70 }; 53 71 54 72 static int palmte_panel_probe(struct platform_device *pdev) ··· 51 81 return 0; 52 82 } 53 83 54 - static int palmte_panel_remove(struct platform_device *pdev) 55 - { 56 - return 0; 57 - } 58 - 59 - static int palmte_panel_suspend(struct platform_device *pdev, pm_message_t mesg) 60 - { 61 - return 0; 62 - } 63 - 64 - static int palmte_panel_resume(struct platform_device *pdev) 65 - { 66 - return 0; 67 - } 68 - 69 84 static struct platform_driver palmte_panel_driver = { 70 85 .probe = palmte_panel_probe, 71 - .remove = palmte_panel_remove, 72 - .suspend = palmte_panel_suspend, 73 - .resume = palmte_panel_resume, 74 86 .driver = { 75 87 .name = "lcd_palmte", 76 88 },
+1 -42
drivers/video/fbdev/omap/lcd_palmtt.c
··· 32 32 33 33 #include "omapfb.h" 34 34 35 - static int palmtt_panel_init(struct lcd_panel *panel, 36 - struct omapfb_device *fbdev) 37 - { 38 - return 0; 39 - } 40 - 41 - static void palmtt_panel_cleanup(struct lcd_panel *panel) 42 - { 43 - } 44 - 45 - static int palmtt_panel_enable(struct lcd_panel *panel) 46 - { 47 - return 0; 48 - } 49 - 50 - static void palmtt_panel_disable(struct lcd_panel *panel) 51 - { 52 - } 53 - 54 35 static unsigned long palmtt_panel_get_caps(struct lcd_panel *panel) 55 36 { 56 37 return OMAPFB_CAPS_SET_BACKLIGHT; 57 38 } 58 39 59 - struct lcd_panel palmtt_panel = { 40 + static struct lcd_panel palmtt_panel = { 60 41 .name = "palmtt", 61 42 .config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC | 62 43 OMAP_LCDC_INV_HSYNC | OMAP_LCDC_HSVS_RISING_EDGE | ··· 55 74 .vbp = 7, 56 75 .pcd = 0, 57 76 58 - .init = palmtt_panel_init, 59 - .cleanup = palmtt_panel_cleanup, 60 - .enable = palmtt_panel_enable, 61 - .disable = palmtt_panel_disable, 62 77 .get_caps = palmtt_panel_get_caps, 63 78 }; 64 79 ··· 64 87 return 0; 65 88 } 66 89 67 - static int palmtt_panel_remove(struct platform_device *pdev) 68 - { 69 - return 0; 70 - } 71 - 72 - static int palmtt_panel_suspend(struct platform_device *pdev, pm_message_t mesg) 73 - { 74 - return 0; 75 - } 76 - 77 - static int palmtt_panel_resume(struct platform_device *pdev) 78 - { 79 - return 0; 80 - } 81 - 82 90 static struct platform_driver palmtt_panel_driver = { 83 91 .probe = palmtt_panel_probe, 84 - .remove = palmtt_panel_remove, 85 - .suspend = palmtt_panel_suspend, 86 - .resume = palmtt_panel_resume, 87 92 .driver = { 88 93 .name = "lcd_palmtt", 89 94 },
+1 -44
drivers/video/fbdev/omap/lcd_palmz71.c
··· 26 26 27 27 #include "omapfb.h" 28 28 29 - static int palmz71_panel_init(struct lcd_panel *panel, 30 - struct omapfb_device *fbdev) 31 - { 32 - return 0; 33 - } 34 - 35 - static void palmz71_panel_cleanup(struct lcd_panel *panel) 36 - { 37 - 38 - } 39 - 40 - static int palmz71_panel_enable(struct lcd_panel *panel) 41 - { 42 - return 0; 43 - } 44 - 45 - static void palmz71_panel_disable(struct lcd_panel *panel) 46 - { 47 - } 48 - 49 29 static unsigned long palmz71_panel_get_caps(struct lcd_panel *panel) 50 30 { 51 31 return OMAPFB_CAPS_SET_BACKLIGHT; 52 32 } 53 33 54 - struct lcd_panel palmz71_panel = { 34 + static struct lcd_panel palmz71_panel = { 55 35 .name = "palmz71", 56 36 .config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC | 57 37 OMAP_LCDC_INV_HSYNC | OMAP_LCDC_HSVS_RISING_EDGE | ··· 49 69 .vbp = 7, 50 70 .pcd = 0, 51 71 52 - .init = palmz71_panel_init, 53 - .cleanup = palmz71_panel_cleanup, 54 - .enable = palmz71_panel_enable, 55 - .disable = palmz71_panel_disable, 56 72 .get_caps = palmz71_panel_get_caps, 57 73 }; 58 74 ··· 58 82 return 0; 59 83 } 60 84 61 - static int palmz71_panel_remove(struct platform_device *pdev) 62 - { 63 - return 0; 64 - } 65 - 66 - static int palmz71_panel_suspend(struct platform_device *pdev, 67 - pm_message_t mesg) 68 - { 69 - return 0; 70 - } 71 - 72 - static int palmz71_panel_resume(struct platform_device *pdev) 73 - { 74 - return 0; 75 - } 76 - 77 85 static struct platform_driver palmz71_panel_driver = { 78 86 .probe = palmz71_panel_probe, 79 - .remove = palmz71_panel_remove, 80 - .suspend = palmz71_panel_suspend, 81 - .resume = palmz71_panel_resume, 82 87 .driver = { 83 88 .name = "lcd_palmz71", 84 89 },
+20 -11
drivers/video/fbdev/omap/omapfb_main.c
··· 337 337 if (fbdev->state == OMAPFB_SUSPENDED) { 338 338 if (fbdev->ctrl->resume) 339 339 fbdev->ctrl->resume(); 340 - fbdev->panel->enable(fbdev->panel); 340 + if (fbdev->panel->enable) 341 + fbdev->panel->enable(fbdev->panel); 341 342 fbdev->state = OMAPFB_ACTIVE; 342 343 if (fbdev->ctrl->get_update_mode() == 343 344 OMAPFB_MANUAL_UPDATE) ··· 347 346 break; 348 347 case FB_BLANK_POWERDOWN: 349 348 if (fbdev->state == OMAPFB_ACTIVE) { 350 - fbdev->panel->disable(fbdev->panel); 349 + if (fbdev->panel->disable) 350 + fbdev->panel->disable(fbdev->panel); 351 351 if (fbdev->ctrl->suspend) 352 352 fbdev->ctrl->suspend(); 353 353 fbdev->state = OMAPFB_SUSPENDED; ··· 1032 1030 { 1033 1031 memset(caps, 0, sizeof(*caps)); 1034 1032 fbdev->ctrl->get_caps(plane, caps); 1035 - caps->ctrl |= fbdev->panel->get_caps(fbdev->panel); 1033 + if (fbdev->panel->get_caps) 1034 + caps->ctrl |= fbdev->panel->get_caps(fbdev->panel); 1036 1035 } 1037 1036 1038 1037 /* For lcd testing */ ··· 1552 1549 case 7: 1553 1550 omapfb_unregister_sysfs(fbdev); 1554 1551 case 6: 1555 - fbdev->panel->disable(fbdev->panel); 1552 + if (fbdev->panel->disable) 1553 + fbdev->panel->disable(fbdev->panel); 1556 1554 case 5: 1557 1555 omapfb_set_update_mode(fbdev, OMAPFB_UPDATE_DISABLED); 1558 1556 case 4: ··· 1561 1557 case 3: 1562 1558 ctrl_cleanup(fbdev); 1563 1559 case 2: 1564 - fbdev->panel->cleanup(fbdev->panel); 1560 + if (fbdev->panel->cleanup) 1561 + fbdev->panel->cleanup(fbdev->panel); 1565 1562 case 1: 1566 1563 dev_set_drvdata(fbdev->dev, NULL); 1567 1564 kfree(fbdev); ··· 1685 1680 goto cleanup; 1686 1681 } 1687 1682 1688 - r = fbdev->panel->init(fbdev->panel, fbdev); 1689 - if (r) 1690 - goto cleanup; 1683 + if (fbdev->panel->init) { 1684 + r = fbdev->panel->init(fbdev->panel, fbdev); 1685 + if (r) 1686 + goto cleanup; 1687 + } 1691 1688 1692 1689 pr_info("omapfb: configured for panel %s\n", fbdev->panel->name); 1693 1690 ··· 1732 1725 OMAPFB_MANUAL_UPDATE : OMAPFB_AUTO_UPDATE); 1733 1726 init_state++; 1734 1727 1735 - r = fbdev->panel->enable(fbdev->panel); 1736 - if (r) 1737 - goto cleanup; 1728 + if (fbdev->panel->enable) { 1729 + r = fbdev->panel->enable(fbdev->panel); 1730 + if (r) 1731 + goto cleanup; 1732 + } 1738 1733 init_state++; 1739 1734 1740 1735 r = omapfb_register_sysfs(fbdev);
+1 -1
drivers/video/fbdev/pmag-ba-fb.c
··· 129 129 /* 130 130 * Turn the hardware cursor off. 131 131 */ 132 - static void __init pmagbafb_erase_cursor(struct fb_info *info) 132 + static void pmagbafb_erase_cursor(struct fb_info *info) 133 133 { 134 134 struct pmagbafb_par *par = info->par; 135 135
+1 -1
drivers/video/fbdev/pmagb-b-fb.c
··· 133 133 /* 134 134 * Turn the hardware cursor off. 135 135 */ 136 - static void __init pmagbbfb_erase_cursor(struct fb_info *info) 136 + static void pmagbbfb_erase_cursor(struct fb_info *info) 137 137 { 138 138 struct pmagbbfb_par *par = info->par; 139 139
+6 -4
drivers/video/fbdev/sh_mobile_lcdcfb.c
··· 439 439 } 440 440 441 441 static struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = { 442 - lcdc_sys_write_index, 443 - lcdc_sys_write_data, 444 - lcdc_sys_read_data, 442 + .write_index = lcdc_sys_write_index, 443 + .write_data = lcdc_sys_write_data, 444 + .read_data = lcdc_sys_read_data, 445 445 }; 446 446 447 447 static int sh_mobile_lcdc_sginit(struct fb_info *info, ··· 2782 2782 priv->forced_fourcc = pdata->ch[0].fourcc; 2783 2783 2784 2784 priv->base = ioremap_nocache(res->start, resource_size(res)); 2785 - if (!priv->base) 2785 + if (!priv->base) { 2786 + error = -ENOMEM; 2786 2787 goto err1; 2788 + } 2787 2789 2788 2790 error = sh_mobile_lcdc_setup_clocks(priv, pdata->clock_source); 2789 2791 if (error) {
+40 -16
drivers/video/fbdev/simplefb.c
··· 180 180 struct simplefb_par { 181 181 u32 palette[PSEUDO_PALETTE_SIZE]; 182 182 #if defined CONFIG_OF && defined CONFIG_COMMON_CLK 183 + bool clks_enabled; 183 184 unsigned int clk_count; 184 185 struct clk **clks; 185 186 #endif 186 187 #if defined CONFIG_OF && defined CONFIG_REGULATOR 188 + bool regulators_enabled; 187 189 u32 regulator_count; 188 190 struct regulator **regulators; 189 191 #endif ··· 210 208 * the fb probe will not help us much either. So just complain and carry on, 211 209 * and hope that the user actually gets a working fb at the end of things. 212 210 */ 213 - static int simplefb_clocks_init(struct simplefb_par *par, 214 - struct platform_device *pdev) 211 + static int simplefb_clocks_get(struct simplefb_par *par, 212 + struct platform_device *pdev) 215 213 { 216 214 struct device_node *np = pdev->dev.of_node; 217 215 struct clk *clock; 218 - int i, ret; 216 + int i; 219 217 220 218 if (dev_get_platdata(&pdev->dev) || !np) 221 219 return 0; ··· 246 244 par->clks[i] = clock; 247 245 } 248 246 247 + return 0; 248 + } 249 + 250 + static void simplefb_clocks_enable(struct simplefb_par *par, 251 + struct platform_device *pdev) 252 + { 253 + int i, ret; 254 + 249 255 for (i = 0; i < par->clk_count; i++) { 250 256 if (par->clks[i]) { 251 257 ret = clk_prepare_enable(par->clks[i]); ··· 266 256 } 267 257 } 268 258 } 269 - 270 - return 0; 259 + par->clks_enabled = true; 271 260 } 272 261 273 262 static void simplefb_clocks_destroy(struct simplefb_par *par) ··· 278 269 279 270 for (i = 0; i < par->clk_count; i++) { 280 271 if (par->clks[i]) { 281 - clk_disable_unprepare(par->clks[i]); 272 + if (par->clks_enabled) 273 + clk_disable_unprepare(par->clks[i]); 282 274 clk_put(par->clks[i]); 283 275 } 284 276 } ··· 287 277 kfree(par->clks); 288 278 } 289 279 #else 290 - static int simplefb_clocks_init(struct simplefb_par *par, 280 + static int simplefb_clocks_get(struct simplefb_par *par, 291 281 struct platform_device *pdev) { return 0; } 282 + static void simplefb_clocks_enable(struct simplefb_par *par, 283 + struct platform_device *pdev) { } 292 284 static void simplefb_clocks_destroy(struct simplefb_par *par) { } 293 285 #endif 294 286 ··· 317 305 * the fb probe will not help us much either. So just complain and carry on, 318 306 * and hope that the user actually gets a working fb at the end of things. 319 307 */ 320 - static int simplefb_regulators_init(struct simplefb_par *par, 321 - struct platform_device *pdev) 308 + static int simplefb_regulators_get(struct simplefb_par *par, 309 + struct platform_device *pdev) 322 310 { 323 311 struct device_node *np = pdev->dev.of_node; 324 312 struct property *prop; 325 313 struct regulator *regulator; 326 314 const char *p; 327 - int count = 0, i = 0, ret; 315 + int count = 0, i = 0; 328 316 329 317 if (dev_get_platdata(&pdev->dev) || !np) 330 318 return 0; ··· 366 354 } 367 355 par->regulator_count = i; 368 356 357 + return 0; 358 + } 359 + 360 + static void simplefb_regulators_enable(struct simplefb_par *par, 361 + struct platform_device *pdev) 362 + { 363 + int i, ret; 364 + 369 365 /* Enable all the regulators */ 370 366 for (i = 0; i < par->regulator_count; i++) { 371 367 ret = regulator_enable(par->regulators[i]); ··· 385 365 par->regulators[i] = NULL; 386 366 } 387 367 } 388 - 389 - return 0; 368 + par->regulators_enabled = true; 390 369 } 391 370 392 371 static void simplefb_regulators_destroy(struct simplefb_par *par) 393 372 { 394 373 int i; 395 374 396 - if (!par->regulators) 375 + if (!par->regulators || !par->regulators_enabled) 397 376 return; 398 377 399 378 for (i = 0; i < par->regulator_count; i++) ··· 400 381 regulator_disable(par->regulators[i]); 401 382 } 402 383 #else 403 - static int simplefb_regulators_init(struct simplefb_par *par, 384 + static int simplefb_regulators_get(struct simplefb_par *par, 404 385 struct platform_device *pdev) { return 0; } 386 + static void simplefb_regulators_enable(struct simplefb_par *par, 387 + struct platform_device *pdev) { } 405 388 static void simplefb_regulators_destroy(struct simplefb_par *par) { } 406 389 #endif 407 390 ··· 474 453 } 475 454 info->pseudo_palette = par->palette; 476 455 477 - ret = simplefb_clocks_init(par, pdev); 456 + ret = simplefb_clocks_get(par, pdev); 478 457 if (ret < 0) 479 458 goto error_unmap; 480 459 481 - ret = simplefb_regulators_init(par, pdev); 460 + ret = simplefb_regulators_get(par, pdev); 482 461 if (ret < 0) 483 462 goto error_clocks; 463 + 464 + simplefb_clocks_enable(par, pdev); 465 + simplefb_regulators_enable(par, pdev); 484 466 485 467 dev_info(&pdev->dev, "framebuffer at 0x%lx, 0x%x bytes, mapped to 0x%p\n", 486 468 info->fix.smem_start, info->fix.smem_len,
+36 -20
drivers/video/fbdev/ssd1307fb.c
··· 9 9 #include <linux/backlight.h> 10 10 #include <linux/delay.h> 11 11 #include <linux/fb.h> 12 + #include <linux/gpio/consumer.h> 12 13 #include <linux/i2c.h> 13 14 #include <linux/kernel.h> 14 15 #include <linux/module.h> ··· 17 16 #include <linux/of_gpio.h> 18 17 #include <linux/pwm.h> 19 18 #include <linux/uaccess.h> 19 + #include <linux/regulator/consumer.h> 20 20 21 21 #define SSD1307FB_DATA 0x40 22 22 #define SSD1307FB_COMMAND 0x80 ··· 75 73 u32 prechargep2; 76 74 struct pwm_device *pwm; 77 75 u32 pwm_period; 78 - int reset; 76 + struct gpio_desc *reset; 77 + struct regulator *vbat_reg; 79 78 u32 seg_remap; 80 79 u32 vcomh; 81 80 u32 width; ··· 442 439 if (ret < 0) 443 440 return ret; 444 441 442 + /* Clear the screen */ 443 + ssd1307fb_update_display(par); 444 + 445 445 /* Turn on the display */ 446 446 ret = ssd1307fb_write_cmd(par->client, SSD1307FB_DISPLAY_ON); 447 447 if (ret < 0) ··· 567 561 568 562 par->device_info = of_device_get_match_data(&client->dev); 569 563 570 - par->reset = of_get_named_gpio(client->dev.of_node, 571 - "reset-gpios", 0); 572 - if (!gpio_is_valid(par->reset)) { 573 - ret = -EINVAL; 564 + par->reset = devm_gpiod_get_optional(&client->dev, "reset", 565 + GPIOD_OUT_LOW); 566 + if (IS_ERR(par->reset)) { 567 + dev_err(&client->dev, "failed to get reset gpio: %ld\n", 568 + PTR_ERR(par->reset)); 569 + ret = PTR_ERR(par->reset); 570 + goto fb_alloc_error; 571 + } 572 + 573 + par->vbat_reg = devm_regulator_get_optional(&client->dev, "vbat"); 574 + if (IS_ERR(par->vbat_reg)) { 575 + dev_err(&client->dev, "failed to get VBAT regulator: %ld\n", 576 + PTR_ERR(par->vbat_reg)); 577 + ret = PTR_ERR(par->vbat_reg); 574 578 goto fb_alloc_error; 575 579 } 576 580 ··· 658 642 659 643 fb_deferred_io_init(info); 660 644 661 - ret = devm_gpio_request_one(&client->dev, par->reset, 662 - GPIOF_OUT_INIT_HIGH, 663 - "oled-reset"); 645 + i2c_set_clientdata(client, info); 646 + 647 + if (par->reset) { 648 + /* Reset the screen */ 649 + gpiod_set_value(par->reset, 0); 650 + udelay(4); 651 + gpiod_set_value(par->reset, 1); 652 + udelay(4); 653 + } 654 + 655 + ret = regulator_enable(par->vbat_reg); 664 656 if (ret) { 665 - dev_err(&client->dev, 666 - "failed to request gpio %d: %d\n", 667 - par->reset, ret); 657 + dev_err(&client->dev, "failed to enable VBAT: %d\n", ret); 668 658 goto reset_oled_error; 669 659 } 670 660 671 - i2c_set_clientdata(client, info); 672 - 673 - /* Reset the screen */ 674 - gpio_set_value(par->reset, 0); 675 - udelay(4); 676 - gpio_set_value(par->reset, 1); 677 - udelay(4); 678 - 679 661 ret = ssd1307fb_init(par); 680 662 if (ret) 681 - goto reset_oled_error; 663 + goto regulator_enable_error; 682 664 683 665 ret = register_framebuffer(info); 684 666 if (ret) { ··· 709 695 pwm_disable(par->pwm); 710 696 pwm_put(par->pwm); 711 697 }; 698 + regulator_enable_error: 699 + regulator_disable(par->vbat_reg); 712 700 reset_oled_error: 713 701 fb_deferred_io_cleanup(info); 714 702 fb_alloc_error:
+4
drivers/video/fbdev/stifb.c
··· 1294 1294 strcpy(fix->id, "stifb"); 1295 1295 info->fbops = &stifb_ops; 1296 1296 info->screen_base = ioremap_nocache(REGION_BASE(fb,1), fix->smem_len); 1297 + if (!info->screen_base) { 1298 + printk(KERN_ERR "stifb: failed to map memory\n"); 1299 + goto out_err0; 1300 + } 1297 1301 info->screen_size = fix->smem_len; 1298 1302 info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA; 1299 1303 info->pseudo_palette = &fb->pseudo_palette;
+1 -1
drivers/video/fbdev/wm8505fb.c
··· 182 182 return count; 183 183 } 184 184 185 - static DEVICE_ATTR(contrast, 0644, contrast_show, contrast_store); 185 + static DEVICE_ATTR_RW(contrast); 186 186 187 187 static inline u_int chan_to_field(u_int chan, struct fb_bitfield *bf) 188 188 {
+2 -2
include/linux/fsl-diu-fb.h
··· 73 73 /* Word 0(32-bit) in DDR memory */ 74 74 /* __u16 comp; */ 75 75 /* __u16 pixel_s:2; */ 76 - /* __u16 pallete:1; */ 76 + /* __u16 palette:1; */ 77 77 /* __u16 red_c:2; */ 78 78 /* __u16 green_c:2; */ 79 79 /* __u16 blue_c:2; */ ··· 142 142 struct diu { 143 143 __be32 desc[3]; 144 144 __be32 gamma; 145 - __be32 pallete; 145 + __be32 palette; 146 146 __be32 cursor; 147 147 __be32 curs_pos; 148 148 __be32 diu_mode;
-4
include/linux/platform_data/video-imxfb.h
··· 47 47 #define LSCR1_GRAY2(x) (((x) & 0xf) << 4) 48 48 #define LSCR1_GRAY1(x) (((x) & 0xf)) 49 49 50 - #define DMACR_BURST (1 << 31) 51 - #define DMACR_HM(x) (((x) & 0xf) << 16) 52 - #define DMACR_TM(x) ((x) & 0xf) 53 - 54 50 struct imx_fb_videomode { 55 51 struct fb_videomode mode; 56 52 u32 pcr;