Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284876
b: refs/heads/master
c: a2b77dc
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown authored and Florian Tobias Schandinat committed Jan 3, 2012
1 parent 7b8f347 commit 946468a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe05f8b1c3d28e6204a9ec54dec0d68af6cbf4c8
refs/heads/master: a2b77dcebf6e968bada4d415d426b39ac199e8aa
55 changes: 28 additions & 27 deletions trunk/drivers/video/s3c-fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,32 @@ static void shadow_protect_win(struct s3c_fb_win *win, bool protect)
}
}

/**
* s3c_fb_enable() - Set the state of the main LCD output
* @sfb: The main framebuffer state.
* @enable: The state to set.
*/
static void s3c_fb_enable(struct s3c_fb *sfb, int enable)
{
u32 vidcon0 = readl(sfb->regs + VIDCON0);

if (enable)
vidcon0 |= VIDCON0_ENVID | VIDCON0_ENVID_F;
else {
/* see the note in the framebuffer datasheet about
* why you cannot take both of these bits down at the
* same time. */

if (!(vidcon0 & VIDCON0_ENVID))
return;

vidcon0 |= VIDCON0_ENVID;
vidcon0 &= ~VIDCON0_ENVID_F;
}

writel(vidcon0, sfb->regs + VIDCON0);
}

/**
* s3c_fb_set_par() - framebuffer request to set new framebuffer state.
* @info: The framebuffer to change.
Expand Down Expand Up @@ -510,9 +536,10 @@ static int s3c_fb_set_par(struct fb_info *info)
if (sfb->variant.is_2443)
data |= (1 << 5);

data |= VIDCON0_ENVID | VIDCON0_ENVID_F;
writel(data, regs + VIDCON0);

s3c_fb_enable(sfb, 1);

data = VIDTCON0_VBPD(var->upper_margin - 1) |
VIDTCON0_VFPD(var->lower_margin - 1) |
VIDTCON0_VSPW(var->vsync_len - 1);
Expand Down Expand Up @@ -760,32 +787,6 @@ static int s3c_fb_setcolreg(unsigned regno,
return 0;
}

/**
* s3c_fb_enable() - Set the state of the main LCD output
* @sfb: The main framebuffer state.
* @enable: The state to set.
*/
static void s3c_fb_enable(struct s3c_fb *sfb, int enable)
{
u32 vidcon0 = readl(sfb->regs + VIDCON0);

if (enable)
vidcon0 |= VIDCON0_ENVID | VIDCON0_ENVID_F;
else {
/* see the note in the framebuffer datasheet about
* why you cannot take both of these bits down at the
* same time. */

if (!(vidcon0 & VIDCON0_ENVID))
return;

vidcon0 |= VIDCON0_ENVID;
vidcon0 &= ~VIDCON0_ENVID_F;
}

writel(vidcon0, sfb->regs + VIDCON0);
}

/**
* s3c_fb_blank() - blank or unblank the given window
* @blank_mode: The blank state from FB_BLANK_*
Expand Down

0 comments on commit 946468a

Please sign in to comment.