From: Andy Gross Date: Mon, 25 Feb 2013 18:43:41 +0000 (+0200) Subject: omap2+: add drm device X-Git-Tag: sz_154~76 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=509287353b1766e719c983be2d653bcb2b8e5244 omap2+: add drm device Register OMAP DRM/KMS platform device. DMM is split into a separate device using hwmod. Signed-off-by: Andy Gross Signed-off-by: Rob Clark Signed-off-by: Tony Lindgren Conflicts: arch/arm/mach-omap2/Makefile drivers/staging/omapdrm/omap_drv.h include/linux/platform_data/omap_drm.h --- diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index b009f17dee56..d904d318e73c 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -184,6 +184,10 @@ ifneq ($(CONFIG_TIDSPBRIDGE),) obj-y += dsp.o endif +ifneq ($(CONFIG_DRM_OMAP),) +obj-y += drm.o +endif + # Specific board support obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o obj-$(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 @@ +/* + * DRM/KMS device registration for TI OMAP platforms + * + * Copyright (C) 2012 Texas Instruments + * Author: Rob Clark + * + * 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 . + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE) + +static struct platform_device omap_drm_device = { + .dev = { + .coherent_dma_mask = DMA_BIT_MASK(32), + }, + .name = "omapdrm", + .id = 0, +}; + +static int __init omap_init_drm(void) +{ + struct omap_hwmod *oh = NULL; + struct platform_device *pdev; + + /* lookup and populate the DMM information, if present - OMAP4+ */ + oh = omap_hwmod_lookup("dmm"); + + if (oh) { + pdev = omap_device_build(oh->name, -1, oh, NULL, 0, NULL, 0, + false); + WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", + oh->name); + } + + return platform_device_register(&omap_drm_device); + +} + +arch_initcall(omap_init_drm); + +#endif diff --git a/drivers/staging/omapdrm/omap_drv.h b/drivers/staging/omapdrm/omap_drv.h index c8f2752a4f18..504f3541a173 100644 --- a/drivers/staging/omapdrm/omap_drv.h +++ b/drivers/staging/omapdrm/omap_drv.h @@ -24,8 +24,9 @@ #include #include #include +#include +#include #include "omap_drm.h" -#include "omap_priv.h" #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__) #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 similarity index 78% rename from drivers/staging/omapdrm/omap_priv.h rename to include/linux/platform_data/omap_drm.h index f482d1edb060..ed5695346211 100644 --- a/drivers/staging/omapdrm/omap_priv.h +++ b/include/linux/platform_data/omap_drm.h @@ -1,8 +1,8 @@ /* - * include/drm/omap_priv.h + * DRM/KMS platform data for TI OMAP platforms * - * Copyright (C) 2011 Texas Instruments - * Author: Rob Clark + * Copyright (C) 2012 Texas Instruments + * Author: Rob Clark * * 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 @@ -17,13 +17,11 @@ * this program. If not, see . */ -#ifndef __OMAP_PRIV_H__ -#define __OMAP_PRIV_H__ +#ifndef __PLATFORM_DATA_OMAP_DRM_H__ +#define __PLATFORM_DATA_OMAP_DRM_H__ -/* Non-userspace facing APIs - */ - -/* optional platform data to configure the default configuration of which +/* + * Optional platform data to configure the default configuration of which * pipes/overlays/CRTCs are used.. if this is not provided, then instead the * first CONFIG_DRM_OMAP_NUM_CRTCS are used, and they are each connected to * one manager, with priority given to managers that are connected to @@ -39,4 +37,4 @@ struct omap_drm_platform_data { const char **dev_names; }; -#endif /* __OMAP_DRM_H__ */ +#endif /* __PLATFORM_DATA_OMAP_DRM_H__ */