aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/dss_features.c
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2011-03-02 01:27:25 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-03-11 08:46:27 -0500
commit067a57e48e302863eb2d5ac0900ae9ae65dbc8c3 (patch)
tree7118ff6757fcd6358547a24b9d2c5d09ba43a868 /drivers/video/omap2/dss/dss_features.c
parent88134fa138b90518819b750891ffecc13f5f4886 (diff)
OMAP2PLUS: DSS2: Use dss features to get clock source names of current OMAP
Clock source names vary across OMAP2/3 and OMAP4, the clock source enum names have been made generic in the driver, but for purposes of debugging and dumping clock sources, it is better to preserve the actual TRM name of the clock. Introduce a dss feature function 'dss_feat_get_clk_source_name()' which returns a string with the TRM clock name for the current OMAP in use. The OMAP specific name is printed along the generic name within brackets. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/dss_features.c')
-rw-r--r--drivers/video/omap2/dss/dss_features.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 3ebe0d91afd2..ccae57b34f5c 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -25,6 +25,7 @@
25#include <plat/display.h> 25#include <plat/display.h>
26#include <plat/cpu.h> 26#include <plat/cpu.h>
27 27
28#include "dss.h"
28#include "dss_features.h" 29#include "dss_features.h"
29 30
30/* Defines a generic omap register field */ 31/* Defines a generic omap register field */
@@ -44,6 +45,7 @@ struct omap_dss_features {
44 const unsigned long max_dss_fck; 45 const unsigned long max_dss_fck;
45 const enum omap_display_type *supported_displays; 46 const enum omap_display_type *supported_displays;
46 const enum omap_color_mode *supported_color_modes; 47 const enum omap_color_mode *supported_color_modes;
48 const struct dss_clk_source_name *clksrc_names;
47}; 49};
48 50
49/* This struct is assigned to one of the below during initialization */ 51/* This struct is assigned to one of the below during initialization */
@@ -157,6 +159,18 @@ static const enum omap_color_mode omap3_dss_supported_color_modes[] = {
157 OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32, 159 OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32,
158}; 160};
159 161
162static const struct dss_clk_source_name omap2_dss_clk_source_names[] = {
163 { DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC, "N/A" },
164 { DSS_CLK_SRC_DSI_PLL_HSDIV_DSI, "N/A" },
165 { DSS_CLK_SRC_FCK, "DSS_FCLK1" },
166};
167
168static const struct dss_clk_source_name omap3_dss_clk_source_names[] = {
169 { DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC, "DSI1_PLL_FCLK" },
170 { DSS_CLK_SRC_DSI_PLL_HSDIV_DSI, "DSI2_PLL_FCLK" },
171 { DSS_CLK_SRC_FCK, "DSS1_ALWON_FCLK" },
172};
173
160/* OMAP2 DSS Features */ 174/* OMAP2 DSS Features */
161static struct omap_dss_features omap2_dss_features = { 175static struct omap_dss_features omap2_dss_features = {
162 .reg_fields = omap2_dss_reg_fields, 176 .reg_fields = omap2_dss_reg_fields,
@@ -172,6 +186,7 @@ static struct omap_dss_features omap2_dss_features = {
172 .max_dss_fck = 173000000, 186 .max_dss_fck = 173000000,
173 .supported_displays = omap2_dss_supported_displays, 187 .supported_displays = omap2_dss_supported_displays,
174 .supported_color_modes = omap2_dss_supported_color_modes, 188 .supported_color_modes = omap2_dss_supported_color_modes,
189 .clksrc_names = omap2_dss_clk_source_names,
175}; 190};
176 191
177/* OMAP3 DSS Features */ 192/* OMAP3 DSS Features */
@@ -190,6 +205,7 @@ static struct omap_dss_features omap3430_dss_features = {
190 .max_dss_fck = 173000000, 205 .max_dss_fck = 173000000,
191 .supported_displays = omap3430_dss_supported_displays, 206 .supported_displays = omap3430_dss_supported_displays,
192 .supported_color_modes = omap3_dss_supported_color_modes, 207 .supported_color_modes = omap3_dss_supported_color_modes,
208 .clksrc_names = omap3_dss_clk_source_names,
193}; 209};
194 210
195static struct omap_dss_features omap3630_dss_features = { 211static struct omap_dss_features omap3630_dss_features = {
@@ -208,6 +224,7 @@ static struct omap_dss_features omap3630_dss_features = {
208 .max_dss_fck = 173000000, 224 .max_dss_fck = 173000000,
209 .supported_displays = omap3630_dss_supported_displays, 225 .supported_displays = omap3630_dss_supported_displays,
210 .supported_color_modes = omap3_dss_supported_color_modes, 226 .supported_color_modes = omap3_dss_supported_color_modes,
227 .clksrc_names = omap3_dss_clk_source_names,
211}; 228};
212 229
213/* OMAP4 DSS Features */ 230/* OMAP4 DSS Features */
@@ -224,6 +241,7 @@ static struct omap_dss_features omap4_dss_features = {
224 .max_dss_fck = 186000000, 241 .max_dss_fck = 186000000,
225 .supported_displays = omap4_dss_supported_displays, 242 .supported_displays = omap4_dss_supported_displays,
226 .supported_color_modes = omap3_dss_supported_color_modes, 243 .supported_color_modes = omap3_dss_supported_color_modes,
244 .clksrc_names = omap3_dss_clk_source_names,
227}; 245};
228 246
229/* Functions returning values related to a DSS feature */ 247/* Functions returning values related to a DSS feature */
@@ -260,6 +278,11 @@ bool dss_feat_color_mode_supported(enum omap_plane plane,
260 color_mode; 278 color_mode;
261} 279}
262 280
281const char *dss_feat_get_clk_source_name(enum dss_clk_source id)
282{
283 return omap_current_dss_features->clksrc_names[id].clksrc_name;
284}
285
263/* DSS has_feature check */ 286/* DSS has_feature check */
264bool dss_has_feature(enum dss_feat_id id) 287bool dss_has_feature(enum dss_feat_id id)
265{ 288{