diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-09-28 05:42:28 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-10-16 06:43:56 -0400 |
commit | acd18af93ad3b99e6769b917fe5b549dc1bfc468 (patch) | |
tree | 5f48050c869c8d36135c1685ddc869776cc6f751 /arch/arm/mach-omap2 | |
parent | ddffeb8c4d0331609ef2581d84de4d763607bd37 (diff) |
OMAPDSS: add omapdss_version
Add new enum, omapdss_version, that is used to tell which DSS hardware
version the SoC has. This enum is initialized during platform init, and
passed in the platform data to omapdss driver.
Note that the versions are not "continuous", that is, you cannot check
if the version is less or greater than something, but you need to check
for exact version match. In other words, this is invalid:
/* test if DSS is 3630 or earlier */
if (ver <= OMAPDSS_VER_OMAP3630)
...
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/display.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 1011995f150a..28f508724a56 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c | |||
@@ -284,6 +284,35 @@ err: | |||
284 | return ERR_PTR(r); | 284 | return ERR_PTR(r); |
285 | } | 285 | } |
286 | 286 | ||
287 | static enum omapdss_version __init omap_display_get_version(void) | ||
288 | { | ||
289 | if (cpu_is_omap24xx()) | ||
290 | return OMAPDSS_VER_OMAP24xx; | ||
291 | else if (cpu_is_omap3630()) | ||
292 | return OMAPDSS_VER_OMAP3630; | ||
293 | else if (cpu_is_omap34xx()) { | ||
294 | if (soc_is_am35xx()) { | ||
295 | return OMAPDSS_VER_AM35xx; | ||
296 | } else { | ||
297 | if (omap_rev() < OMAP3430_REV_ES3_0) | ||
298 | return OMAPDSS_VER_OMAP34xx_ES1; | ||
299 | else | ||
300 | return OMAPDSS_VER_OMAP34xx_ES3; | ||
301 | } | ||
302 | } else if (omap_rev() == OMAP4430_REV_ES1_0) | ||
303 | return OMAPDSS_VER_OMAP4430_ES1; | ||
304 | else if (omap_rev() == OMAP4430_REV_ES2_0 || | ||
305 | omap_rev() == OMAP4430_REV_ES2_1 || | ||
306 | omap_rev() == OMAP4430_REV_ES2_2) | ||
307 | return OMAPDSS_VER_OMAP4430_ES2; | ||
308 | else if (cpu_is_omap44xx()) | ||
309 | return OMAPDSS_VER_OMAP4; | ||
310 | else if (soc_is_omap54xx()) | ||
311 | return OMAPDSS_VER_OMAP5; | ||
312 | else | ||
313 | return OMAPDSS_VER_UNKNOWN; | ||
314 | } | ||
315 | |||
287 | int __init omap_display_init(struct omap_dss_board_info *board_data) | 316 | int __init omap_display_init(struct omap_dss_board_info *board_data) |
288 | { | 317 | { |
289 | int r = 0; | 318 | int r = 0; |
@@ -291,9 +320,18 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) | |||
291 | int i, oh_count; | 320 | int i, oh_count; |
292 | const struct omap_dss_hwmod_data *curr_dss_hwmod; | 321 | const struct omap_dss_hwmod_data *curr_dss_hwmod; |
293 | struct platform_device *dss_pdev; | 322 | struct platform_device *dss_pdev; |
323 | enum omapdss_version ver; | ||
294 | 324 | ||
295 | /* create omapdss device */ | 325 | /* create omapdss device */ |
296 | 326 | ||
327 | ver = omap_display_get_version(); | ||
328 | |||
329 | if (ver == OMAPDSS_VER_UNKNOWN) { | ||
330 | pr_err("DSS not supported on this SoC\n"); | ||
331 | return -ENODEV; | ||
332 | } | ||
333 | |||
334 | board_data->version = ver; | ||
297 | board_data->dsi_enable_pads = omap_dsi_enable_pads; | 335 | board_data->dsi_enable_pads = omap_dsi_enable_pads; |
298 | board_data->dsi_disable_pads = omap_dsi_disable_pads; | 336 | board_data->dsi_disable_pads = omap_dsi_disable_pads; |
299 | board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count; | 337 | board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count; |