]> Pileus Git - ~andy/linux/commitdiff
ARM: OMAP2+: display: Create omapdrm device inside omap_display_init
authorArchit Taneja <archit@ti.com>
Mon, 16 Sep 2013 07:18:29 +0000 (12:48 +0530)
committerTony Lindgren <tony@atomide.com>
Tue, 8 Oct 2013 21:02:35 +0000 (14:02 -0700)
Move omapdrm device creation inside the omap_display_init so that we can
correctly create the device based on the presence of omapdss within the
platform.

For example, on a kernel image supporting multiple platforms, omap_init_drm
will create a omapdrm platform device on a AM33xx platform even though it
doesn't have a DSS block.

Originally worked on by Andy Gross.

Cc: Andy Gross <andygro@gmail.com>
Signed-off-by: Archit Taneja <archit@ti.com>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/display.c
arch/arm/mach-omap2/display.h
arch/arm/mach-omap2/drm.c

index afb457c3135b18707ea23cc7019c68da0ec4c099..e59bec01dd25696ed15705061f9869eac1a3d41b 100644 (file)
@@ -8,7 +8,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
 # Common support
 obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \
         common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \
-        omap_device.o sram.o
+        omap_device.o sram.o drm.o
 
 omap-2-3-common                                = irq.o
 hwmod-common                           = omap_hwmod.o omap_hwmod_reset.o \
@@ -228,10 +228,6 @@ endif
 # OMAP2420 MSDI controller integration support ("MMC")
 obj-$(CONFIG_SOC_OMAP2420)             += msdi.o
 
-ifneq ($(CONFIG_DRM_OMAP),)
-obj-y                                  += drm.o
-endif
-
 # Specific board support
 obj-$(CONFIG_MACH_OMAP_GENERIC)                += board-generic.o
 obj-$(CONFIG_MACH_OMAP_H4)             += board-h4.o
index 03a0516c7f678294d1f7a261901a61550c0f012a..8d8ee4742f3f1aadfcaccf7d31c558ee41612296 100644 (file)
@@ -416,6 +416,13 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
                }
        }
 
+       /* create DRM device */
+       r = omap_init_drm();
+       if (r < 0) {
+               pr_err("Unable to register omapdrm device\n");
+               return r;
+       }
+
        return 0;
 }
 
index b871b017b3522bc0bf61d9837efbf93bbdfd1111..e4e8d39c0218d48be62eae79ec73a7c456ea4843 100644 (file)
@@ -26,4 +26,5 @@ struct omap_dss_dispc_dev_attr {
        bool    has_framedonetv_irq;
 };
 
+int omap_init_drm(void);
 #endif
index e6c38cd98930cecf4fd44822272336041256ab12..facd7406a03d76b2643802e8fb8759c54ec729c7 100644 (file)
@@ -26,8 +26,9 @@
 #include <linux/platform_data/omap_drm.h>
 
 #include "soc.h"
+#include "display.h"
 
-#if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE)
+#if defined(CONFIG_DRM_OMAP) || defined(CONFIG_DRM_OMAP_MODULE)
 
 static struct omap_drm_platform_data platform_data;
 
@@ -40,14 +41,13 @@ static struct platform_device omap_drm_device = {
        .id = 0,
 };
 
-static int __init omap_init_drm(void)
+int __init omap_init_drm(void)
 {
        platform_data.omaprev = GET_OMAP_TYPE;
 
        return platform_device_register(&omap_drm_device);
 
 }
-
-omap_arch_initcall(omap_init_drm);
-
+#else
+int __init omap_init_drm(void) { return 0; }
 #endif