drm.c 1.4 KB
Newer Older
A
Andy Gross 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
/*
 * 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>
26
#include <linux/platform_data/omap_drm.h>
A
Andy Gross 已提交
27

28
#include "soc.h"
29
#include "display.h"
A
Andy Gross 已提交
30

31
#if IS_ENABLED(CONFIG_DRM_OMAP)
A
Andy Gross 已提交
32

33 34
static struct omap_drm_platform_data platform_data;

A
Andy Gross 已提交
35 36 37
static struct platform_device omap_drm_device = {
	.dev = {
		.coherent_dma_mask = DMA_BIT_MASK(32),
38
		.platform_data = &platform_data,
A
Andy Gross 已提交
39 40 41 42 43
	},
	.name = "omapdrm",
	.id = 0,
};

44
int __init omap_init_drm(void)
A
Andy Gross 已提交
45
{
46
	platform_data.omaprev = GET_OMAP_TYPE;
47

A
Andy Gross 已提交
48 49 50
	return platform_device_register(&omap_drm_device);

}
51 52
#else
int __init omap_init_drm(void) { return 0; }
A
Andy Gross 已提交
53
#endif