aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/dss_features.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/dss/dss_features.c')
-rw-r--r--drivers/video/omap2/dss/dss_features.c105
1 files changed, 84 insertions, 21 deletions
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 8c50e18bc0b0..1c18888e5df3 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -22,7 +22,7 @@
22#include <linux/err.h> 22#include <linux/err.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24 24
25#include <plat/display.h> 25#include <video/omapdss.h>
26#include <plat/cpu.h> 26#include <plat/cpu.h>
27 27
28#include "dss.h" 28#include "dss.h"
@@ -52,7 +52,7 @@ struct omap_dss_features {
52}; 52};
53 53
54/* This struct is assigned to one of the below during initialization */ 54/* This struct is assigned to one of the below during initialization */
55static struct omap_dss_features *omap_current_dss_features; 55static const struct omap_dss_features *omap_current_dss_features;
56 56
57static const struct dss_reg_field omap2_dss_reg_fields[] = { 57static const struct dss_reg_field omap2_dss_reg_fields[] = {
58 [FEAT_REG_FIRHINC] = { 11, 0 }, 58 [FEAT_REG_FIRHINC] = { 11, 0 },
@@ -177,22 +177,55 @@ static const enum omap_color_mode omap3_dss_supported_color_modes[] = {
177 OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32, 177 OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32,
178}; 178};
179 179
180static const enum omap_color_mode omap4_dss_supported_color_modes[] = {
181 /* OMAP_DSS_GFX */
182 OMAP_DSS_COLOR_CLUT1 | OMAP_DSS_COLOR_CLUT2 |
183 OMAP_DSS_COLOR_CLUT4 | OMAP_DSS_COLOR_CLUT8 |
184 OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_ARGB16 |
185 OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U |
186 OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_ARGB32 |
187 OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32 |
188 OMAP_DSS_COLOR_ARGB16_1555,
189
190 /* OMAP_DSS_VIDEO1 */
191 OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U |
192 OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_ARGB16_1555 |
193 OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_NV12 |
194 OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_RGB24U |
195 OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_UYVY |
196 OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 |
197 OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 |
198 OMAP_DSS_COLOR_RGBX32,
199
200 /* OMAP_DSS_VIDEO2 */
201 OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U |
202 OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_ARGB16_1555 |
203 OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_NV12 |
204 OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_RGB24U |
205 OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_UYVY |
206 OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 |
207 OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 |
208 OMAP_DSS_COLOR_RGBX32,
209};
210
180static const char * const omap2_dss_clk_source_names[] = { 211static const char * const omap2_dss_clk_source_names[] = {
181 [DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC] = "N/A", 212 [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC] = "N/A",
182 [DSS_CLK_SRC_DSI_PLL_HSDIV_DSI] = "N/A", 213 [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI] = "N/A",
183 [DSS_CLK_SRC_FCK] = "DSS_FCLK1", 214 [OMAP_DSS_CLK_SRC_FCK] = "DSS_FCLK1",
184}; 215};
185 216
186static const char * const omap3_dss_clk_source_names[] = { 217static const char * const omap3_dss_clk_source_names[] = {
187 [DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC] = "DSI1_PLL_FCLK", 218 [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC] = "DSI1_PLL_FCLK",
188 [DSS_CLK_SRC_DSI_PLL_HSDIV_DSI] = "DSI2_PLL_FCLK", 219 [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI] = "DSI2_PLL_FCLK",
189 [DSS_CLK_SRC_FCK] = "DSS1_ALWON_FCLK", 220 [OMAP_DSS_CLK_SRC_FCK] = "DSS1_ALWON_FCLK",
190}; 221};
191 222
192static const char * const omap4_dss_clk_source_names[] = { 223static const char * const omap4_dss_clk_source_names[] = {
193 [DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC] = "PLL1_CLK1", 224 [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC] = "PLL1_CLK1",
194 [DSS_CLK_SRC_DSI_PLL_HSDIV_DSI] = "PLL1_CLK2", 225 [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI] = "PLL1_CLK2",
195 [DSS_CLK_SRC_FCK] = "DSS_FCLK", 226 [OMAP_DSS_CLK_SRC_FCK] = "DSS_FCLK",
227 [OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC] = "PLL2_CLK1",
228 [OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI] = "PLL2_CLK2",
196}; 229};
197 230
198static const struct dss_param_range omap2_dss_param_range[] = { 231static const struct dss_param_range omap2_dss_param_range[] = {
@@ -226,7 +259,7 @@ static const struct dss_param_range omap4_dss_param_range[] = {
226}; 259};
227 260
228/* OMAP2 DSS Features */ 261/* OMAP2 DSS Features */
229static struct omap_dss_features omap2_dss_features = { 262static const struct omap_dss_features omap2_dss_features = {
230 .reg_fields = omap2_dss_reg_fields, 263 .reg_fields = omap2_dss_reg_fields,
231 .num_reg_fields = ARRAY_SIZE(omap2_dss_reg_fields), 264 .num_reg_fields = ARRAY_SIZE(omap2_dss_reg_fields),
232 265
@@ -244,7 +277,7 @@ static struct omap_dss_features omap2_dss_features = {
244}; 277};
245 278
246/* OMAP3 DSS Features */ 279/* OMAP3 DSS Features */
247static struct omap_dss_features omap3430_dss_features = { 280static const struct omap_dss_features omap3430_dss_features = {
248 .reg_fields = omap3_dss_reg_fields, 281 .reg_fields = omap3_dss_reg_fields,
249 .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields), 282 .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
250 283
@@ -252,7 +285,8 @@ static struct omap_dss_features omap3430_dss_features = {
252 FEAT_GLOBAL_ALPHA | FEAT_LCDENABLEPOL | 285 FEAT_GLOBAL_ALPHA | FEAT_LCDENABLEPOL |
253 FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE | 286 FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE |
254 FEAT_FUNCGATED | FEAT_ROWREPEATENABLE | 287 FEAT_FUNCGATED | FEAT_ROWREPEATENABLE |
255 FEAT_LINEBUFFERSPLIT | FEAT_RESIZECONF, 288 FEAT_LINEBUFFERSPLIT | FEAT_RESIZECONF |
289 FEAT_DSI_PLL_FREQSEL | FEAT_DSI_REVERSE_TXCLKESC,
256 290
257 .num_mgrs = 2, 291 .num_mgrs = 2,
258 .num_ovls = 3, 292 .num_ovls = 3,
@@ -262,7 +296,7 @@ static struct omap_dss_features omap3430_dss_features = {
262 .dss_params = omap3_dss_param_range, 296 .dss_params = omap3_dss_param_range,
263}; 297};
264 298
265static struct omap_dss_features omap3630_dss_features = { 299static const struct omap_dss_features omap3630_dss_features = {
266 .reg_fields = omap3_dss_reg_fields, 300 .reg_fields = omap3_dss_reg_fields,
267 .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields), 301 .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
268 302
@@ -271,7 +305,8 @@ static struct omap_dss_features omap3630_dss_features = {
271 FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE | 305 FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE |
272 FEAT_PRE_MULT_ALPHA | FEAT_FUNCGATED | 306 FEAT_PRE_MULT_ALPHA | FEAT_FUNCGATED |
273 FEAT_ROWREPEATENABLE | FEAT_LINEBUFFERSPLIT | 307 FEAT_ROWREPEATENABLE | FEAT_LINEBUFFERSPLIT |
274 FEAT_RESIZECONF | FEAT_DSI_PLL_PWR_BUG, 308 FEAT_RESIZECONF | FEAT_DSI_PLL_PWR_BUG |
309 FEAT_DSI_PLL_FREQSEL,
275 310
276 .num_mgrs = 2, 311 .num_mgrs = 2,
277 .num_ovls = 3, 312 .num_ovls = 3,
@@ -282,19 +317,43 @@ static struct omap_dss_features omap3630_dss_features = {
282}; 317};
283 318
284/* OMAP4 DSS Features */ 319/* OMAP4 DSS Features */
285static struct omap_dss_features omap4_dss_features = { 320/* For OMAP4430 ES 1.0 revision */
321static const struct omap_dss_features omap4430_es1_0_dss_features = {
286 .reg_fields = omap4_dss_reg_fields, 322 .reg_fields = omap4_dss_reg_fields,
287 .num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields), 323 .num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
288 324
289 .has_feature = 325 .has_feature =
290 FEAT_GLOBAL_ALPHA | FEAT_PRE_MULT_ALPHA | 326 FEAT_GLOBAL_ALPHA | FEAT_PRE_MULT_ALPHA |
291 FEAT_MGR_LCD2 | FEAT_GLOBAL_ALPHA_VID1 | 327 FEAT_MGR_LCD2 | FEAT_GLOBAL_ALPHA_VID1 |
292 FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC, 328 FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC |
329 FEAT_DSI_DCS_CMD_CONFIG_VC | FEAT_DSI_VC_OCP_WIDTH |
330 FEAT_DSI_GNQ | FEAT_HANDLE_UV_SEPARATE | FEAT_ATTR2,
293 331
294 .num_mgrs = 3, 332 .num_mgrs = 3,
295 .num_ovls = 3, 333 .num_ovls = 3,
296 .supported_displays = omap4_dss_supported_displays, 334 .supported_displays = omap4_dss_supported_displays,
297 .supported_color_modes = omap3_dss_supported_color_modes, 335 .supported_color_modes = omap4_dss_supported_color_modes,
336 .clksrc_names = omap4_dss_clk_source_names,
337 .dss_params = omap4_dss_param_range,
338};
339
340/* For all the other OMAP4 versions */
341static const struct omap_dss_features omap4_dss_features = {
342 .reg_fields = omap4_dss_reg_fields,
343 .num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
344
345 .has_feature =
346 FEAT_GLOBAL_ALPHA | FEAT_PRE_MULT_ALPHA |
347 FEAT_MGR_LCD2 | FEAT_GLOBAL_ALPHA_VID1 |
348 FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC |
349 FEAT_DSI_DCS_CMD_CONFIG_VC | FEAT_DSI_VC_OCP_WIDTH |
350 FEAT_DSI_GNQ | FEAT_HDMI_CTS_SWMODE |
351 FEAT_HANDLE_UV_SEPARATE | FEAT_ATTR2,
352
353 .num_mgrs = 3,
354 .num_ovls = 3,
355 .supported_displays = omap4_dss_supported_displays,
356 .supported_color_modes = omap4_dss_supported_color_modes,
298 .clksrc_names = omap4_dss_clk_source_names, 357 .clksrc_names = omap4_dss_clk_source_names,
299 .dss_params = omap4_dss_param_range, 358 .dss_params = omap4_dss_param_range,
300}; 359};
@@ -337,7 +396,7 @@ bool dss_feat_color_mode_supported(enum omap_plane plane,
337 color_mode; 396 color_mode;
338} 397}
339 398
340const char *dss_feat_get_clk_source_name(enum dss_clk_source id) 399const char *dss_feat_get_clk_source_name(enum omap_dss_clk_source id)
341{ 400{
342 return omap_current_dss_features->clksrc_names[id]; 401 return omap_current_dss_features->clksrc_names[id];
343} 402}
@@ -365,6 +424,10 @@ void dss_features_init(void)
365 omap_current_dss_features = &omap3630_dss_features; 424 omap_current_dss_features = &omap3630_dss_features;
366 else if (cpu_is_omap34xx()) 425 else if (cpu_is_omap34xx())
367 omap_current_dss_features = &omap3430_dss_features; 426 omap_current_dss_features = &omap3430_dss_features;
368 else 427 else if (omap_rev() == OMAP4430_REV_ES1_0)
428 omap_current_dss_features = &omap4430_es1_0_dss_features;
429 else if (cpu_is_omap44xx())
369 omap_current_dss_features = &omap4_dss_features; 430 omap_current_dss_features = &omap4_dss_features;
431 else
432 DSSWARN("Unsupported OMAP version");
370} 433}