From patchwork Tue Oct 30 16:10:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1671011 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 32C313FD2B for ; Tue, 30 Oct 2012 16:10:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933972Ab2J3QKj (ORCPT ); Tue, 30 Oct 2012 12:10:39 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:56391 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933955Ab2J3QKi (ORCPT ); Tue, 30 Oct 2012 12:10:38 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id q9UGAcUh019862; Tue, 30 Oct 2012 11:10:38 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9UGAcGC031900; Tue, 30 Oct 2012 11:10:38 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Tue, 30 Oct 2012 11:10:38 -0500 Received: from deskari.tieu.ti.com (h68-16.vpn.ti.com [172.24.68.16]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9UGAHb2009116; Tue, 30 Oct 2012 11:10:36 -0500 From: Tomi Valkeinen To: , , CC: , Tomi Valkeinen Subject: [PATCH 11/12] OMAPDSS: DPI: verify if DSI PLL is operational Date: Tue, 30 Oct 2012 18:10:08 +0200 Message-ID: <1351613409-21186-12-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1351613409-21186-1-git-send-email-tomi.valkeinen@ti.com> References: <1351613409-21186-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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 --- drivers/video/omap2/dss/dpi.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index fc1ec7d..267caf0 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;