From patchwork Thu Nov 15 15:58:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1750121 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 94361DF2AB for ; Thu, 15 Nov 2012 15:59:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1768198Ab2KOP7V (ORCPT ); Thu, 15 Nov 2012 10:59:21 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:52162 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1768125Ab2KOP7Q (ORCPT ); Thu, 15 Nov 2012 10:59:16 -0500 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id qAFFxGib003766; Thu, 15 Nov 2012 09:59:16 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id qAFFxG7U029588; Thu, 15 Nov 2012 09:59:16 -0600 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Thu, 15 Nov 2012 09:59:16 -0600 Received: from deskari.tieu.ti.com (h68-10.vpn.ti.com [172.24.68.10]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id qAFFx6v2025421; Thu, 15 Nov 2012 09:59:14 -0600 From: Tomi Valkeinen To: Archit Taneja , Rob Clark CC: , , Tomi Valkeinen Subject: [PATCH 05/32] OMAPDSS: DISPC: use get_framedone_irq in disable_digit_out Date: Thu, 15 Nov 2012 17:58:13 +0200 Message-ID: <1352995120-3288-6-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1352995120-3288-1-git-send-email-tomi.valkeinen@ti.com> References: <1352995120-3288-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 dispc_mgr_disable_digit_out() needs to wait until the DIGIT output is turned off. This is done with either VSYNC irq on OMAP2/3 and FRAMEDONETV on OMAP4+. It currently uses a rather hacky way to decide what irq to use. This patch changes dispc_mgr_disable_digit_out to use dispc_mgr_get_framedone_irq to find out if there's framedone irq on this SoC, and if not, uses VSYNC. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dispc.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 2ec6470..0972bd3 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -2726,7 +2726,6 @@ static void dispc_mgr_enable_digit_out(void) static void dispc_mgr_disable_digit_out(void) { DECLARE_COMPLETION_ONSTACK(framedone_compl); - enum dss_hdmi_venc_clk_source_select src; int r, i; u32 irq_mask; int num_irqs; @@ -2734,18 +2733,20 @@ static void dispc_mgr_disable_digit_out(void) if (dispc_mgr_is_enabled(OMAP_DSS_CHANNEL_DIGIT) == false) return; - src = dss_get_hdmi_venc_clk_source(); - /* * When we disable the digit output, we need to wait for FRAMEDONE to - * know that DISPC has finished with the output. For analog tv out we'll - * use vsync, as omap2/3 don't have framedone for TV. + * know that DISPC has finished with the output. */ - if (src == DSS_HDMI_M_PCLK) { - irq_mask = DISPC_IRQ_FRAMEDONETV; - num_irqs = 1; - } else { + irq_mask = dispc_mgr_get_framedone_irq(OMAP_DSS_CHANNEL_DIGIT); + num_irqs = 1; + + if (!irq_mask) { + /* + * omap 2/3 don't have framedone irq for TV, so we need to use + * vsyncs for this. + */ + irq_mask = dispc_mgr_get_vsync_irq(OMAP_DSS_CHANNEL_DIGIT); /* * We need to wait for both even and odd vsyncs. Note that this