blob: ab8a0e64c5f7fa12e0be877588fd9eb5f0b1d57b [file] [log] [blame]
Andy Grosse2fb5052012-05-23 15:08:10 -05001/*
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>
Rob Clark5e3b0872012-10-29 09:31:12 +010026#include <linux/platform_data/omap_drm.h>
Andy Grosse2fb5052012-05-23 15:08:10 -050027
Tony Lindgren25c7d492012-10-02 17:25:48 -070028#include "omap_device.h"
Tony Lindgren2a296c82012-10-02 17:41:35 -070029#include "omap_hwmod.h"
Andy Grosse2fb5052012-05-23 15:08:10 -050030
31#if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE)
32
Rob Clark5e3b0872012-10-29 09:31:12 +010033static struct omap_drm_platform_data platform_data;
34
Andy Grosse2fb5052012-05-23 15:08:10 -050035static struct platform_device omap_drm_device = {
36 .dev = {
37 .coherent_dma_mask = DMA_BIT_MASK(32),
Rob Clark5e3b0872012-10-29 09:31:12 +010038 .platform_data = &platform_data,
Andy Grosse2fb5052012-05-23 15:08:10 -050039 },
40 .name = "omapdrm",
41 .id = 0,
42};
43
44static int __init omap_init_drm(void)
45{
46 struct omap_hwmod *oh = NULL;
47 struct platform_device *pdev;
48
49 /* lookup and populate the DMM information, if present - OMAP4+ */
50 oh = omap_hwmod_lookup("dmm");
51
52 if (oh) {
53 pdev = omap_device_build(oh->name, -1, oh, NULL, 0, NULL, 0,
54 false);
55 WARN(IS_ERR(pdev), "Could not build omap_device for %s\n",
56 oh->name);
57 }
58
Rob Clark5e3b0872012-10-29 09:31:12 +010059 platform_data.omaprev = GET_OMAP_REVISION();
60
Andy Grosse2fb5052012-05-23 15:08:10 -050061 return platform_device_register(&omap_drm_device);
62
63}
64
Tony Lindgrenb76c8b12013-01-11 11:24:18 -080065omap_arch_initcall(omap_init_drm);
Andy Grosse2fb5052012-05-23 15:08:10 -050066
67#endif