aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2014-08-04 06:46:05 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-11-12 06:40:19 -0500
commit544bfb6832640d9d05dafc7d56f245bfa7ed6102 (patch)
tree23cfd7432bb71577ea168b888cbb619bdfaf30b1 /drivers/video
parent064c2a475d67b4872df738a90710888c364f9767 (diff)
OMAPDSS: DSI: wait for hsdiv clocks when enabling PLL
At the moment we have two functions to wait for the HSDIV clocks to get active, dsi_wait_pll_hsdiv_dispc_active and dsi_wait_pll_hsdiv_dsi_active. Instead of such inconvenient functions, let's just make sure that the hsdiv clocks are active after the pll has been enabled. This patch adds code to dsi_pll_set_clock_div() to wait until HSDIV clocks are active. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/omap2/dss/dsi.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/video/fbdev/omap2/dss/dsi.c b/drivers/video/fbdev/omap2/dss/dsi.c
index 0793bc67a275..fe8196b17a5e 100644
--- a/drivers/video/fbdev/omap2/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/dss/dsi.c
@@ -1514,6 +1514,20 @@ static void dsi_pll_calc_dsi_fck(struct dsi_clock_info *cinfo)
1514 cinfo->dsi_pll_hsdiv_dsi_clk = cinfo->clkin4ddr / cinfo->regm_dsi; 1514 cinfo->dsi_pll_hsdiv_dsi_clk = cinfo->clkin4ddr / cinfo->regm_dsi;
1515} 1515}
1516 1516
1517static int dsi_wait_hsdiv_ack(struct platform_device *dsidev, u32 hsdiv_ack_mask)
1518{
1519 int t = 100;
1520
1521 while (t-- > 0) {
1522 u32 v = dsi_read_reg(dsidev, DSI_PLL_STATUS);
1523 v &= hsdiv_ack_mask;
1524 if (v == hsdiv_ack_mask)
1525 return 0;
1526 }
1527
1528 return -ETIMEDOUT;
1529}
1530
1517int dsi_pll_set_clock_div(struct platform_device *dsidev, 1531int dsi_pll_set_clock_div(struct platform_device *dsidev,
1518 struct dsi_clock_info *cinfo) 1532 struct dsi_clock_info *cinfo)
1519{ 1533{
@@ -1646,6 +1660,13 @@ int dsi_pll_set_clock_div(struct platform_device *dsidev,
1646 l = FLD_MOD(l, 0, 20, 20); /* DSI_HSDIVBYPASS */ 1660 l = FLD_MOD(l, 0, 20, 20); /* DSI_HSDIVBYPASS */
1647 dsi_write_reg(dsidev, DSI_PLL_CONFIGURATION2, l); 1661 dsi_write_reg(dsidev, DSI_PLL_CONFIGURATION2, l);
1648 1662
1663 r = dsi_wait_hsdiv_ack(dsidev, BIT(7) | BIT(8));
1664 if (r) {
1665 DSSERR("failed to enable HSDIV clocks: %d\n", r);
1666 goto err;
1667 }
1668
1669
1649 DSSDBG("PLL config done\n"); 1670 DSSDBG("PLL config done\n");
1650err: 1671err:
1651 return r; 1672 return r;