OMAP: DSS2: add dss_get_hdmi_venc_clk_source()
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 31 Aug 2011 11:33:31 +0000 (14:33 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 30 Sep 2011 13:16:42 +0000 (16:16 +0300)
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.

Cc: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/omap2/dss/dss.c
drivers/video/omap2/dss/dss.h

index 356d3c15a639cb6e3cfa00d2c6d8ed02fdcc521f..3e09726d32c7ae1f5a86e51830191a09d7574955 100644 (file)
@@ -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;
index d790580a6a3b797934715f0a0ce1a9b75c5421e6..48bba53de0abb3d524311aa8db87253628e6fd75 100644 (file)
@@ -205,6 +205,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);