diff options
Diffstat (limited to 'arch/arm/mach-omap2/display.c')
-rw-r--r-- | arch/arm/mach-omap2/display.c | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 1011995f150a..89c57129357a 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c | |||
@@ -25,11 +25,12 @@ | |||
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | 26 | ||
27 | #include <video/omapdss.h> | 27 | #include <video/omapdss.h> |
28 | #include <plat/omap_hwmod.h> | 28 | #include "omap_hwmod.h" |
29 | #include <plat/omap_device.h> | 29 | #include "omap_device.h" |
30 | #include <plat/omap-pm.h> | 30 | #include "omap-pm.h" |
31 | #include "common.h" | 31 | #include "common.h" |
32 | 32 | ||
33 | #include "soc.h" | ||
33 | #include "iomap.h" | 34 | #include "iomap.h" |
34 | #include "mux.h" | 35 | #include "mux.h" |
35 | #include "control.h" | 36 | #include "control.h" |
@@ -284,6 +285,35 @@ err: | |||
284 | return ERR_PTR(r); | 285 | return ERR_PTR(r); |
285 | } | 286 | } |
286 | 287 | ||
288 | static enum omapdss_version __init omap_display_get_version(void) | ||
289 | { | ||
290 | if (cpu_is_omap24xx()) | ||
291 | return OMAPDSS_VER_OMAP24xx; | ||
292 | else if (cpu_is_omap3630()) | ||
293 | return OMAPDSS_VER_OMAP3630; | ||
294 | else if (cpu_is_omap34xx()) { | ||
295 | if (soc_is_am35xx()) { | ||
296 | return OMAPDSS_VER_AM35xx; | ||
297 | } else { | ||
298 | if (omap_rev() < OMAP3430_REV_ES3_0) | ||
299 | return OMAPDSS_VER_OMAP34xx_ES1; | ||
300 | else | ||
301 | return OMAPDSS_VER_OMAP34xx_ES3; | ||
302 | } | ||
303 | } else if (omap_rev() == OMAP4430_REV_ES1_0) | ||
304 | return OMAPDSS_VER_OMAP4430_ES1; | ||
305 | else if (omap_rev() == OMAP4430_REV_ES2_0 || | ||
306 | omap_rev() == OMAP4430_REV_ES2_1 || | ||
307 | omap_rev() == OMAP4430_REV_ES2_2) | ||
308 | return OMAPDSS_VER_OMAP4430_ES2; | ||
309 | else if (cpu_is_omap44xx()) | ||
310 | return OMAPDSS_VER_OMAP4; | ||
311 | else if (soc_is_omap54xx()) | ||
312 | return OMAPDSS_VER_OMAP5; | ||
313 | else | ||
314 | return OMAPDSS_VER_UNKNOWN; | ||
315 | } | ||
316 | |||
287 | int __init omap_display_init(struct omap_dss_board_info *board_data) | 317 | int __init omap_display_init(struct omap_dss_board_info *board_data) |
288 | { | 318 | { |
289 | int r = 0; | 319 | int r = 0; |
@@ -291,9 +321,18 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) | |||
291 | int i, oh_count; | 321 | int i, oh_count; |
292 | const struct omap_dss_hwmod_data *curr_dss_hwmod; | 322 | const struct omap_dss_hwmod_data *curr_dss_hwmod; |
293 | struct platform_device *dss_pdev; | 323 | struct platform_device *dss_pdev; |
324 | enum omapdss_version ver; | ||
294 | 325 | ||
295 | /* create omapdss device */ | 326 | /* create omapdss device */ |
296 | 327 | ||
328 | ver = omap_display_get_version(); | ||
329 | |||
330 | if (ver == OMAPDSS_VER_UNKNOWN) { | ||
331 | pr_err("DSS not supported on this SoC\n"); | ||
332 | return -ENODEV; | ||
333 | } | ||
334 | |||
335 | board_data->version = ver; | ||
297 | board_data->dsi_enable_pads = omap_dsi_enable_pads; | 336 | board_data->dsi_enable_pads = omap_dsi_enable_pads; |
298 | board_data->dsi_disable_pads = omap_dsi_disable_pads; | 337 | board_data->dsi_disable_pads = omap_dsi_disable_pads; |
299 | board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count; | 338 | board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count; |