diff options
Diffstat (limited to 'arch/arm/mach-omap2/display.c')
| -rw-r--r-- | arch/arm/mach-omap2/display.c | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 1011995f150a..38ba58c97628 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c | |||
| @@ -25,15 +25,17 @@ | |||
| 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" |
| 36 | #include "display.h" | 37 | #include "display.h" |
| 38 | #include "prm.h" | ||
| 37 | 39 | ||
| 38 | #define DISPC_CONTROL 0x0040 | 40 | #define DISPC_CONTROL 0x0040 |
| 39 | #define DISPC_CONTROL2 0x0238 | 41 | #define DISPC_CONTROL2 0x0238 |
| @@ -284,6 +286,35 @@ err: | |||
| 284 | return ERR_PTR(r); | 286 | return ERR_PTR(r); |
| 285 | } | 287 | } |
| 286 | 288 | ||
| 289 | static enum omapdss_version __init omap_display_get_version(void) | ||
| 290 | { | ||
| 291 | if (cpu_is_omap24xx()) | ||
| 292 | return OMAPDSS_VER_OMAP24xx; | ||
| 293 | else if (cpu_is_omap3630()) | ||
| 294 | return OMAPDSS_VER_OMAP3630; | ||
| 295 | else if (cpu_is_omap34xx()) { | ||
| 296 | if (soc_is_am35xx()) { | ||
| 297 | return OMAPDSS_VER_AM35xx; | ||
| 298 | } else { | ||
| 299 | if (omap_rev() < OMAP3430_REV_ES3_0) | ||
| 300 | return OMAPDSS_VER_OMAP34xx_ES1; | ||
| 301 | else | ||
| 302 | return OMAPDSS_VER_OMAP34xx_ES3; | ||
| 303 | } | ||
| 304 | } else if (omap_rev() == OMAP4430_REV_ES1_0) | ||
| 305 | return OMAPDSS_VER_OMAP4430_ES1; | ||
| 306 | else if (omap_rev() == OMAP4430_REV_ES2_0 || | ||
| 307 | omap_rev() == OMAP4430_REV_ES2_1 || | ||
| 308 | omap_rev() == OMAP4430_REV_ES2_2) | ||
| 309 | return OMAPDSS_VER_OMAP4430_ES2; | ||
| 310 | else if (cpu_is_omap44xx()) | ||
| 311 | return OMAPDSS_VER_OMAP4; | ||
| 312 | else if (soc_is_omap54xx()) | ||
| 313 | return OMAPDSS_VER_OMAP5; | ||
| 314 | else | ||
| 315 | return OMAPDSS_VER_UNKNOWN; | ||
| 316 | } | ||
| 317 | |||
| 287 | int __init omap_display_init(struct omap_dss_board_info *board_data) | 318 | int __init omap_display_init(struct omap_dss_board_info *board_data) |
| 288 | { | 319 | { |
| 289 | int r = 0; | 320 | int r = 0; |
| @@ -291,9 +322,18 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) | |||
| 291 | int i, oh_count; | 322 | int i, oh_count; |
| 292 | const struct omap_dss_hwmod_data *curr_dss_hwmod; | 323 | const struct omap_dss_hwmod_data *curr_dss_hwmod; |
| 293 | struct platform_device *dss_pdev; | 324 | struct platform_device *dss_pdev; |
| 325 | enum omapdss_version ver; | ||
| 294 | 326 | ||
| 295 | /* create omapdss device */ | 327 | /* create omapdss device */ |
| 296 | 328 | ||
| 329 | ver = omap_display_get_version(); | ||
| 330 | |||
| 331 | if (ver == OMAPDSS_VER_UNKNOWN) { | ||
| 332 | pr_err("DSS not supported on this SoC\n"); | ||
| 333 | return -ENODEV; | ||
| 334 | } | ||
| 335 | |||
| 336 | board_data->version = ver; | ||
| 297 | board_data->dsi_enable_pads = omap_dsi_enable_pads; | 337 | board_data->dsi_enable_pads = omap_dsi_enable_pads; |
| 298 | board_data->dsi_disable_pads = omap_dsi_disable_pads; | 338 | board_data->dsi_disable_pads = omap_dsi_disable_pads; |
| 299 | board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count; | 339 | board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count; |
| @@ -473,7 +513,6 @@ static void dispc_disable_outputs(void) | |||
| 473 | } | 513 | } |
| 474 | } | 514 | } |
| 475 | 515 | ||
| 476 | #define MAX_MODULE_SOFTRESET_WAIT 10000 | ||
| 477 | int omap_dss_reset(struct omap_hwmod *oh) | 516 | int omap_dss_reset(struct omap_hwmod *oh) |
| 478 | { | 517 | { |
| 479 | struct omap_hwmod_opt_clk *oc; | 518 | struct omap_hwmod_opt_clk *oc; |
