diff options
author | Joe Perches <joe@perches.com> | 2013-09-19 21:35:55 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-10-29 06:53:07 -0400 |
commit | 31b6780c15a4e3a90fe260e977f5186772ce7afb (patch) | |
tree | 9147371d1b0f5b6dbf1806a7af125552a67fbc3b /drivers/video/vt8623fb.c | |
parent | f51a07d05c5142e73f781d878f411d63d3548a49 (diff) |
framebuffer: Use fb_<level>
Neaten and shorten the code using the new fb_<level> macros.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/vt8623fb.c')
-rw-r--r-- | drivers/video/vt8623fb.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/drivers/video/vt8623fb.c b/drivers/video/vt8623fb.c index 6b424ddd6793..8bc6e0958a09 100644 --- a/drivers/video/vt8623fb.c +++ b/drivers/video/vt8623fb.c | |||
@@ -266,7 +266,7 @@ static void vt8623_set_pixclock(struct fb_info *info, u32 pixclock) | |||
266 | 266 | ||
267 | rv = svga_compute_pll(&vt8623_pll, 1000000000 / pixclock, &m, &n, &r, info->node); | 267 | rv = svga_compute_pll(&vt8623_pll, 1000000000 / pixclock, &m, &n, &r, info->node); |
268 | if (rv < 0) { | 268 | if (rv < 0) { |
269 | printk(KERN_ERR "fb%d: cannot set requested pixclock, keeping old value\n", info->node); | 269 | fb_err(info, "cannot set requested pixclock, keeping old value\n"); |
270 | return; | 270 | return; |
271 | } | 271 | } |
272 | 272 | ||
@@ -335,7 +335,7 @@ static int vt8623fb_check_var(struct fb_var_screeninfo *var, struct fb_info *inf | |||
335 | rv = svga_match_format (vt8623fb_formats, var, NULL); | 335 | rv = svga_match_format (vt8623fb_formats, var, NULL); |
336 | if (rv < 0) | 336 | if (rv < 0) |
337 | { | 337 | { |
338 | printk(KERN_ERR "fb%d: unsupported mode requested\n", info->node); | 338 | fb_err(info, "unsupported mode requested\n"); |
339 | return rv; | 339 | return rv; |
340 | } | 340 | } |
341 | 341 | ||
@@ -354,21 +354,23 @@ static int vt8623fb_check_var(struct fb_var_screeninfo *var, struct fb_info *inf | |||
354 | mem = ((var->bits_per_pixel * var->xres_virtual) >> 3) * var->yres_virtual; | 354 | mem = ((var->bits_per_pixel * var->xres_virtual) >> 3) * var->yres_virtual; |
355 | if (mem > info->screen_size) | 355 | if (mem > info->screen_size) |
356 | { | 356 | { |
357 | printk(KERN_ERR "fb%d: not enough framebuffer memory (%d kB requested , %d kB available)\n", info->node, mem >> 10, (unsigned int) (info->screen_size >> 10)); | 357 | fb_err(info, "not enough framebuffer memory (%d kB requested, %d kB available)\n", |
358 | mem >> 10, (unsigned int) (info->screen_size >> 10)); | ||
358 | return -EINVAL; | 359 | return -EINVAL; |
359 | } | 360 | } |
360 | 361 | ||
361 | /* Text mode is limited to 256 kB of memory */ | 362 | /* Text mode is limited to 256 kB of memory */ |
362 | if ((var->bits_per_pixel == 0) && (mem > (256*1024))) | 363 | if ((var->bits_per_pixel == 0) && (mem > (256*1024))) |
363 | { | 364 | { |
364 | printk(KERN_ERR "fb%d: text framebuffer size too large (%d kB requested, 256 kB possible)\n", info->node, mem >> 10); | 365 | fb_err(info, "text framebuffer size too large (%d kB requested, 256 kB possible)\n", |
366 | mem >> 10); | ||
365 | return -EINVAL; | 367 | return -EINVAL; |
366 | } | 368 | } |
367 | 369 | ||
368 | rv = svga_check_timings (&vt8623_timing_regs, var, info->node); | 370 | rv = svga_check_timings (&vt8623_timing_regs, var, info->node); |
369 | if (rv < 0) | 371 | if (rv < 0) |
370 | { | 372 | { |
371 | printk(KERN_ERR "fb%d: invalid timings requested\n", info->node); | 373 | fb_err(info, "invalid timings requested\n"); |
372 | return rv; | 374 | return rv; |
373 | } | 375 | } |
374 | 376 | ||
@@ -474,32 +476,32 @@ static int vt8623fb_set_par(struct fb_info *info) | |||
474 | mode = svga_match_format(vt8623fb_formats, &(info->var), &(info->fix)); | 476 | mode = svga_match_format(vt8623fb_formats, &(info->var), &(info->fix)); |
475 | switch (mode) { | 477 | switch (mode) { |
476 | case 0: | 478 | case 0: |
477 | pr_debug("fb%d: text mode\n", info->node); | 479 | fb_dbg(info, "text mode\n"); |
478 | svga_set_textmode_vga_regs(par->state.vgabase); | 480 | svga_set_textmode_vga_regs(par->state.vgabase); |
479 | svga_wseq_mask(par->state.vgabase, 0x15, 0x00, 0xFE); | 481 | svga_wseq_mask(par->state.vgabase, 0x15, 0x00, 0xFE); |
480 | svga_wcrt_mask(par->state.vgabase, 0x11, 0x60, 0x70); | 482 | svga_wcrt_mask(par->state.vgabase, 0x11, 0x60, 0x70); |
481 | break; | 483 | break; |
482 | case 1: | 484 | case 1: |
483 | pr_debug("fb%d: 4 bit pseudocolor\n", info->node); | 485 | fb_dbg(info, "4 bit pseudocolor\n"); |
484 | vga_wgfx(par->state.vgabase, VGA_GFX_MODE, 0x40); | 486 | vga_wgfx(par->state.vgabase, VGA_GFX_MODE, 0x40); |
485 | svga_wseq_mask(par->state.vgabase, 0x15, 0x20, 0xFE); | 487 | svga_wseq_mask(par->state.vgabase, 0x15, 0x20, 0xFE); |
486 | svga_wcrt_mask(par->state.vgabase, 0x11, 0x00, 0x70); | 488 | svga_wcrt_mask(par->state.vgabase, 0x11, 0x00, 0x70); |
487 | break; | 489 | break; |
488 | case 2: | 490 | case 2: |
489 | pr_debug("fb%d: 4 bit pseudocolor, planar\n", info->node); | 491 | fb_dbg(info, "4 bit pseudocolor, planar\n"); |
490 | svga_wseq_mask(par->state.vgabase, 0x15, 0x00, 0xFE); | 492 | svga_wseq_mask(par->state.vgabase, 0x15, 0x00, 0xFE); |
491 | svga_wcrt_mask(par->state.vgabase, 0x11, 0x00, 0x70); | 493 | svga_wcrt_mask(par->state.vgabase, 0x11, 0x00, 0x70); |
492 | break; | 494 | break; |
493 | case 3: | 495 | case 3: |
494 | pr_debug("fb%d: 8 bit pseudocolor\n", info->node); | 496 | fb_dbg(info, "8 bit pseudocolor\n"); |
495 | svga_wseq_mask(par->state.vgabase, 0x15, 0x22, 0xFE); | 497 | svga_wseq_mask(par->state.vgabase, 0x15, 0x22, 0xFE); |
496 | break; | 498 | break; |
497 | case 4: | 499 | case 4: |
498 | pr_debug("fb%d: 5/6/5 truecolor\n", info->node); | 500 | fb_dbg(info, "5/6/5 truecolor\n"); |
499 | svga_wseq_mask(par->state.vgabase, 0x15, 0xB6, 0xFE); | 501 | svga_wseq_mask(par->state.vgabase, 0x15, 0xB6, 0xFE); |
500 | break; | 502 | break; |
501 | case 5: | 503 | case 5: |
502 | pr_debug("fb%d: 8/8/8 truecolor\n", info->node); | 504 | fb_dbg(info, "8/8/8 truecolor\n"); |
503 | svga_wseq_mask(par->state.vgabase, 0x15, 0xAE, 0xFE); | 505 | svga_wseq_mask(par->state.vgabase, 0x15, 0xAE, 0xFE); |
504 | break; | 506 | break; |
505 | default: | 507 | default: |
@@ -584,27 +586,27 @@ static int vt8623fb_blank(int blank_mode, struct fb_info *info) | |||
584 | 586 | ||
585 | switch (blank_mode) { | 587 | switch (blank_mode) { |
586 | case FB_BLANK_UNBLANK: | 588 | case FB_BLANK_UNBLANK: |
587 | pr_debug("fb%d: unblank\n", info->node); | 589 | fb_dbg(info, "unblank\n"); |
588 | svga_wcrt_mask(par->state.vgabase, 0x36, 0x00, 0x30); | 590 | svga_wcrt_mask(par->state.vgabase, 0x36, 0x00, 0x30); |
589 | svga_wseq_mask(par->state.vgabase, 0x01, 0x00, 0x20); | 591 | svga_wseq_mask(par->state.vgabase, 0x01, 0x00, 0x20); |
590 | break; | 592 | break; |
591 | case FB_BLANK_NORMAL: | 593 | case FB_BLANK_NORMAL: |
592 | pr_debug("fb%d: blank\n", info->node); | 594 | fb_dbg(info, "blank\n"); |
593 | svga_wcrt_mask(par->state.vgabase, 0x36, 0x00, 0x30); | 595 | svga_wcrt_mask(par->state.vgabase, 0x36, 0x00, 0x30); |
594 | svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20); | 596 | svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20); |
595 | break; | 597 | break; |
596 | case FB_BLANK_HSYNC_SUSPEND: | 598 | case FB_BLANK_HSYNC_SUSPEND: |
597 | pr_debug("fb%d: DPMS standby (hsync off)\n", info->node); | 599 | fb_dbg(info, "DPMS standby (hsync off)\n"); |
598 | svga_wcrt_mask(par->state.vgabase, 0x36, 0x10, 0x30); | 600 | svga_wcrt_mask(par->state.vgabase, 0x36, 0x10, 0x30); |
599 | svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20); | 601 | svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20); |
600 | break; | 602 | break; |
601 | case FB_BLANK_VSYNC_SUSPEND: | 603 | case FB_BLANK_VSYNC_SUSPEND: |
602 | pr_debug("fb%d: DPMS suspend (vsync off)\n", info->node); | 604 | fb_dbg(info, "DPMS suspend (vsync off)\n"); |
603 | svga_wcrt_mask(par->state.vgabase, 0x36, 0x20, 0x30); | 605 | svga_wcrt_mask(par->state.vgabase, 0x36, 0x20, 0x30); |
604 | svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20); | 606 | svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20); |
605 | break; | 607 | break; |
606 | case FB_BLANK_POWERDOWN: | 608 | case FB_BLANK_POWERDOWN: |
607 | pr_debug("fb%d: DPMS off (no sync)\n", info->node); | 609 | fb_dbg(info, "DPMS off (no sync)\n"); |
608 | svga_wcrt_mask(par->state.vgabase, 0x36, 0x30, 0x30); | 610 | svga_wcrt_mask(par->state.vgabase, 0x36, 0x30, 0x30); |
609 | svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20); | 611 | svga_wseq_mask(par->state.vgabase, 0x01, 0x20, 0x20); |
610 | break; | 612 | break; |
@@ -769,12 +771,12 @@ static int vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
769 | 771 | ||
770 | rc = register_framebuffer(info); | 772 | rc = register_framebuffer(info); |
771 | if (rc < 0) { | 773 | if (rc < 0) { |
772 | dev_err(info->device, "cannot register framebugger\n"); | 774 | dev_err(info->device, "cannot register framebuffer\n"); |
773 | goto err_reg_fb; | 775 | goto err_reg_fb; |
774 | } | 776 | } |
775 | 777 | ||
776 | printk(KERN_INFO "fb%d: %s on %s, %d MB RAM\n", info->node, info->fix.id, | 778 | fb_info(info, "%s on %s, %d MB RAM\n", |
777 | pci_name(dev), info->fix.smem_len >> 20); | 779 | info->fix.id, pci_name(dev), info->fix.smem_len >> 20); |
778 | 780 | ||
779 | /* Record a reference to the driver data */ | 781 | /* Record a reference to the driver data */ |
780 | pci_set_drvdata(dev, info); | 782 | pci_set_drvdata(dev, info); |