aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2014-08-06 06:31:47 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-11-12 06:40:20 -0500
commit1a7f4bf186e6e629d8cb3226be4b9fbb48c812b8 (patch)
treeb6aaf6daca5a1cf1f5d5f53fbad39d7a6cd60151 /drivers/video
parentd845600e2f693b3020fa779d2dc1a0767718eebc (diff)
OMAPDSS: DSI: always power on hsclk & hsdiv
The DSS PLL has support to power on the PLL's highspeed clock output and HSDIV output separately. In practice both need to powered on, as in most OMAP's that's the only working configuration. We already do that in dsi_pll_init(), by overriding the passed arguments so that both are always powered. Simplify the code by removing the support for choosing which outputs to power on. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/omap2/dss/dpi.c4
-rw-r--r--drivers/video/fbdev/omap2/dss/dsi.c23
-rw-r--r--drivers/video/fbdev/omap2/dss/dss.h6
3 files changed, 7 insertions, 26 deletions
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
index ebc294f8dfdb..aa095c4927ec 100644
--- a/drivers/video/fbdev/omap2/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/dss/dpi.c
@@ -405,7 +405,7 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
405 if (r) 405 if (r)
406 goto err_get_dsi; 406 goto err_get_dsi;
407 407
408 r = dsi_pll_init(dpi->dsidev, 0, 1); 408 r = dsi_pll_init(dpi->dsidev);
409 if (r) 409 if (r)
410 goto err_dsi_pll_init; 410 goto err_dsi_pll_init;
411 } 411 }
@@ -557,7 +557,7 @@ static int dpi_verify_dsi_pll(struct platform_device *dsidev)
557 if (r) 557 if (r)
558 return r; 558 return r;
559 559
560 r = dsi_pll_init(dsidev, 0, 1); 560 r = dsi_pll_init(dsidev);
561 if (r) { 561 if (r) {
562 dsi_runtime_put(dsidev); 562 dsi_runtime_put(dsidev);
563 return r; 563 return r;
diff --git a/drivers/video/fbdev/omap2/dss/dsi.c b/drivers/video/fbdev/omap2/dss/dsi.c
index b7acdcd76f73..0083f6500949 100644
--- a/drivers/video/fbdev/omap2/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/dss/dsi.c
@@ -1672,21 +1672,13 @@ err:
1672 return r; 1672 return r;
1673} 1673}
1674 1674
1675int dsi_pll_init(struct platform_device *dsidev, bool enable_hsclk, 1675int dsi_pll_init(struct platform_device *dsidev)
1676 bool enable_hsdiv)
1677{ 1676{
1678 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 1677 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
1679 int r = 0; 1678 int r = 0;
1680 enum dsi_pll_power_state pwstate;
1681 1679
1682 DSSDBG("PLL init\n"); 1680 DSSDBG("PLL init\n");
1683 1681
1684 /*
1685 * It seems that on many OMAPs we need to enable both to have a
1686 * functional HSDivider.
1687 */
1688 enable_hsclk = enable_hsdiv = true;
1689
1690 r = dsi_regulator_init(dsidev); 1682 r = dsi_regulator_init(dsidev);
1691 if (r) 1683 if (r)
1692 return r; 1684 return r;
@@ -1718,16 +1710,7 @@ int dsi_pll_init(struct platform_device *dsidev, bool enable_hsclk,
1718 * fill the whole display. No idea about this */ 1710 * fill the whole display. No idea about this */
1719 dispc_pck_free_enable(0); 1711 dispc_pck_free_enable(0);
1720 1712
1721 if (enable_hsclk && enable_hsdiv) 1713 r = dsi_pll_power(dsidev, DSI_PLL_POWER_ON_ALL);
1722 pwstate = DSI_PLL_POWER_ON_ALL;
1723 else if (enable_hsclk)
1724 pwstate = DSI_PLL_POWER_ON_HSCLK;
1725 else if (enable_hsdiv)
1726 pwstate = DSI_PLL_POWER_ON_DIV;
1727 else
1728 pwstate = DSI_PLL_POWER_OFF;
1729
1730 r = dsi_pll_power(dsidev, pwstate);
1731 1714
1732 if (r) 1715 if (r)
1733 goto err1; 1716 goto err1;
@@ -4487,7 +4470,7 @@ static int dsi_display_init_dsi(struct platform_device *dsidev)
4487 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 4470 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
4488 int r; 4471 int r;
4489 4472
4490 r = dsi_pll_init(dsidev, true, true); 4473 r = dsi_pll_init(dsidev);
4491 if (r) 4474 if (r)
4492 goto err0; 4475 goto err0;
4493 4476
diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h
index 4617b4d9f78d..2defcaedbef5 100644
--- a/drivers/video/fbdev/omap2/dss/dss.h
+++ b/drivers/video/fbdev/omap2/dss/dss.h
@@ -296,8 +296,7 @@ bool dsi_pll_calc(struct platform_device *dsidev, unsigned long clkin,
296unsigned long dsi_get_pll_hsdiv_dispc_rate(struct platform_device *dsidev); 296unsigned long dsi_get_pll_hsdiv_dispc_rate(struct platform_device *dsidev);
297int dsi_pll_set_clock_div(struct platform_device *dsidev, 297int dsi_pll_set_clock_div(struct platform_device *dsidev,
298 struct dsi_clock_info *cinfo); 298 struct dsi_clock_info *cinfo);
299int dsi_pll_init(struct platform_device *dsidev, bool enable_hsclk, 299int dsi_pll_init(struct platform_device *dsidev);
300 bool enable_hsdiv);
301void dsi_pll_uninit(struct platform_device *dsidev, bool disconnect_lanes); 300void dsi_pll_uninit(struct platform_device *dsidev, bool disconnect_lanes);
302struct platform_device *dsi_get_dsidev_from_id(int module); 301struct platform_device *dsi_get_dsidev_from_id(int module);
303#else 302#else
@@ -324,8 +323,7 @@ static inline int dsi_pll_set_clock_div(struct platform_device *dsidev,
324 WARN("%s: DSI not compiled in\n", __func__); 323 WARN("%s: DSI not compiled in\n", __func__);
325 return -ENODEV; 324 return -ENODEV;
326} 325}
327static inline int dsi_pll_init(struct platform_device *dsidev, 326static inline int dsi_pll_init(struct platform_device *dsidev)
328 bool enable_hsclk, bool enable_hsdiv)
329{ 327{
330 WARN("%s: DSI not compiled in\n", __func__); 328 WARN("%s: DSI not compiled in\n", __func__);
331 return -ENODEV; 329 return -ENODEV;