From: Afzal Mohammed Date: Mon, 5 Aug 2013 22:02:28 +0000 (-0500) Subject: video: da8xx-fb: report correct pixclock X-Git-Tag: firefly_0821_release~176^2~5425^2~13^2~11 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=404fdfe7f428c6425a13e96d0b56537eb67e08c5;p=firefly-linux-kernel-4.4.55.git video: da8xx-fb: report correct pixclock Update "var" pixclock with the value that is configurable in hardware. This lets user know the actual pixclock. Signed-off-by: Afzal Mohammed Signed-off-by: Darren Etheridge Signed-off-by: Tomi Valkeinen --- diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index 7db109733fa1..8d737305a43b 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c @@ -686,6 +686,15 @@ static inline unsigned da8xx_fb_calc_clk_divider(struct da8xx_fb_par *par, return par->lcd_fck_rate / (PICOS2KHZ(pixclock) * 1000); } +static inline unsigned da8xx_fb_round_clk(struct da8xx_fb_par *par, + unsigned pixclock) +{ + unsigned div; + + div = da8xx_fb_calc_clk_divider(par, pixclock); + return KHZ2PICOS(par->lcd_fck_rate / (1000 * div)); +} + static inline void da8xx_fb_config_clk_divider(unsigned div) { /* Configure the LCD clock divisor. */ @@ -962,6 +971,8 @@ static int fb_check_var(struct fb_var_screeninfo *var, if (var->yres + var->yoffset > var->yres_virtual) var->yoffset = var->yres_virtual - var->yres; + var->pixclock = da8xx_fb_round_clk(par, var->pixclock); + return err; }