Andy Gross | e2fb505 | 2012-05-23 15:08:10 -0500 | [diff] [blame] | 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> |
Rob Clark | 5e3b087 | 2012-10-29 09:31:12 +0100 | [diff] [blame] | 26 | #include <linux/platform_data/omap_drm.h> |
Andy Gross | e2fb505 | 2012-05-23 15:08:10 -0500 | [diff] [blame] | 27 | |
Rob Clark | 81f3ae0 | 2013-01-20 09:37:23 -0600 | [diff] [blame] | 28 | #include "soc.h" |
Archit Taneja | 7a59743 | 2013-09-16 12:48:29 +0530 | [diff] [blame] | 29 | #include "display.h" |
Andy Gross | e2fb505 | 2012-05-23 15:08:10 -0500 | [diff] [blame] | 30 | |
Archit Taneja | 7a59743 | 2013-09-16 12:48:29 +0530 | [diff] [blame] | 31 | #if defined(CONFIG_DRM_OMAP) || defined(CONFIG_DRM_OMAP_MODULE) |
Andy Gross | e2fb505 | 2012-05-23 15:08:10 -0500 | [diff] [blame] | 32 | |
Rob Clark | 5e3b087 | 2012-10-29 09:31:12 +0100 | [diff] [blame] | 33 | static struct omap_drm_platform_data platform_data; |
| 34 | |
Andy Gross | e2fb505 | 2012-05-23 15:08:10 -0500 | [diff] [blame] | 35 | static struct platform_device omap_drm_device = { |
| 36 | .dev = { |
| 37 | .coherent_dma_mask = DMA_BIT_MASK(32), |
Rob Clark | 5e3b087 | 2012-10-29 09:31:12 +0100 | [diff] [blame] | 38 | .platform_data = &platform_data, |
Andy Gross | e2fb505 | 2012-05-23 15:08:10 -0500 | [diff] [blame] | 39 | }, |
| 40 | .name = "omapdrm", |
| 41 | .id = 0, |
| 42 | }; |
| 43 | |
Archit Taneja | 7a59743 | 2013-09-16 12:48:29 +0530 | [diff] [blame] | 44 | int __init omap_init_drm(void) |
Andy Gross | e2fb505 | 2012-05-23 15:08:10 -0500 | [diff] [blame] | 45 | { |
Rob Clark | 81f3ae0 | 2013-01-20 09:37:23 -0600 | [diff] [blame] | 46 | platform_data.omaprev = GET_OMAP_TYPE; |
Rob Clark | 5e3b087 | 2012-10-29 09:31:12 +0100 | [diff] [blame] | 47 | |
Andy Gross | e2fb505 | 2012-05-23 15:08:10 -0500 | [diff] [blame] | 48 | return platform_device_register(&omap_drm_device); |
| 49 | |
| 50 | } |
Archit Taneja | 7a59743 | 2013-09-16 12:48:29 +0530 | [diff] [blame] | 51 | #else |
| 52 | int __init omap_init_drm(void) { return 0; } |
Andy Gross | e2fb505 | 2012-05-23 15:08:10 -0500 | [diff] [blame] | 53 | #endif |