diff options
author | Ben Dooks <ben@simtec.co.uk> | 2009-09-22 19:47:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:56 -0400 |
commit | 360fa58828784f307c3977d5ff4c8e400f074a56 (patch) | |
tree | 5909f2f112ca2d160cbf5f65ac6776e5f0fd84b5 /drivers/video/s3c2410fb.c | |
parent | 9a4a83d2ed83da0c4b45289ca72f10205aa96589 (diff) |
s3c2410fb: fix clockrate calculation
In the final part of the calculation for the tft display clockrate we
divide the output pf s3c2410fb_calc_pixclk() by 2 which leaves us with a
rounding error if the result is odd.
Change to using DIV_ROUND_UP() to ensure that we always choose a higher
divisor and thus a lower frequency.
Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/s3c2410fb.c')
-rw-r--r-- | drivers/video/s3c2410fb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c index 5ffca2adc6a8..aac661225c78 100644 --- a/drivers/video/s3c2410fb.c +++ b/drivers/video/s3c2410fb.c | |||
@@ -369,7 +369,9 @@ static void s3c2410fb_activate_var(struct fb_info *info) | |||
369 | void __iomem *regs = fbi->io; | 369 | void __iomem *regs = fbi->io; |
370 | int type = fbi->regs.lcdcon1 & S3C2410_LCDCON1_TFT; | 370 | int type = fbi->regs.lcdcon1 & S3C2410_LCDCON1_TFT; |
371 | struct fb_var_screeninfo *var = &info->var; | 371 | struct fb_var_screeninfo *var = &info->var; |
372 | int clkdiv = s3c2410fb_calc_pixclk(fbi, var->pixclock) / 2; | 372 | int clkdiv; |
373 | |||
374 | clkdiv = DIV_ROUND_UP(s3c2410fb_calc_pixclk(fbi, var->pixclock), 2); | ||
373 | 375 | ||
374 | dprintk("%s: var->xres = %d\n", __func__, var->xres); | 376 | dprintk("%s: var->xres = %d\n", __func__, var->xres); |
375 | dprintk("%s: var->yres = %d\n", __func__, var->yres); | 377 | dprintk("%s: var->yres = %d\n", __func__, var->yres); |