From patchwork Wed Aug 31 13:23:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1116042 X-Patchwork-Delegate: tomi.valkeinen@nokia.com 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 p7VDMMJ6022786 for ; Wed, 31 Aug 2011 13:23:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755815Ab1HaNXx (ORCPT ); Wed, 31 Aug 2011 09:23:53 -0400 Received: from na3sys009aog112.obsmtp.com ([74.125.149.207]:51347 "EHLO na3sys009aog112.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755798Ab1HaNXv (ORCPT ); Wed, 31 Aug 2011 09:23:51 -0400 Received: from mail-wy0-f172.google.com ([74.125.82.172]) (using TLSv1) by na3sys009aob112.postini.com ([74.125.148.12]) with SMTP ID DSNKTl415qX5eNWV3S81Pdj71MQqNoHxxa6p@postini.com; Wed, 31 Aug 2011 06:23:51 PDT Received: by mail-wy0-f172.google.com with SMTP id 8so727824wyg.17 for ; Wed, 31 Aug 2011 06:23:50 -0700 (PDT) Received: by 10.227.10.146 with SMTP id p18mr400580wbp.23.1314797030450; Wed, 31 Aug 2011 06:23:50 -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.48 (version=SSLv3 cipher=OTHER); Wed, 31 Aug 2011 06:23:49 -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 09/12] OMAP: DSS2: HDMI: implement detect() Date: Wed, 31 Aug 2011 16:23:20 +0300 Message-Id: <1314797003-17638-10-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-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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:55 +0000 (UTC) Implement detect() by checking the hot plug detect status. The implementation is not very good, as it always turns on the HDMI output to get the detection working. HDMI driver needs improvements so that we could enable only core parts of it. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dss.h | 1 + drivers/video/omap2/dss/hdmi.c | 18 ++++++++++++++++++ drivers/video/omap2/dss/hdmi_omap4_panel.c | 25 +++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 0 deletions(-) diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 6102b80..dd7dc19 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -493,6 +493,7 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev); int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev, struct omap_video_timings *timings); int omapdss_hdmi_read_edid(u8 *buf, int len); +bool omapdss_hdmi_detect(void); int hdmi_panel_init(void); void hdmi_panel_exit(void); diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 55edbd2..e8a977e 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -1148,6 +1148,24 @@ int omapdss_hdmi_read_edid(u8 *buf, int len) return r; } +bool omapdss_hdmi_detect(void) +{ + int r; + + mutex_lock(&hdmi.lock); + + r = hdmi_runtime_get(); + BUG_ON(r); + + /* HPD */ + r = REG_GET(HDMI_CORE_SYS_SYS_STAT, 1, 1); + + hdmi_runtime_put(); + mutex_unlock(&hdmi.lock); + + return r == 1; +} + int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev) { int r = 0; diff --git a/drivers/video/omap2/dss/hdmi_omap4_panel.c b/drivers/video/omap2/dss/hdmi_omap4_panel.c index ffea8d3..c859421 100644 --- a/drivers/video/omap2/dss/hdmi_omap4_panel.c +++ b/drivers/video/omap2/dss/hdmi_omap4_panel.c @@ -25,6 +25,7 @@ #include #include #include