From patchwork Wed Oct 6 11:14:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Senthilvadivu Guruswamy X-Patchwork-Id: 235791 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o96BFmsI017482 for ; Wed, 6 Oct 2010 11:16:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758893Ab0JFLPj (ORCPT ); Wed, 6 Oct 2010 07:15:39 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:32917 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758885Ab0JFLPW (ORCPT ); Wed, 6 Oct 2010 07:15:22 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o96BFEDB002678 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Oct 2010 06:15:16 -0500 Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id o96BFDqS029570; Wed, 6 Oct 2010 16:45:13 +0530 (IST) Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by linfarm476.india.ti.com (8.12.11/8.12.11) with ESMTP id o96BFCcv010463; Wed, 6 Oct 2010 16:45:12 +0530 Received: (from a0876342@localhost) by linfarm476.india.ti.com (8.12.11/8.12.11/Submit) id o96BFCP9010461; Wed, 6 Oct 2010 16:45:12 +0530 From: Guruswamy Senthilvadivu To: khilman@deeprootsystems.com, tomi.valkeinen@nokia.com, paul@pwsan.com, hvaibhav@ti.com, linux-omap@vger.kernel.org Cc: Senthilvadivu Guruswamy Subject: [PATCH v1 10/16] OMAP3: hwmod DSS: DSS Move init,exit to driver Date: Wed, 6 Oct 2010 16:44:53 +0530 Message-Id: <1286363699-9614-11-git-send-email-svadivu@ti.com> X-Mailer: git-send-email 1.5.6.6 In-Reply-To: <1286363699-9614-10-git-send-email-svadivu@ti.com> References: <1286363699-9614-1-git-send-email-svadivu@ti.com> <1286363699-9614-2-git-send-email-svadivu@ti.com> <1286363699-9614-3-git-send-email-svadivu@ti.com> <1286363699-9614-4-git-send-email-svadivu@ti.com> <1286363699-9614-5-git-send-email-svadivu@ti.com> <1286363699-9614-6-git-send-email-svadivu@ti.com> <1286363699-9614-7-git-send-email-svadivu@ti.com> <1286363699-9614-8-git-send-email-svadivu@ti.com> <1286363699-9614-9-git-send-email-svadivu@ti.com> <1286363699-9614-10-git-send-email-svadivu@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 06 Oct 2010 11:16:03 +0000 (UTC) diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index ce5240f..54fe333 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -193,18 +193,6 @@ static int omap_dss_probe(struct platform_device *pdev) dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1 | DSS_CLK_54M); -#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT - /* DISPC_CONTROL */ - if (omap_readl(0x48050440) & 1) /* LCD enabled? */ - skip_init = 1; -#endif - - r = dss_init(skip_init); - if (r) { - DSSERR("Failed to initialize DSS\n"); - goto err_dss; - } - r = rfbi_init(); if (r) { DSSERR("Failed to initialize rfbi\n"); @@ -286,8 +274,6 @@ err_dispc: err_dpi: rfbi_exit(); err_rfbi: - dss_exit(); -err_dss: return r; } @@ -308,8 +294,6 @@ static int omap_dss_remove(struct platform_device *pdev) sdi_exit(); } - dss_exit(); - dss_uninit_overlays(pdev); dss_uninit_overlay_managers(pdev); diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c index fba8bcd..b93b118 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c @@ -410,6 +410,7 @@ void dss_debug_dump_clocks(struct seq_file *s) static int omap_dsshw_probe(struct platform_device *pdev) { int r; + int skip_init = 0; dss.pdev = pdev; @@ -422,6 +423,19 @@ static int omap_dsshw_probe(struct platform_device *pdev) dss.ctx_id = dss_get_ctx_id(); DSSDBG("initial ctx id %u\n", dss.ctx_id); +#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT + /* DISPC_CONTROL */ + if (omap_readl(0x48050440) & 1) /* LCD enabled? */ + skip_init = 1; +#endif + + r = dss_init(skip_init); + if (r) { + DSSERR("Failed to initialize DSS\n"); + goto err_dss; + } + +err_dss: dss_clk_disable_all_no_ctx(); err_clocks: @@ -432,6 +446,8 @@ static int omap_dsshw_remove(struct platform_device *pdev) { int c; + dss_exit(); + /* these should be removed at some point */ c = dss.dss_ick->usecount; if (c > 0) {