linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Archit Taneja <archit@ti.com>
To: tomi.valkeinen@ti.com, tony@atomide.com
Cc: linux-omap@vger.kernel.org, Archit Taneja <archit@ti.com>,
	Andy Gross <andygro@gmail.com>
Subject: [PATCH v2 2/4] arm: omap: display: Create omapdrm device inside omap_display_init
Date: Mon, 16 Sep 2013 12:48:29 +0530	[thread overview]
Message-ID: <1379315911-24634-3-git-send-email-archit@ti.com> (raw)
In-Reply-To: <1379315911-24634-1-git-send-email-archit@ti.com>

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>
---
 arch/arm/mach-omap2/Makefile  |  6 +-----
 arch/arm/mach-omap2/display.c |  7 +++++++
 arch/arm/mach-omap2/display.h |  1 +
 arch/arm/mach-omap2/drm.c     | 10 +++++-----
 4 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index ff2c162..cc84b25 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -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 \
@@ -229,10 +229,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
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 03a0516..8d8ee474 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -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;
 }
 
diff --git a/arch/arm/mach-omap2/display.h b/arch/arm/mach-omap2/display.h
index b871b017..e4e8d39 100644
--- a/arch/arm/mach-omap2/display.h
+++ b/arch/arm/mach-omap2/display.h
@@ -26,4 +26,5 @@ struct omap_dss_dispc_dev_attr {
 	bool	has_framedonetv_irq;
 };
 
+int omap_init_drm(void);
 #endif
diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c
index e6c38cd..facd740 100644
--- a/arch/arm/mach-omap2/drm.c
+++ b/arch/arm/mach-omap2/drm.c
@@ -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
-- 
1.8.1.2


  parent reply	other threads:[~2013-09-16  7:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16  7:18 [PATCH v2 0/4] arm: omap: display: Ensure DRM/FB/V4L devices are created if DSS is available Archit Taneja
2013-09-16  7:18 ` [PATCH v2 1/4] arm: omap: drm: Don't build device for DMM Archit Taneja
2013-09-16  7:18 ` Archit Taneja [this message]
2013-09-16  7:18 ` [PATCH v2 3/4] arm: omap: display: Create omapvrfb and omapfb devices inside omap_display_init Archit Taneja
2013-09-16  7:18 ` [PATCH v2 4/4] arm: omap: display: Create omap_vout device " Archit Taneja
2013-09-16  8:50 ` [PATCH v2 0/4] arm: omap: display: Ensure DRM/FB/V4L devices are created if DSS is available Tomi Valkeinen
2013-10-08 21:06   ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1379315911-24634-3-git-send-email-archit@ti.com \
    --to=archit@ti.com \
    --cc=andygro@gmail.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tomi.valkeinen@ti.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).