From patchwork Wed Oct 24 09:29:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1636841 Return-Path: X-Original-To: patchwork-linux-omap@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 117C3DF2AB for ; Wed, 24 Oct 2012 09:30:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934499Ab2JXJ3q (ORCPT ); Wed, 24 Oct 2012 05:29:46 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:47955 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932150Ab2JXJ3o (ORCPT ); Wed, 24 Oct 2012 05:29:44 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id q9O9Ti7k029892; Wed, 24 Oct 2012 04:29:44 -0500 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 q9O9TiL2018935; Wed, 24 Oct 2012 04:29:44 -0500 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; Wed, 24 Oct 2012 04:29:43 -0500 Received: from deskari.tieu.ti.com (h64-3.vpn.ti.com [172.24.64.3]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9O9TOBM028560; Wed, 24 Oct 2012 04:29:42 -0500 From: Tomi Valkeinen To: , , CC: Tomi Valkeinen , Ricardo Neri Subject: [PATCH 12/20] OMAPDSS: HDMI: use core power on/off with edid & detect Date: Wed, 24 Oct 2012 12:29:03 +0300 Message-ID: <1351070951-18616-13-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com> References: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org This patch makes use of the hdmi_power_[on|off]_core() functions added in the previous patch. The functions are used when reading EDID or detecting if a monitor is connected. Signed-off-by: Tomi Valkeinen Cc: Ricardo Neri --- drivers/video/omap2/dss/dss.h | 2 ++ drivers/video/omap2/dss/hdmi.c | 35 ++++++++++++++++++++++++++++++++++ drivers/video/omap2/dss/hdmi_panel.c | 8 ++++---- 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 8bf9047..2305b80 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -510,6 +510,8 @@ static inline unsigned long hdmi_get_pixel_clock(void) #endif int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev); void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev); +int omapdss_hdmi_core_enable(struct omap_dss_device *dssdev); +void omapdss_hdmi_core_disable(struct omap_dss_device *dssdev); void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev, struct omap_video_timings *timings); int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev, diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 50d5a10..b809490 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -759,6 +759,41 @@ void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev) mutex_unlock(&hdmi.lock); } +int omapdss_hdmi_core_enable(struct omap_dss_device *dssdev) +{ + int r = 0; + + DSSDBG("ENTER omapdss_hdmi_core_enable\n"); + + mutex_lock(&hdmi.lock); + + hdmi.ip_data.hpd_gpio = hdmi.hpd_gpio; + + r = hdmi_power_on_core(dssdev); + if (r) { + DSSERR("failed to power on device\n"); + goto err0; + } + + mutex_unlock(&hdmi.lock); + return 0; + +err0: + mutex_unlock(&hdmi.lock); + return r; +} + +void omapdss_hdmi_core_disable(struct omap_dss_device *dssdev) +{ + DSSDBG("Enter omapdss_hdmi_core_disable\n"); + + mutex_lock(&hdmi.lock); + + hdmi_power_off_core(dssdev); + + mutex_unlock(&hdmi.lock); +} + static int hdmi_get_clocks(struct platform_device *pdev) { struct clk *clk; diff --git a/drivers/video/omap2/dss/hdmi_panel.c b/drivers/video/omap2/dss/hdmi_panel.c index 3f9a4b9..a385b69 100644 --- a/drivers/video/omap2/dss/hdmi_panel.c +++ b/drivers/video/omap2/dss/hdmi_panel.c @@ -334,7 +334,7 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev, u8 *buf, int len) need_enable = dssdev->state == OMAP_DSS_DISPLAY_DISABLED; if (need_enable) { - r = omapdss_hdmi_display_enable(dssdev); + r = omapdss_hdmi_core_enable(dssdev); if (r) goto err; } @@ -342,7 +342,7 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev, u8 *buf, int len) r = omapdss_hdmi_read_edid(buf, len); if (need_enable) - omapdss_hdmi_display_disable(dssdev); + omapdss_hdmi_core_disable(dssdev); err: mutex_unlock(&hdmi.lock); @@ -359,7 +359,7 @@ static bool hdmi_detect(struct omap_dss_device *dssdev) need_enable = dssdev->state == OMAP_DSS_DISPLAY_DISABLED; if (need_enable) { - r = omapdss_hdmi_display_enable(dssdev); + r = omapdss_hdmi_core_enable(dssdev); if (r) goto err; } @@ -367,7 +367,7 @@ static bool hdmi_detect(struct omap_dss_device *dssdev) r = omapdss_hdmi_detect(); if (need_enable) - omapdss_hdmi_display_disable(dssdev); + omapdss_hdmi_core_disable(dssdev); err: mutex_unlock(&hdmi.lock);