#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
+#include <linux/platform_data/omap_drm.h>
#include <plat/omap_device.h>
#include <plat/omap_hwmod.h>
+#include <plat/cpu.h>
#if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE)
+static struct omap_drm_platform_data platform_data;
+
static struct platform_device omap_drm_device = {
.dev = {
.coherent_dma_mask = DMA_BIT_MASK(32),
+ .platform_data = &platform_data,
},
.name = "omapdrm",
.id = 0,
oh->name);
}
+ platform_data.omaprev = GET_OMAP_REVISION();
+
return platform_device_register(&omap_drm_device);
}
static int ioctl_get_param(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
+ struct omap_drm_private *priv = dev->dev_private;
struct drm_omap_param *args = data;
DBG("%p: param=%llu", dev, args->param);
switch (args->param) {
case OMAP_PARAM_CHIPSET_ID:
- args->value = GET_OMAP_TYPE;
+ args->value = priv->omaprev;
break;
default:
DBG("unknown parameter %lld", args->param);
*/
static int dev_load(struct drm_device *dev, unsigned long flags)
{
+ struct omap_drm_platform_data *pdata = dev->dev->platform_data;
struct omap_drm_private *priv;
int ret;
return -ENOMEM;
}
+ priv->omaprev = pdata->omaprev;
+
dev->dev_private = priv;
priv->wq = alloc_ordered_workqueue("omapdrm", 0);