aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/da8xx-fb.c
diff options
context:
space:
mode:
authorAfzal Mohammed <afzal@ti.com>2013-08-05 18:02:28 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-08-09 07:02:42 -0400
commit404fdfe7f428c6425a13e96d0b56537eb67e08c5 (patch)
tree3403cdefbef0def642ca1f2c46cc3b32e6666919 /drivers/video/da8xx-fb.c
parentdbe8e48a3c70531b3befb11035dec30aec48c450 (diff)
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 <afzal@ti.com> Signed-off-by: Darren Etheridge <detheridge@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/da8xx-fb.c')
-rw-r--r--drivers/video/da8xx-fb.c11
1 files changed, 11 insertions, 0 deletions
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,
686 return par->lcd_fck_rate / (PICOS2KHZ(pixclock) * 1000); 686 return par->lcd_fck_rate / (PICOS2KHZ(pixclock) * 1000);
687} 687}
688 688
689static inline unsigned da8xx_fb_round_clk(struct da8xx_fb_par *par,
690 unsigned pixclock)
691{
692 unsigned div;
693
694 div = da8xx_fb_calc_clk_divider(par, pixclock);
695 return KHZ2PICOS(par->lcd_fck_rate / (1000 * div));
696}
697
689static inline void da8xx_fb_config_clk_divider(unsigned div) 698static inline void da8xx_fb_config_clk_divider(unsigned div)
690{ 699{
691 /* Configure the LCD clock divisor. */ 700 /* Configure the LCD clock divisor. */
@@ -962,6 +971,8 @@ static int fb_check_var(struct fb_var_screeninfo *var,
962 if (var->yres + var->yoffset > var->yres_virtual) 971 if (var->yres + var->yoffset > var->yres_virtual)
963 var->yoffset = var->yres_virtual - var->yres; 972 var->yoffset = var->yres_virtual - var->yres;
964 973
974 var->pixclock = da8xx_fb_round_clk(par, var->pixclock);
975
965 return err; 976 return err;
966} 977}
967 978