Skip to content

Commit

Permalink
s3c-fb: protect window-specific registers during updates
Browse files Browse the repository at this point in the history
Newer hardware (S3C6410, S5P) have the ability to block updates from
shadow registers during reconfiguration.  Add protect calls for set_par
and clear protection when resetting.

Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: InKi Dae <inki.dae@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Pawel Osciak authored and Linus Torvalds committed Aug 11, 2010
1 parent f676ec2 commit a8bdabc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/video/s3c-fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ static int s3c_fb_set_par(struct fb_info *info)

dev_dbg(sfb->dev, "setting framebuffer parameters\n");

shadow_protect_win(win, 1);

switch (var->bits_per_pixel) {
case 32:
case 24:
Expand Down Expand Up @@ -632,6 +634,8 @@ static int s3c_fb_set_par(struct fb_info *info)
writel(data, regs + sfb->variant.wincon + (win_no * 4));
writel(0x0, regs + sfb->variant.winmap + (win_no * 4));

shadow_protect_win(win, 0);

return 0;
}

Expand Down Expand Up @@ -1228,11 +1232,14 @@ static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
static void s3c_fb_clear_win(struct s3c_fb *sfb, int win)
{
void __iomem *regs = sfb->regs;
u32 reg;

writel(0, regs + sfb->variant.wincon + (win * 4));
writel(0, regs + VIDOSD_A(win, sfb->variant));
writel(0, regs + VIDOSD_B(win, sfb->variant));
writel(0, regs + VIDOSD_C(win, sfb->variant));
reg = readl(regs + SHADOWCON);
writel(reg & ~SHADOWCON_WINx_PROTECT(win), regs + SHADOWCON);
}

static int __devinit s3c_fb_probe(struct platform_device *pdev)
Expand Down

0 comments on commit a8bdabc

Please sign in to comment.