summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorFancy Fang <chen.fang@nxp.com>2017-10-20 18:44:23 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commitded381907a41ae46667d8d38d8655436e84d765c (patch)
treed11c3e0db13c0d5171fb37f4e4316683f425a248 /drivers/video
parentf855bb60c15aa3b967052ba5750f2da22857565d (diff)
MLK-16706-1 video: fbdev: mipi_dsi_northwest: replace 'PICOS2KHZ' by 'PICOS2KHZ2'
The 'PICOS2KHZ' macro is used to get pixel clock frequency from 'pixclock' value to derive the required mipi phy bit clock frequency. But the result precision get from this macro is not good enough in some cases. The patch defines an new improved macro 'PICOS2KHZ2' to replace 'PICOS2KHZ'. Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/mxc/mipi_dsi_northwest.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/video/fbdev/mxc/mipi_dsi_northwest.c b/drivers/video/fbdev/mxc/mipi_dsi_northwest.c
index cb7067e63a67..2a22f6b9c6a8 100644
--- a/drivers/video/fbdev/mxc/mipi_dsi_northwest.c
+++ b/drivers/video/fbdev/mxc/mipi_dsi_northwest.c
@@ -51,6 +51,9 @@
#define NS2PS_RATIO (1000)
#define MIPI_LCD_SLEEP_MODE_DELAY (120)
#define MIPI_FIFO_TIMEOUT msecs_to_jiffies(250)
+#define PICOS_PER_SEC (1000000000UL)
+#define PICOS2KHZ2(a, bpp) \
+ DIV_ROUND_CLOSEST(PICOS_PER_SEC * (bpp), (a))
static struct mipi_dsi_match_lcd mipi_dsi_lcd_db[] = {
#ifdef CONFIG_FB_MXC_TRULY_WVGA_SYNC_PANEL
@@ -300,7 +303,8 @@ static int mipi_dsi_dphy_init(struct mipi_dsi_info *mipi_dsi)
#endif
bpp = fmt_to_bpp(lcd_config->dpi_fmt);
- req_bit_clk = PICOS2KHZ(mode->pixclock) * bpp * 1000U;
+ req_bit_clk = PICOS2KHZ2(mode->pixclock, bpp) * 1000U;
+
switch (lcd_config->data_lane_num) {
case 1:
break;