aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.c3
-rw-r--r--drivers/media/platform/omap/omap_vout.c3
-rw-r--r--drivers/video/atmel_lcdfb.c15
-rw-r--r--drivers/video/omap2/dss/core.c20
-rw-r--r--drivers/video/omap2/omapfb/omapfb-main.c3
-rw-r--r--drivers/video/ps3fb.c2
-rw-r--r--include/video/omapdss.h1
7 files changed, 42 insertions, 5 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 9c53c25e5201..826586ffbe83 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -649,6 +649,9 @@ static void pdev_shutdown(struct platform_device *device)
649 649
650static int pdev_probe(struct platform_device *device) 650static int pdev_probe(struct platform_device *device)
651{ 651{
652 if (omapdss_is_initialized() == false)
653 return -EPROBE_DEFER;
654
652 DBG("%s", device->name); 655 DBG("%s", device->name);
653 return drm_platform_init(&omap_drm_driver, device); 656 return drm_platform_init(&omap_drm_driver, device);
654} 657}
diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c
index 477268a2415f..d338b19da544 100644
--- a/drivers/media/platform/omap/omap_vout.c
+++ b/drivers/media/platform/omap/omap_vout.c
@@ -2150,6 +2150,9 @@ static int __init omap_vout_probe(struct platform_device *pdev)
2150 struct omap_dss_device *def_display; 2150 struct omap_dss_device *def_display;
2151 struct omap2video_device *vid_dev = NULL; 2151 struct omap2video_device *vid_dev = NULL;
2152 2152
2153 if (omapdss_is_initialized() == false)
2154 return -EPROBE_DEFER;
2155
2153 ret = omapdss_compat_init(); 2156 ret = omapdss_compat_init();
2154 if (ret) { 2157 if (ret) {
2155 dev_err(&pdev->dev, "failed to init dss\n"); 2158 dev_err(&pdev->dev, "failed to init dss\n");
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 540909de6247..effdb373b8db 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -223,8 +223,14 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo)
223 223
224static void exit_backlight(struct atmel_lcdfb_info *sinfo) 224static void exit_backlight(struct atmel_lcdfb_info *sinfo)
225{ 225{
226 if (sinfo->backlight) 226 if (!sinfo->backlight)
227 backlight_device_unregister(sinfo->backlight); 227 return;
228
229 if (sinfo->backlight->ops) {
230 sinfo->backlight->props.power = FB_BLANK_POWERDOWN;
231 sinfo->backlight->ops->update_status(sinfo->backlight);
232 }
233 backlight_device_unregister(sinfo->backlight);
228} 234}
229 235
230#else 236#else
@@ -461,8 +467,11 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,
461 if (info->fix.smem_len) { 467 if (info->fix.smem_len) {
462 unsigned int smem_len = (var->xres_virtual * var->yres_virtual 468 unsigned int smem_len = (var->xres_virtual * var->yres_virtual
463 * ((var->bits_per_pixel + 7) / 8)); 469 * ((var->bits_per_pixel + 7) / 8));
464 if (smem_len > info->fix.smem_len) 470 if (smem_len > info->fix.smem_len) {
471 dev_err(dev, "Frame buffer is too small (%u) for screen size (need at least %u)\n",
472 info->fix.smem_len, smem_len);
465 return -EINVAL; 473 return -EINVAL;
474 }
466 } 475 }
467 476
468 /* Saturate vertical and horizontal timings at maximum values */ 477 /* Saturate vertical and horizontal timings at maximum values */
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 60cc6fee6548..c9c2252e3719 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -53,6 +53,8 @@ static char *def_disp_name;
53module_param_named(def_disp, def_disp_name, charp, 0); 53module_param_named(def_disp, def_disp_name, charp, 0);
54MODULE_PARM_DESC(def_disp, "default display name"); 54MODULE_PARM_DESC(def_disp, "default display name");
55 55
56static bool dss_initialized;
57
56const char *omapdss_get_default_display_name(void) 58const char *omapdss_get_default_display_name(void)
57{ 59{
58 return core.default_display_name; 60 return core.default_display_name;
@@ -66,6 +68,12 @@ enum omapdss_version omapdss_get_version(void)
66} 68}
67EXPORT_SYMBOL(omapdss_get_version); 69EXPORT_SYMBOL(omapdss_get_version);
68 70
71bool omapdss_is_initialized(void)
72{
73 return dss_initialized;
74}
75EXPORT_SYMBOL(omapdss_is_initialized);
76
69struct platform_device *dss_get_core_pdev(void) 77struct platform_device *dss_get_core_pdev(void)
70{ 78{
71 return core.pdev; 79 return core.pdev;
@@ -603,6 +611,8 @@ static int __init omap_dss_init(void)
603 return r; 611 return r;
604 } 612 }
605 613
614 dss_initialized = true;
615
606 return 0; 616 return 0;
607} 617}
608 618
@@ -633,7 +643,15 @@ static int __init omap_dss_init(void)
633 643
634static int __init omap_dss_init2(void) 644static int __init omap_dss_init2(void)
635{ 645{
636 return omap_dss_register_drivers(); 646 int r;
647
648 r = omap_dss_register_drivers();
649 if (r)
650 return r;
651
652 dss_initialized = true;
653
654 return 0;
637} 655}
638 656
639core_initcall(omap_dss_init); 657core_initcall(omap_dss_init);
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index c84bb8a4d0c4..856917b33616 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2416,6 +2416,9 @@ static int omapfb_probe(struct platform_device *pdev)
2416 2416
2417 DBG("omapfb_probe\n"); 2417 DBG("omapfb_probe\n");
2418 2418
2419 if (omapdss_is_initialized() == false)
2420 return -EPROBE_DEFER;
2421
2419 if (pdev->num_resources != 0) { 2422 if (pdev->num_resources != 0) {
2420 dev_err(&pdev->dev, "probed for an unknown device\n"); 2423 dev_err(&pdev->dev, "probed for an unknown device\n");
2421 r = -ENODEV; 2424 r = -ENODEV;
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index d9f08c653d62..dbfe2c18a434 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -710,7 +710,7 @@ static int ps3fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
710 r = vm_iomap_memory(vma, info->fix.smem_start, info->fix.smem_len); 710 r = vm_iomap_memory(vma, info->fix.smem_start, info->fix.smem_len);
711 711
712 dev_dbg(info->device, "ps3fb: mmap framebuffer P(%lx)->V(%lx)\n", 712 dev_dbg(info->device, "ps3fb: mmap framebuffer P(%lx)->V(%lx)\n",
713 info->fix.smem_start + vma->vm_pgoff << PAGE_SHIFT, 713 info->fix.smem_start + (vma->vm_pgoff << PAGE_SHIFT),
714 vma->vm_start); 714 vma->vm_start);
715 715
716 return r; 716 return r;
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 62ca9a77c1d6..aeb4e9a0c5d1 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -748,6 +748,7 @@ struct omap_dss_driver {
748}; 748};
749 749
750enum omapdss_version omapdss_get_version(void); 750enum omapdss_version omapdss_get_version(void);
751bool omapdss_is_initialized(void);
751 752
752int omap_dss_register_driver(struct omap_dss_driver *); 753int omap_dss_register_driver(struct omap_dss_driver *);
753void omap_dss_unregister_driver(struct omap_dss_driver *); 754void omap_dss_unregister_driver(struct omap_dss_driver *);