aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/s3c-fb.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-27 09:16:08 -0500
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2012-01-03 11:00:04 -0500
commita2b77dcebf6e968bada4d415d426b39ac199e8aa (patch)
tree438cdabf6d39f351b913a87f7bd64643dd5a5521 /drivers/video/s3c-fb.c
parentfe05f8b1c3d28e6204a9ec54dec0d68af6cbf4c8 (diff)
video: s3c-fb: Use s3c_fb_enable() to enable the framebuffer
The s3c-fb driver has a function called s3c_fb_enable() which turns on and off the physical output. However it is only actually used in paths which disable the screen, the enabling just writes to the register. Make the code less confusing by ensuring that the enable also goes through the same path. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/s3c-fb.c')
-rw-r--r--drivers/video/s3c-fb.c55
1 files changed, 28 insertions, 27 deletions
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index b1a75a024a2c..be4c218bb931 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -441,6 +441,32 @@ static void shadow_protect_win(struct s3c_fb_win *win, bool protect)
441} 441}
442 442
443/** 443/**
444 * s3c_fb_enable() - Set the state of the main LCD output
445 * @sfb: The main framebuffer state.
446 * @enable: The state to set.
447 */
448static void s3c_fb_enable(struct s3c_fb *sfb, int enable)
449{
450 u32 vidcon0 = readl(sfb->regs + VIDCON0);
451
452 if (enable)
453 vidcon0 |= VIDCON0_ENVID | VIDCON0_ENVID_F;
454 else {
455 /* see the note in the framebuffer datasheet about
456 * why you cannot take both of these bits down at the
457 * same time. */
458
459 if (!(vidcon0 & VIDCON0_ENVID))
460 return;
461
462 vidcon0 |= VIDCON0_ENVID;
463 vidcon0 &= ~VIDCON0_ENVID_F;
464 }
465
466 writel(vidcon0, sfb->regs + VIDCON0);
467}
468
469/**
444 * s3c_fb_set_par() - framebuffer request to set new framebuffer state. 470 * s3c_fb_set_par() - framebuffer request to set new framebuffer state.
445 * @info: The framebuffer to change. 471 * @info: The framebuffer to change.
446 * 472 *
@@ -510,9 +536,10 @@ static int s3c_fb_set_par(struct fb_info *info)
510 if (sfb->variant.is_2443) 536 if (sfb->variant.is_2443)
511 data |= (1 << 5); 537 data |= (1 << 5);
512 538
513 data |= VIDCON0_ENVID | VIDCON0_ENVID_F;
514 writel(data, regs + VIDCON0); 539 writel(data, regs + VIDCON0);
515 540
541 s3c_fb_enable(sfb, 1);
542
516 data = VIDTCON0_VBPD(var->upper_margin - 1) | 543 data = VIDTCON0_VBPD(var->upper_margin - 1) |
517 VIDTCON0_VFPD(var->lower_margin - 1) | 544 VIDTCON0_VFPD(var->lower_margin - 1) |
518 VIDTCON0_VSPW(var->vsync_len - 1); 545 VIDTCON0_VSPW(var->vsync_len - 1);
@@ -761,32 +788,6 @@ static int s3c_fb_setcolreg(unsigned regno,
761} 788}
762 789
763/** 790/**
764 * s3c_fb_enable() - Set the state of the main LCD output
765 * @sfb: The main framebuffer state.
766 * @enable: The state to set.
767 */
768static void s3c_fb_enable(struct s3c_fb *sfb, int enable)
769{
770 u32 vidcon0 = readl(sfb->regs + VIDCON0);
771
772 if (enable)
773 vidcon0 |= VIDCON0_ENVID | VIDCON0_ENVID_F;
774 else {
775 /* see the note in the framebuffer datasheet about
776 * why you cannot take both of these bits down at the
777 * same time. */
778
779 if (!(vidcon0 & VIDCON0_ENVID))
780 return;
781
782 vidcon0 |= VIDCON0_ENVID;
783 vidcon0 &= ~VIDCON0_ENVID_F;
784 }
785
786 writel(vidcon0, sfb->regs + VIDCON0);
787}
788
789/**
790 * s3c_fb_blank() - blank or unblank the given window 791 * s3c_fb_blank() - blank or unblank the given window
791 * @blank_mode: The blank state from FB_BLANK_* 792 * @blank_mode: The blank state from FB_BLANK_*
792 * @info: The framebuffer to blank. 793 * @info: The framebuffer to blank.