summaryrefslogtreecommitdiffstats
path: root/drivers/video/s3c-fb.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-06-16 16:59:05 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-06-16 16:59:05 -0700
commit88c144b12a943d35500dbfc141c9b33955d2a88a (patch)
tree5dd943ac3dd80d2c8e7f1af468314468dba541cd /drivers/video/s3c-fb.c
parent9b15b817f3d62409290fd56fe3cbb076a931bb0a (diff)
parentb67989515defba7412acff01162e5bb1f0f5923a (diff)
Merge tag 'fbdev-fixes-for-3.5-1' of git://github.com/schandinat/linux-2.6
Pull fbdev fixes from Florian Tobias Schandinat: - two fixes for s3c-fb by Jingoo Han (including a fix for a potential division by zero) - a couple of randconfig fixes by Arnd Bergmann - a cleanup for bfin_adv7393fb by Emil Goode * tag 'fbdev-fixes-for-3.5-1' of git://github.com/schandinat/linux-2.6: video: s3c-fb: fix possible division by zero in s3c_fb_calc_pixclk video: s3c-fb: clear SHADOWCON register when clearing hardware window registers drivers/tosa: driver needs I2C and SPI to compile drivers/savagefb: use mdelay instead of udelay video/console: automatically select a font video/ili9320: do not mark exported functions __devexit drivers/video: use correct __devexit_p annotation video: bfin_adv7393fb: Convert to kstrtouint_from_user
Diffstat (limited to 'drivers/video/s3c-fb.c')
-rw-r--r--drivers/video/s3c-fb.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 5f9d8e69029..ea7b661e722 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -361,7 +361,7 @@ static int s3c_fb_calc_pixclk(struct s3c_fb *sfb, unsigned int pixclk)
result = (unsigned int)tmp / 1000;
dev_dbg(sfb->dev, "pixclk=%u, clk=%lu, div=%d (%lu)\n",
- pixclk, clk, result, clk / result);
+ pixclk, clk, result, result ? clk / result : clk);
return result;
}
@@ -1348,8 +1348,14 @@ static void s3c_fb_clear_win(struct s3c_fb *sfb, int win)
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);
+
+ if (sfb->variant.has_shadowcon) {
+ reg = readl(sfb->regs + SHADOWCON);
+ reg &= ~(SHADOWCON_WINx_PROTECT(win) |
+ SHADOWCON_CHx_ENABLE(win) |
+ SHADOWCON_CHx_LOCAL_ENABLE(win));
+ writel(reg, sfb->regs + SHADOWCON);
+ }
}
static int __devinit s3c_fb_probe(struct platform_device *pdev)