diff options
| author | Rob Clark <rob@ti.com> | 2012-10-29 04:31:12 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-30 14:10:00 -0400 |
| commit | 5e3b08749951e5746d3e747f1ffae37eff2d08d5 (patch) | |
| tree | bfab9efe3cc06d1208ab4a1b7cc180154d07a91f | |
| parent | f68f5f20675a30197423cf79b42fd4f05b77af43 (diff) | |
staging: drm/omap: add support for ARCH_MULTIPLATFORM
Remove usage of plat/cpu.h and get information from platform data
instead. This enables omapdrm to be built with ARCH_MULTIPLATFORM.
Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | arch/arm/mach-omap2/drm.c | 7 | ||||
| -rw-r--r-- | drivers/staging/omapdrm/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/staging/omapdrm/omap_dmm_tiler.h | 1 | ||||
| -rw-r--r-- | drivers/staging/omapdrm/omap_drv.c | 6 | ||||
| -rw-r--r-- | drivers/staging/omapdrm/omap_drv.h | 2 | ||||
| -rw-r--r-- | include/linux/platform_data/omap_drm.h | 1 |
6 files changed, 16 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c index 72e0f01b715c..49a7ffb716a5 100644 --- a/arch/arm/mach-omap2/drm.c +++ b/arch/arm/mach-omap2/drm.c | |||
| @@ -23,15 +23,20 @@ | |||
| 23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
| 24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
| 25 | #include <linux/dma-mapping.h> | 25 | #include <linux/dma-mapping.h> |
| 26 | #include <linux/platform_data/omap_drm.h> | ||
| 26 | 27 | ||
| 27 | #include <plat/omap_device.h> | 28 | #include <plat/omap_device.h> |
| 28 | #include <plat/omap_hwmod.h> | 29 | #include <plat/omap_hwmod.h> |
| 30 | #include <plat/cpu.h> | ||
| 29 | 31 | ||
| 30 | #if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE) | 32 | #if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE) |
| 31 | 33 | ||
| 34 | static struct omap_drm_platform_data platform_data; | ||
| 35 | |||
| 32 | static struct platform_device omap_drm_device = { | 36 | static struct platform_device omap_drm_device = { |
| 33 | .dev = { | 37 | .dev = { |
| 34 | .coherent_dma_mask = DMA_BIT_MASK(32), | 38 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 39 | .platform_data = &platform_data, | ||
| 35 | }, | 40 | }, |
| 36 | .name = "omapdrm", | 41 | .name = "omapdrm", |
| 37 | .id = 0, | 42 | .id = 0, |
| @@ -52,6 +57,8 @@ static int __init omap_init_drm(void) | |||
| 52 | oh->name); | 57 | oh->name); |
| 53 | } | 58 | } |
| 54 | 59 | ||
| 60 | platform_data.omaprev = GET_OMAP_REVISION(); | ||
| 61 | |||
| 55 | return platform_device_register(&omap_drm_device); | 62 | return platform_device_register(&omap_drm_device); |
| 56 | 63 | ||
| 57 | } | 64 | } |
diff --git a/drivers/staging/omapdrm/Kconfig b/drivers/staging/omapdrm/Kconfig index 81a7cba4a0c5..b724a4131435 100644 --- a/drivers/staging/omapdrm/Kconfig +++ b/drivers/staging/omapdrm/Kconfig | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | config DRM_OMAP | 2 | config DRM_OMAP |
| 3 | tristate "OMAP DRM" | 3 | tristate "OMAP DRM" |
| 4 | depends on DRM && !CONFIG_FB_OMAP2 | 4 | depends on DRM && !CONFIG_FB_OMAP2 |
| 5 | depends on ARCH_OMAP2PLUS | 5 | depends on ARCH_OMAP2PLUS || ARCH_MULTIPLATFORM |
| 6 | select DRM_KMS_HELPER | 6 | select DRM_KMS_HELPER |
| 7 | select OMAP2_DSS | 7 | select OMAP2_DSS |
| 8 | select FB_SYS_FILLRECT | 8 | select FB_SYS_FILLRECT |
diff --git a/drivers/staging/omapdrm/omap_dmm_tiler.h b/drivers/staging/omapdrm/omap_dmm_tiler.h index c0271a2ac877..4fdd61e54bd2 100644 --- a/drivers/staging/omapdrm/omap_dmm_tiler.h +++ b/drivers/staging/omapdrm/omap_dmm_tiler.h | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #ifndef OMAP_DMM_TILER_H | 16 | #ifndef OMAP_DMM_TILER_H |
| 17 | #define OMAP_DMM_TILER_H | 17 | #define OMAP_DMM_TILER_H |
| 18 | 18 | ||
| 19 | #include <plat/cpu.h> | ||
| 20 | #include "omap_drv.h" | 19 | #include "omap_drv.h" |
| 21 | #include "tcm.h" | 20 | #include "tcm.h" |
| 22 | 21 | ||
diff --git a/drivers/staging/omapdrm/omap_drv.c b/drivers/staging/omapdrm/omap_drv.c index 09653b88e0ec..6ae2f763b27a 100644 --- a/drivers/staging/omapdrm/omap_drv.c +++ b/drivers/staging/omapdrm/omap_drv.c | |||
| @@ -417,13 +417,14 @@ static void omap_modeset_free(struct drm_device *dev) | |||
| 417 | static int ioctl_get_param(struct drm_device *dev, void *data, | 417 | static int ioctl_get_param(struct drm_device *dev, void *data, |
| 418 | struct drm_file *file_priv) | 418 | struct drm_file *file_priv) |
| 419 | { | 419 | { |
| 420 | struct omap_drm_private *priv = dev->dev_private; | ||
| 420 | struct drm_omap_param *args = data; | 421 | struct drm_omap_param *args = data; |
| 421 | 422 | ||
| 422 | DBG("%p: param=%llu", dev, args->param); | 423 | DBG("%p: param=%llu", dev, args->param); |
| 423 | 424 | ||
| 424 | switch (args->param) { | 425 | switch (args->param) { |
| 425 | case OMAP_PARAM_CHIPSET_ID: | 426 | case OMAP_PARAM_CHIPSET_ID: |
| 426 | args->value = GET_OMAP_TYPE; | 427 | args->value = priv->omaprev; |
| 427 | break; | 428 | break; |
| 428 | default: | 429 | default: |
| 429 | DBG("unknown parameter %lld", args->param); | 430 | DBG("unknown parameter %lld", args->param); |
| @@ -555,6 +556,7 @@ struct drm_ioctl_desc ioctls[DRM_COMMAND_END - DRM_COMMAND_BASE] = { | |||
| 555 | */ | 556 | */ |
| 556 | static int dev_load(struct drm_device *dev, unsigned long flags) | 557 | static int dev_load(struct drm_device *dev, unsigned long flags) |
| 557 | { | 558 | { |
| 559 | struct omap_drm_platform_data *pdata = dev->dev->platform_data; | ||
| 558 | struct omap_drm_private *priv; | 560 | struct omap_drm_private *priv; |
| 559 | int ret; | 561 | int ret; |
| 560 | 562 | ||
| @@ -566,6 +568,8 @@ static int dev_load(struct drm_device *dev, unsigned long flags) | |||
| 566 | return -ENOMEM; | 568 | return -ENOMEM; |
| 567 | } | 569 | } |
| 568 | 570 | ||
| 571 | priv->omaprev = pdata->omaprev; | ||
| 572 | |||
| 569 | dev->dev_private = priv; | 573 | dev->dev_private = priv; |
| 570 | 574 | ||
| 571 | priv->wq = alloc_ordered_workqueue("omapdrm", 0); | 575 | priv->wq = alloc_ordered_workqueue("omapdrm", 0); |
diff --git a/drivers/staging/omapdrm/omap_drv.h b/drivers/staging/omapdrm/omap_drv.h index 9dc72d143ff3..8f7c447930fa 100644 --- a/drivers/staging/omapdrm/omap_drv.h +++ b/drivers/staging/omapdrm/omap_drv.h | |||
| @@ -40,6 +40,8 @@ | |||
| 40 | #define MAX_MAPPERS 2 | 40 | #define MAX_MAPPERS 2 |
| 41 | 41 | ||
| 42 | struct omap_drm_private { | 42 | struct omap_drm_private { |
| 43 | uint32_t omaprev; | ||
| 44 | |||
| 43 | unsigned int num_crtcs; | 45 | unsigned int num_crtcs; |
| 44 | struct drm_crtc *crtcs[8]; | 46 | struct drm_crtc *crtcs[8]; |
| 45 | 47 | ||
diff --git a/include/linux/platform_data/omap_drm.h b/include/linux/platform_data/omap_drm.h index 3da73bdc2031..f4e4a237ebd2 100644 --- a/include/linux/platform_data/omap_drm.h +++ b/include/linux/platform_data/omap_drm.h | |||
| @@ -46,6 +46,7 @@ struct omap_kms_platform_data { | |||
| 46 | }; | 46 | }; |
| 47 | 47 | ||
| 48 | struct omap_drm_platform_data { | 48 | struct omap_drm_platform_data { |
| 49 | uint32_t omaprev; | ||
| 49 | struct omap_kms_platform_data *kms_pdata; | 50 | struct omap_kms_platform_data *kms_pdata; |
| 50 | }; | 51 | }; |
| 51 | 52 | ||
