diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-10-30 12:57:43 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-11-05 11:17:39 +0200 |
commit | 6061675b3fc83d8d190b87b54f04f0c89f605149 (patch) | |
tree | 84208b5c7ff24e1f7b812d3f06d43ed9bca2f294 /drivers/video/omap2 | |
parent | 8a3db406f5046dd14dff0e78cea0ba03efec3668 (diff) | |
download | linux-6061675b3fc83d8d190b87b54f04f0c89f605149.tar.gz linux-6061675b3fc83d8d190b87b54f04f0c89f605149.tar.bz2 linux-6061675b3fc83d8d190b87b54f04f0c89f605149.zip |
OMAPDSS: DPI: verify if DSI PLL is operational
The SoCs that have DSI module should have a working DSI PLL. However,
some rare boards have not connected the powers to the DSI PLL.
This patch adds a function that tries to power up the DSI PLL, and
reports if that doesn't succeed. DPI uses this function to fall back to
PRCM clocks if DSI PLL doesn't work.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r-- | drivers/video/omap2/dss/dpi.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index ca5f49c44ece..6baeb04e60cc 100644 --- a/drivers/video/omap2/dss/dpi.c +++ b/drivers/video/omap2/dss/dpi.c @@ -361,6 +361,28 @@ void omapdss_dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines) } EXPORT_SYMBOL(omapdss_dpi_set_data_lines); +static int __init dpi_verify_dsi_pll(struct platform_device *dsidev) +{ + int r; + + /* do initial setup with the PLL to see if it is operational */ + + r = dsi_runtime_get(dsidev); + if (r) + return r; + + r = dsi_pll_init(dsidev, 0, 1); + if (r) { + dsi_runtime_put(dsidev); + return r; + } + + dsi_pll_uninit(dsidev, true); + dsi_runtime_put(dsidev); + + return 0; +} + static int __init dpi_init_display(struct omap_dss_device *dssdev) { DSSDBG("init_display\n"); @@ -383,6 +405,11 @@ static int __init dpi_init_display(struct omap_dss_device *dssdev) enum omap_dss_clk_source dispc_fclk_src = dssdev->clocks.dispc.dispc_fclk_src; dpi.dsidev = dpi_get_dsidev(dispc_fclk_src); + + if (dpi_verify_dsi_pll(dpi.dsidev)) { + dpi.dsidev = NULL; + DSSWARN("DSI PLL not operational\n"); + } } return 0; |