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: 1476371 Return-Path: X-Original-To: patchwork-linux-omap@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 402113FE65 for ; Wed, 19 Sep 2012 08:32:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755268Ab2ISIby (ORCPT ); Wed, 19 Sep 2012 04:31:54 -0400 Received: from na3sys009aog119.obsmtp.com ([74.125.149.246]:36866 "EHLO na3sys009aog119.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753792Ab2ISIbO (ORCPT ); Wed, 19 Sep 2012 04:31:14 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]) (using TLSv1) by na3sys009aob119.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 gj3so618972lbb.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=m76DS6MF6QyZ1cCH+grQNdNtfjHMFa+4LR7TCruq0hrCKbm2PqeSlG5+HwgHc92tLu m3AA2xZCtiS7jKyX9dw8dhFueZbaukRGx0RDt0x1w2PxRY90EOV5wc5wJdU5wdfKDGec D8Pk9ozf0OyIzd4rbkAiA1E0h+a15lLV6dBQXvWlxBUP/tiGxSDq8zb+AMcUU7fGf8dt FPAOtrwADZPH7GTAF2Ok70CCe4qHYeYE4ojNeG+CYFjaOquVgpCj0xNfcvfNLtjbJN7y XIU7uJyfEZ15rMHRSvne6c49PwtphAHxfbeYX2yCIUtkT0dkqT5xapoNSPiUVza2xHlH yfOQ== 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: ALoCoQmL0HDsB5FblAAs93A06pvYyP73GHpFqWjVsY3AqafuSLBMM2i06QtIv/weLIYQfLGaVaRs Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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) {