From: Archit Taneja <archit@ti.com>
To: tony@atomide.com, linux-omap@vger.kernel.org,
robdclark@gmail.com, tomi.valkeinen@ti.com
Cc: devicetree@vger.kernel.org, Archit Taneja <archit@ti.com>,
Andy Gross <andygro@gmail.com>
Subject: [PATCH 1/4] arm: omap: display: Create omapdrm inside omap_display_init
Date: Fri, 13 Sep 2013 14:44:36 +0530 [thread overview]
Message-ID: <1379063679-4869-2-git-send-email-archit@ti.com> (raw)
In-Reply-To: <1379063679-4869-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.
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 | 4 ---
arch/arm/mach-omap2/display.c | 55 +++++++++++++++++++++++++++++++++++
arch/arm/mach-omap2/drm.c | 67 -------------------------------------------
3 files changed, 55 insertions(+), 71 deletions(-)
delete mode 100644 arch/arm/mach-omap2/drm.c
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index ff2c162..f73b6a5 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -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..d097d23 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -18,11 +18,13 @@
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/init.h>
+#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/delay.h>
+#include <linux/platform_data/omap_drm.h>
#include <video/omapdss.h>
#include "omap_hwmod.h"
@@ -102,6 +104,52 @@ static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initconst = {
{ "dss_hdmi", "omapdss_hdmi", -1 },
};
+#if defined(CONFIG_DRM_OMAP) || defined(CONFIG_DRM_OMAP_MODULE)
+
+static struct omap_drm_platform_data platform_drm_data;
+
+static struct platform_device drm_device = {
+ .dev = {
+ .coherent_dma_mask = DMA_BIT_MASK(32),
+ .platform_data = &platform_drm_data,
+ },
+ .name = "omapdrm",
+ .id = 0,
+};
+
+static struct platform_device *omap_drm_device = &drm_device;
+#else
+static struct platform_device *omap_drm_device;
+#endif
+
+static int __init omapdrm_init(void)
+{
+ int r = 0;
+
+ /* create DRM and DMM device */
+ if (omap_drm_device != NULL) {
+ struct omap_hwmod *oh = NULL;
+ struct platform_device *pdev;
+
+ /* lookup and populate the DMM information, if present - OMAP4+ */
+ oh = omap_hwmod_lookup("dmm");
+ if (oh) {
+ pdev = omap_device_build(oh->name, -1, oh, NULL, 0);
+ WARN(IS_ERR(pdev),
+ "Could not build omap_device for %s\n",
+ oh->name);
+ }
+
+ platform_drm_data.omaprev = GET_OMAP_TYPE;
+
+ r = platform_device_register(omap_drm_device);
+ if (r < 0)
+ pr_err("Unable to register omapdrm device\n");
+ }
+
+ return r;
+}
+
static void __init omap4_tpd12s015_mux_pads(void)
{
omap_mux_init_signal("hdmi_cec",
@@ -416,6 +464,13 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
}
}
+ /* create DRM and DMM device */
+ r = omapdrm_init();
+ if (r < 0) {
+ pr_err("Unable to register omapdrm device\n");
+ return r;
+ }
+
return 0;
}
diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c
deleted file mode 100644
index 59a4af7..0000000
--- a/arch/arm/mach-omap2/drm.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * DRM/KMS device registration for TI OMAP platforms
- *
- * Copyright (C) 2012 Texas Instruments
- * Author: Rob Clark <rob.clark@linaro.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-#include <linux/platform_data/omap_drm.h>
-
-#include "soc.h"
-#include "omap_device.h"
-#include "omap_hwmod.h"
-
-#if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE)
-
-static struct omap_drm_platform_data platform_data;
-
-static struct platform_device omap_drm_device = {
- .dev = {
- .coherent_dma_mask = DMA_BIT_MASK(32),
- .platform_data = &platform_data,
- },
- .name = "omapdrm",
- .id = 0,
-};
-
-static int __init omap_init_drm(void)
-{
- struct omap_hwmod *oh = NULL;
- struct platform_device *pdev;
-
- /* lookup and populate the DMM information, if present - OMAP4+ */
- oh = omap_hwmod_lookup("dmm");
-
- if (oh) {
- pdev = omap_device_build(oh->name, -1, oh, NULL, 0);
- WARN(IS_ERR(pdev), "Could not build omap_device for %s\n",
- oh->name);
- }
-
- platform_data.omaprev = GET_OMAP_TYPE;
-
- return platform_device_register(&omap_drm_device);
-
-}
-
-omap_arch_initcall(omap_init_drm);
-
-#endif
--
1.8.1.2
next prev parent reply other threads:[~2013-09-13 9:14 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-13 9:14 [PATCH 0/4] arm: omap: DMM DT adaptation Archit Taneja
2013-09-13 9:14 ` Archit Taneja [this message]
[not found] ` <1379063679-4869-2-git-send-email-archit-l0cyMroinI0@public.gmane.org>
2013-09-13 9:24 ` [PATCH 1/4] arm: omap: display: Create omapdrm inside omap_display_init Tomi Valkeinen
2013-09-13 9:38 ` Archit Taneja
[not found] ` <5232DCFE.5050700-l0cyMroinI0@public.gmane.org>
2013-09-13 9:39 ` Archit Taneja
[not found] ` <5232DD53.3010706-l0cyMroinI0@public.gmane.org>
2013-09-13 9:48 ` Tomi Valkeinen
[not found] ` <5232DF61.6000109-l0cyMroinI0@public.gmane.org>
2013-09-13 9:51 ` Archit Taneja
2013-09-13 10:02 ` Tomi Valkeinen
2013-09-13 10:17 ` Archit Taneja
2013-09-13 10:24 ` Tomi Valkeinen
[not found] ` <5232E7E2.7050606-l0cyMroinI0@public.gmane.org>
2013-09-13 10:32 ` Archit Taneja
2013-09-13 9:42 ` Tomi Valkeinen
[not found] ` <1379063679-4869-1-git-send-email-archit-l0cyMroinI0@public.gmane.org>
2013-09-13 9:14 ` [PATCH 2/4] ARM: dts: OMAP4+: Add DMM bindings Archit Taneja
2013-09-13 9:14 ` [PATCH 3/4] drm: omap: Enable DT support for DMM Archit Taneja
[not found] ` <1379063679-4869-4-git-send-email-archit-l0cyMroinI0@public.gmane.org>
2013-09-13 14:14 ` Rob Clark
[not found] ` <CAF6AEGu7eRFhrQZUD-43AOHNQtRWeyxYga1dnir=qUo1mQ9ebA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-16 6:28 ` Archit Taneja
[not found] ` <5236A503.90507-l0cyMroinI0@public.gmane.org>
2013-09-16 11:56 ` Rob Clark
2013-09-13 9:14 ` [PATCH 4/4] arm: omap: display: Don't build device " Archit Taneja
[not found] ` <1379063679-4869-5-git-send-email-archit-l0cyMroinI0@public.gmane.org>
2013-09-13 9:29 ` Tomi Valkeinen
2013-09-16 9:30 ` [PATCH v2 0/2] DMM DT adaptation Archit Taneja
2013-09-16 9:30 ` [PATCH v2 1/2] arm: dts: omap4+: Add DMM bindings Archit Taneja
2013-09-16 11:19 ` Tomi Valkeinen
[not found] ` <5236E940.9070503-l0cyMroinI0@public.gmane.org>
2013-09-16 12:25 ` Archit Taneja
2013-09-16 9:30 ` [PATCH v2 2/2] drm: omap: Enable DT support for DMM Archit Taneja
[not found] ` <1379323815-14130-1-git-send-email-archit-l0cyMroinI0@public.gmane.org>
2013-09-16 11:30 ` [PATCH v2 0/2] DMM DT adaptation Tomi Valkeinen
2013-10-10 6:36 ` [PATCH v3 " Archit Taneja
2013-10-10 6:36 ` [PATCH v3 1/2] arm: dts: omap4+: Add DMM bindings Archit Taneja
2013-10-10 10:08 ` Mark Rutland
2013-10-10 10:36 ` Archit Taneja
2013-10-10 6:36 ` [PATCH v3 2/2] drm: omap: Enable DT support for DMM Archit Taneja
2013-10-15 7:04 ` [PATCH v4 0/2] DMM DT adaptation Archit Taneja
2013-10-15 7:04 ` [PATCH v4 1/2] arm: dts: omap4+: Add DMM bindings Archit Taneja
2014-03-11 7:15 ` Tomi Valkeinen
2014-03-11 8:14 ` Archit Taneja
2013-10-15 7:04 ` [PATCH v4 2/2] drm: omap: Enable DT support for DMM Archit Taneja
2013-11-01 0:40 ` Mark Rutland
2013-11-05 5:50 ` Archit Taneja
2013-12-17 10:02 ` [PATCH v5 0/2] DMM DT adaptation Archit Taneja
2013-12-17 10:02 ` [PATCH v5 1/2] arm: dts: omap4+: Add DMM bindings Archit Taneja
2014-03-02 19:53 ` Benoit Cousson
2013-12-17 10:02 ` [PATCH v5 2/2] drm: omap: Enable DT support for DMM Archit Taneja
2014-01-03 12:34 ` [PATCH v5 0/2] DMM DT adaptation Archit Taneja
2014-01-17 7:32 ` Archit Taneja
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=1379063679-4869-2-git-send-email-archit@ti.com \
--to=archit@ti.com \
--cc=andygro@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=robdclark@gmail.com \
--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).