aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Osciak <p.osciak@samsung.com>2010-08-10 21:02:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-11 11:59:12 -0400
commita8bdabca3ad69de632bd13f1cb65639e9a556e20 (patch)
treee29b458eeeec1af2d8ed87a601f85626c9165076
parentf676ec2a3526465dfa7b5c513a0c2bb22fb70b80 (diff)
s3c-fb: protect window-specific registers during updates
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>
-rw-r--r--drivers/video/s3c-fb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 2173869afb49..b10d16dc0335 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -450,6 +450,8 @@ static int s3c_fb_set_par(struct fb_info *info)
450 450
451 dev_dbg(sfb->dev, "setting framebuffer parameters\n"); 451 dev_dbg(sfb->dev, "setting framebuffer parameters\n");
452 452
453 shadow_protect_win(win, 1);
454
453 switch (var->bits_per_pixel) { 455 switch (var->bits_per_pixel) {
454 case 32: 456 case 32:
455 case 24: 457 case 24:
@@ -632,6 +634,8 @@ static int s3c_fb_set_par(struct fb_info *info)
632 writel(data, regs + sfb->variant.wincon + (win_no * 4)); 634 writel(data, regs + sfb->variant.wincon + (win_no * 4));
633 writel(0x0, regs + sfb->variant.winmap + (win_no * 4)); 635 writel(0x0, regs + sfb->variant.winmap + (win_no * 4));
634 636
637 shadow_protect_win(win, 0);
638
635 return 0; 639 return 0;
636} 640}
637 641
@@ -1228,11 +1232,14 @@ static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
1228static void s3c_fb_clear_win(struct s3c_fb *sfb, int win) 1232static void s3c_fb_clear_win(struct s3c_fb *sfb, int win)
1229{ 1233{
1230 void __iomem *regs = sfb->regs; 1234 void __iomem *regs = sfb->regs;
1235 u32 reg;
1231 1236
1232 writel(0, regs + sfb->variant.wincon + (win * 4)); 1237 writel(0, regs + sfb->variant.wincon + (win * 4));
1233 writel(0, regs + VIDOSD_A(win, sfb->variant)); 1238 writel(0, regs + VIDOSD_A(win, sfb->variant));
1234 writel(0, regs + VIDOSD_B(win, sfb->variant)); 1239 writel(0, regs + VIDOSD_B(win, sfb->variant));
1235 writel(0, regs + VIDOSD_C(win, sfb->variant)); 1240 writel(0, regs + VIDOSD_C(win, sfb->variant));
1241 reg = readl(regs + SHADOWCON);
1242 writel(reg & ~SHADOWCON_WINx_PROTECT(win), regs + SHADOWCON);
1236} 1243}
1237 1244
1238static int __devinit s3c_fb_probe(struct platform_device *pdev) 1245static int __devinit s3c_fb_probe(struct platform_device *pdev)