From patchwork Wed Sep 19 08:30:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1476361 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 226BC3FE4F for ; Wed, 19 Sep 2012 08:32:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755233Ab2ISIbx (ORCPT ); Wed, 19 Sep 2012 04:31:53 -0400 Received: from na3sys009aog120.obsmtp.com ([74.125.149.140]:33929 "EHLO na3sys009aog120.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753969Ab2ISIbO (ORCPT ); Wed, 19 Sep 2012 04:31:14 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]) (using TLSv1) by na3sys009aob120.postini.com ([74.125.148.12]) with SMTP ID DSNKUFmC0TBJatzzqEbNmrA6brvdv6OOT53b@postini.com; Wed, 19 Sep 2012 01:31:14 PDT Received: by lbbgj3 with SMTP id gj3so618973lbb.19 for ; Wed, 19 Sep 2012 01:31:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=+66GFyfMDFDSaELZwBgRbYZidqJB8w84YFDNUNhh/Js=; b=Bz+vnGLnDNw9qAeEzXdWuT21FAB5qqW/gizZqLvFY/4MNWlvfTW5A/5YdvZS5YPEEH Bcp5p0mJNsUytdudEilhOT1QNZAn8ea1kwB8xt+XfSOgopV6HrCviqQdFpZaqzdUSeFx JDSIhcyucKPXB+/9X0CZ+aGfp52N5imaNIKLfBdho09qNbH6+YDp8B1vCz002SLtLW4M XmEmS3YJ4cqfl5t8uqbslU0pm6WTk/DY5p/ri7kbJnAuHN5n9zYeoCIf4uQGypBVQC5g QCrM28np0cDNiwG45Qd5TUH/3lQcxmJAZnmkybvcZLvBQAzLHd2oFmabGd2d/Wt8/ngF wTgQ== Received: by 10.112.26.99 with SMTP id k3mr809300lbg.9.1348043472133; Wed, 19 Sep 2012 01:31:12 -0700 (PDT) Received: from localhost.localdomain (a91-156-160-115.elisa-laajakaista.fi. [91.156.160.115]) by mx.google.com with ESMTPS id r8sm589958lba.15.2012.09.19.01.31.10 (version=SSLv3 cipher=OTHER); Wed, 19 Sep 2012 01:31:11 -0700 (PDT) From: Tomi Valkeinen To: archit@ti.com, linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: Tomi Valkeinen Subject: [PATCH 6/8] OMAPDSS: cleanup dss_recheck_connections Date: Wed, 19 Sep 2012 11:30:36 +0300 Message-Id: <1348043438-2624-7-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1348043438-2624-1-git-send-email-tomi.valkeinen@ti.com> References: <1348043438-2624-1-git-send-email-tomi.valkeinen@ti.com> X-Gm-Message-State: ALoCoQnt9MLqkMr6maqSlvSPRHd9TDHoys1E+HDySicnaUMokEiJtg6UHwUbKKF3bzzC0Wl4RQOA Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org dss_recheck_connections is quite a mess. With the previous commit that initializes the channel field for HDMI and VENC displays, we can greatly simplify the dss_recheck_connections. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/overlay.c | 49 +++++-------------------------------- 1 file changed, 6 insertions(+), 43 deletions(-) diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c index e3d4068..1bf05ef 100644 --- a/drivers/video/omap2/dss/overlay.c +++ b/drivers/video/omap2/dss/overlay.c @@ -109,52 +109,15 @@ void dss_init_overlays(struct platform_device *pdev) * selected, connect always. */ void dss_recheck_connections(struct omap_dss_device *dssdev, bool force) { - int i; - struct omap_overlay_manager *lcd_mgr; - struct omap_overlay_manager *tv_mgr; - struct omap_overlay_manager *lcd2_mgr = NULL; - struct omap_overlay_manager *lcd3_mgr = NULL; struct omap_overlay_manager *mgr = NULL; + int i; - lcd_mgr = omap_dss_get_overlay_manager(OMAP_DSS_CHANNEL_LCD); - tv_mgr = omap_dss_get_overlay_manager(OMAP_DSS_CHANNEL_DIGIT); - if (dss_has_feature(FEAT_MGR_LCD3)) - lcd3_mgr = omap_dss_get_overlay_manager(OMAP_DSS_CHANNEL_LCD3); - if (dss_has_feature(FEAT_MGR_LCD2)) - lcd2_mgr = omap_dss_get_overlay_manager(OMAP_DSS_CHANNEL_LCD2); - - if (dssdev->channel == OMAP_DSS_CHANNEL_LCD3) { - if (!lcd3_mgr->device || force) { - if (lcd3_mgr->device) - lcd3_mgr->unset_device(lcd3_mgr); - lcd3_mgr->set_device(lcd3_mgr, dssdev); - mgr = lcd3_mgr; - } - } else if (dssdev->channel == OMAP_DSS_CHANNEL_LCD2) { - if (!lcd2_mgr->device || force) { - if (lcd2_mgr->device) - lcd2_mgr->unset_device(lcd2_mgr); - lcd2_mgr->set_device(lcd2_mgr, dssdev); - mgr = lcd2_mgr; - } - } else if (dssdev->type != OMAP_DISPLAY_TYPE_VENC - && dssdev->type != OMAP_DISPLAY_TYPE_HDMI) { - if (!lcd_mgr->device || force) { - if (lcd_mgr->device) - lcd_mgr->unset_device(lcd_mgr); - lcd_mgr->set_device(lcd_mgr, dssdev); - mgr = lcd_mgr; - } - } + mgr = omap_dss_get_overlay_manager(dssdev->channel); - if (dssdev->type == OMAP_DISPLAY_TYPE_VENC - || dssdev->type == OMAP_DISPLAY_TYPE_HDMI) { - if (!tv_mgr->device || force) { - if (tv_mgr->device) - tv_mgr->unset_device(tv_mgr); - tv_mgr->set_device(tv_mgr, dssdev); - mgr = tv_mgr; - } + if (!mgr->device || force) { + if (mgr->device) + mgr->unset_device(mgr); + mgr->set_device(mgr, dssdev); } if (mgr) {