blob: aad35a8cab5ed2d0e6de44b595ddf5bb588daf0b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
From 61d28fa28e8249fea4d28589346eb68b022ccbfe Mon Sep 17 00:00:00 2001
From: Nicolas Ferre <nicolas.ferre@atmel.com>
Date: Fri, 24 Jun 2011 13:03:29 +0200
Subject: atmel_lcdfb: change pixel clock ratio calculation
DIV_ROUND_UP() was used to calculate the pixel clock divider
in atmel_hlcdfb_setup_core_base().
But this rounding was producing a bigger divider each time it was called.
We replace by DIV_ROUND_CLOSEST() to calculate it.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
drivers/video/atmel_hlcdfb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/atmel_hlcdfb.c b/drivers/video/atmel_hlcdfb.c
index c4c4559..a629dda 100644
--- a/drivers/video/atmel_hlcdfb.c
+++ b/drivers/video/atmel_hlcdfb.c
@@ -247,7 +247,7 @@ static int atmel_hlcdfb_setup_core_base(struct fb_info *info)
/* Set pixel clock */
clk_value_khz = clk_get_rate(sinfo->lcdc_clk) / 1000;
- value = DIV_ROUND_UP(clk_value_khz, PICOS2KHZ(info->var.pixclock));
+ value = DIV_ROUND_CLOSEST(clk_value_khz, PICOS2KHZ(info->var.pixclock));
if (value < 1) {
dev_notice(info->device, "using system clock as pixel clock\n");
--
1.8.0.197.g5a90748
|