aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/drm.c
diff options
context:
space:
mode:
authorAndy Gross <andy.gross@ti.com>2012-05-23 16:08:10 -0400
committerTony Lindgren <tony@atomide.com>2012-07-02 07:05:57 -0400
commite2fb50521c3811eddd60d911bc6d4d191f5d6e61 (patch)
tree32aed5a248041179d38b8ec9a619549382cac0e8 /arch/arm/mach-omap2/drm.c
parent6887a4131da3adaab011613776d865f4bcfb5678 (diff)
omap2+: add drm device
Register OMAP DRM/KMS platform device. DMM is split into a separate device using hwmod. Signed-off-by: Andy Gross <andy.gross@ti.com> Signed-off-by: Rob Clark <rob.clark@linaro.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/drm.c')
-rw-r--r--arch/arm/mach-omap2/drm.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c
new file mode 100644
index 000000000000..72e0f01b715c
--- /dev/null
+++ b/arch/arm/mach-omap2/drm.c
@@ -0,0 +1,61 @@
1/*
2 * DRM/KMS device registration for TI OMAP platforms
3 *
4 * Copyright (C) 2012 Texas Instruments
5 * Author: Rob Clark <rob.clark@linaro.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include <linux/module.h>
21#include <linux/kernel.h>
22#include <linux/mm.h>
23#include <linux/init.h>
24#include <linux/platform_device.h>
25#include <linux/dma-mapping.h>
26
27#include <plat/omap_device.h>
28#include <plat/omap_hwmod.h>
29
30#if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE)
31
32static struct platform_device omap_drm_device = {
33 .dev = {
34 .coherent_dma_mask = DMA_BIT_MASK(32),
35 },
36 .name = "omapdrm",
37 .id = 0,
38};
39
40static int __init omap_init_drm(void)
41{
42 struct omap_hwmod *oh = NULL;
43 struct platform_device *pdev;
44
45 /* lookup and populate the DMM information, if present - OMAP4+ */
46 oh = omap_hwmod_lookup("dmm");
47
48 if (oh) {
49 pdev = omap_device_build(oh->name, -1, oh, NULL, 0, NULL, 0,
50 false);
51 WARN(IS_ERR(pdev), "Could not build omap_device for %s\n",
52 oh->name);
53 }
54
55 return platform_device_register(&omap_drm_device);
56
57}
58
59arch_initcall(omap_init_drm);
60
61#endif