aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--arch/arm/mach-omap2/Makefile4
-rw-r--r--arch/arm/mach-omap2/drm.c61
-rw-r--r--drivers/staging/omapdrm/omap_drv.h2
-rw-r--r--include/linux/platform_data/omap_drm.h (renamed from drivers/staging/omapdrm/omap_priv.h)19
4 files changed, 74 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index fa742f3c2629..a636cdc08876 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -189,6 +189,10 @@ endif
189# OMAP2420 MSDI controller integration support ("MMC") 189# OMAP2420 MSDI controller integration support ("MMC")
190obj-$(CONFIG_SOC_OMAP2420) += msdi.o 190obj-$(CONFIG_SOC_OMAP2420) += msdi.o
191 191
192ifneq ($(CONFIG_DRM_OMAP),)
193obj-y += drm.o
194endif
195
192# Specific board support 196# Specific board support
193obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o 197obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o
194obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o 198obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
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
diff --git a/drivers/staging/omapdrm/omap_drv.h b/drivers/staging/omapdrm/omap_drv.h
index f238d574da0c..2092a9167d29 100644
--- a/drivers/staging/omapdrm/omap_drv.h
+++ b/drivers/staging/omapdrm/omap_drv.h
@@ -25,8 +25,8 @@
25#include <linux/types.h> 25#include <linux/types.h>
26#include <drm/drmP.h> 26#include <drm/drmP.h>
27#include <drm/drm_crtc_helper.h> 27#include <drm/drm_crtc_helper.h>
28#include <linux/platform_data/omap_drm.h>
28#include "omap_drm.h" 29#include "omap_drm.h"
29#include "omap_priv.h"
30 30
31#define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__) 31#define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)
32#define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */ 32#define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */
diff --git a/drivers/staging/omapdrm/omap_priv.h b/include/linux/platform_data/omap_drm.h
index ef6441447147..3da73bdc2031 100644
--- a/drivers/staging/omapdrm/omap_priv.h
+++ b/include/linux/platform_data/omap_drm.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * include/drm/omap_priv.h 2 * DRM/KMS platform data for TI OMAP platforms
3 * 3 *
4 * Copyright (C) 2011 Texas Instruments 4 * Copyright (C) 2012 Texas Instruments
5 * Author: Rob Clark <rob@ti.com> 5 * Author: Rob Clark <rob.clark@linaro.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 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 8 * under the terms of the GNU General Public License version 2 as published by
@@ -17,13 +17,11 @@
17 * this program. If not, see <http://www.gnu.org/licenses/>. 17 * this program. If not, see <http://www.gnu.org/licenses/>.
18 */ 18 */
19 19
20#ifndef __OMAP_PRIV_H__ 20#ifndef __PLATFORM_DATA_OMAP_DRM_H__
21#define __OMAP_PRIV_H__ 21#define __PLATFORM_DATA_OMAP_DRM_H__
22 22
23/* Non-userspace facing APIs 23/*
24 */ 24 * Optional platform data to configure the default configuration of which
25
26/* optional platform data to configure the default configuration of which
27 * pipes/overlays/CRTCs are used.. if this is not provided, then instead the 25 * pipes/overlays/CRTCs are used.. if this is not provided, then instead the
28 * first CONFIG_DRM_OMAP_NUM_CRTCS are used, and they are each connected to 26 * first CONFIG_DRM_OMAP_NUM_CRTCS are used, and they are each connected to
29 * one manager, with priority given to managers that are connected to 27 * one manager, with priority given to managers that are connected to
@@ -49,7 +47,6 @@ struct omap_kms_platform_data {
49 47
50struct omap_drm_platform_data { 48struct omap_drm_platform_data {
51 struct omap_kms_platform_data *kms_pdata; 49 struct omap_kms_platform_data *kms_pdata;
52 struct omap_dmm_platform_data *dmm_pdata;
53}; 50};
54 51
55#endif /* __OMAP_DRM_H__ */ 52#endif /* __PLATFORM_DATA_OMAP_DRM_H__ */