From patchwork Wed Aug 31 13:23:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1115992 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7VDMMJ1022786 for ; Wed, 31 Aug 2011 13:23:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755775Ab1HaNXs (ORCPT ); Wed, 31 Aug 2011 09:23:48 -0400 Received: from na3sys009aob106.obsmtp.com ([74.125.149.76]:59363 "EHLO na3sys009aog106.obsmtp.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755757Ab1HaNXo (ORCPT ); Wed, 31 Aug 2011 09:23:44 -0400 Received: from mail-wy0-f177.google.com ([74.125.82.177]) (using TLSv1) by na3sys009aob106.postini.com ([74.125.148.12]) with SMTP ID DSNKTl412qtyamisrqTesA13hN0oDJLnsytj@postini.com; Wed, 31 Aug 2011 06:23:44 PDT Received: by mail-wy0-f177.google.com with SMTP id 11so580259wyh.36 for ; Wed, 31 Aug 2011 06:23:37 -0700 (PDT) Received: by 10.227.28.161 with SMTP id m33mr211291wbc.88.1314797017865; Wed, 31 Aug 2011 06:23:37 -0700 (PDT) Received: from localhost.localdomain (a62-248-128-208.elisa-laajakaista.fi [62.248.128.208]) by mx.google.com with ESMTPS id fm9sm5476855wbb.27.2011.08.31.06.23.35 (version=SSLv3 cipher=OTHER); Wed, 31 Aug 2011 06:23:36 -0700 (PDT) From: Tomi Valkeinen To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: archit@ti.com, mythripk@ti.com, Tomi Valkeinen Subject: [PATCH 03/12] OMAP: DSS2: HDMI: make set_timing saner Date: Wed, 31 Aug 2011 16:23:14 +0300 Message-Id: <1314797003-17638-4-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1314797003-17638-1-git-send-email-tomi.valkeinen@ti.com> References: <1314797003-17638-1-git-send-email-tomi.valkeinen@ti.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 31 Aug 2011 13:23:54 +0000 (UTC) Currently the set_timings code for hdmi is quite strange. The display is disabled in hdmi_omap4_panel.c before setting timings, and enabled in hdmi.c after setting the timings. Furthermore, the timings were not permanent, and disabling and enabling the display would lose them. This patch makes the set_timings handling a bit better. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/hdmi.c | 13 +++++++++++-- drivers/video/omap2/dss/hdmi_omap4_panel.c | 7 +------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index d08096b..8f8ae0e 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -1226,11 +1226,20 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev) struct hdmi_cm cm; hdmi.custom_set = 1; + cm = hdmi_get_code(&dssdev->panel.timings); hdmi.code = cm.code; hdmi.mode = cm.mode; - omapdss_hdmi_display_enable(dssdev); - hdmi.custom_set = 0; + + if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) { + int r; + + hdmi_power_off(dssdev); + + r = hdmi_power_on(dssdev); + if (r) + DSSERR("failed to power on device\n"); + } } int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev) diff --git a/drivers/video/omap2/dss/hdmi_omap4_panel.c b/drivers/video/omap2/dss/hdmi_omap4_panel.c index 7d4f2bd..25d5fb2 100644 --- a/drivers/video/omap2/dss/hdmi_omap4_panel.c +++ b/drivers/video/omap2/dss/hdmi_omap4_panel.c @@ -161,12 +161,7 @@ static void hdmi_set_timings(struct omap_dss_device *dssdev, mutex_lock(&hdmi.hdmi_lock); dssdev->panel.timings = *timings; - - if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) { - /* turn the hdmi off and on to get new timings to use */ - omapdss_hdmi_display_disable(dssdev); - omapdss_hdmi_display_set_timing(dssdev); - } + omapdss_hdmi_display_set_timing(dssdev); mutex_unlock(&hdmi.hdmi_lock); }