Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-nmw
[deliverable/linux.git] / arch / arm / mach-omap2 / drm.c
CommitLineData
e2fb5052
AG
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>
5e3b0874 26#include <linux/platform_data/omap_drm.h>
e2fb5052 27
81f3ae06 28#include "soc.h"
25c7d49e 29#include "omap_device.h"
2a296c8f 30#include "omap_hwmod.h"
e2fb5052
AG
31
32#if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE)
33
5e3b0874
RC
34static struct omap_drm_platform_data platform_data;
35
e2fb5052
AG
36static struct platform_device omap_drm_device = {
37 .dev = {
38 .coherent_dma_mask = DMA_BIT_MASK(32),
5e3b0874 39 .platform_data = &platform_data,
e2fb5052
AG
40 },
41 .name = "omapdrm",
42 .id = 0,
43};
44
45static int __init omap_init_drm(void)
46{
47 struct omap_hwmod *oh = NULL;
48 struct platform_device *pdev;
49
50 /* lookup and populate the DMM information, if present - OMAP4+ */
51 oh = omap_hwmod_lookup("dmm");
52
53 if (oh) {
c1d1cd59 54 pdev = omap_device_build(oh->name, -1, oh, NULL, 0);
e2fb5052
AG
55 WARN(IS_ERR(pdev), "Could not build omap_device for %s\n",
56 oh->name);
57 }
58
81f3ae06 59 platform_data.omaprev = GET_OMAP_TYPE;
5e3b0874 60
e2fb5052
AG
61 return platform_device_register(&omap_drm_device);
62
63}
64
b76c8b19 65omap_arch_initcall(omap_init_drm);
e2fb5052
AG
66
67#endif
This page took 0.119873 seconds and 5 git commands to generate.