From patchwork Wed Aug 31 13:21:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1115872 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 p7VDMI6I022738 for ; Wed, 31 Aug 2011 13:22:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755694Ab1HaNWR (ORCPT ); Wed, 31 Aug 2011 09:22:17 -0400 Received: from na3sys009aog107.obsmtp.com ([74.125.149.197]:57433 "EHLO na3sys009aog107.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755658Ab1HaNWQ (ORCPT ); Wed, 31 Aug 2011 09:22:16 -0400 Received: from mail-wy0-f175.google.com ([74.125.82.175]) (using TLSv1) by na3sys009aob107.postini.com ([74.125.148.12]) with SMTP ID DSNKTl41gaVBeakANdooeAFZO/+nr7dC2FdO@postini.com; Wed, 31 Aug 2011 06:22:15 PDT Received: by mail-wy0-f175.google.com with SMTP id 19so495513wyf.6 for ; Wed, 31 Aug 2011 06:22:09 -0700 (PDT) Received: by 10.216.82.144 with SMTP id o16mr370128wee.106.1314796929662; Wed, 31 Aug 2011 06:22:09 -0700 (PDT) Received: from localhost.localdomain (a62-248-128-208.elisa-laajakaista.fi [62.248.128.208]) by mx.google.com with ESMTPS id fy13sm3685472wbb.56.2011.08.31.06.22.07 (version=SSLv3 cipher=OTHER); Wed, 31 Aug 2011 06:22:08 -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 6/8] OMAP: DSS2: add dss_get_hdmi_venc_clk_source() Date: Wed, 31 Aug 2011 16:21:46 +0300 Message-Id: <1314796908-17354-7-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1314796908-17354-1-git-send-email-tomi.valkeinen@ti.com> References: <1314796908-17354-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:22:18 +0000 (UTC) Add dss_get_hdmi_venc_clk_source(), which can be used to get the value programmed with dss_select_hdmi_venc_clk_source(). This can be used to find out if the digit output is going to VENC or HDMI. For OMAP2/3 dss_get_hdmi_venc_clk_source() always returns DSS_VENC_TV_CLK. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dss.c | 11 +++++++++++ drivers/video/omap2/dss/dss.h | 1 + 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c index 356d3c1..3e09726 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c @@ -639,6 +639,17 @@ void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select hdmi) REG_FLD_MOD(DSS_CONTROL, hdmi, 15, 15); /* VENC_HDMI_SWITCH */ } +enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void) +{ + enum omap_display_type displays; + + displays = dss_feat_get_supported_displays(OMAP_DSS_CHANNEL_DIGIT); + if ((displays & OMAP_DISPLAY_TYPE_HDMI) == 0) + return DSS_VENC_TV_CLK; + + return REG_GET(DSS_CONTROL, 15, 15); +} + static int dss_get_clocks(void) { struct clk *clk; diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index a095a62..57b1a01 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -210,6 +210,7 @@ int dss_runtime_get(void); void dss_runtime_put(void); void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select); +enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void); const char *dss_get_generic_clk_source_name(enum omap_dss_clk_source clk_src); void dss_dump_clocks(struct seq_file *s);