From patchwork Mon Oct 29 08:31:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 12556 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 1FF9D23F6F for ; Mon, 29 Oct 2012 08:31:29 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id C6018A189ED for ; Mon, 29 Oct 2012 08:31:28 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so5967665iej.11 for ; Mon, 29 Oct 2012 01:31:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :dkim-signature:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=1FmeFWAJ4iP/+U/mFLbEi7aV0/7EgPaKSxjIUGZZg84=; b=cKaO2Jlfr4E4Gd/obygj0kpUnJKO/GU24WHNTnKkEJ3IceIvv0ot/EHl5xxs53QqKl 0gxvlo+YqQdHeiKCW2+DMSh1n9NO9dUiQbLs3uYpPx0H3yYwxnvpz2mkj2i8NwGtiBEk E5MDWEdwoYl/ttinEy3Sf5bvfrjRiTduLus8SRe4elNISkdUnTND7vpV3/xzR+NVG0i4 9Pro8L/dgp7+/63JxmnjVZ5z8fEPi/g5W6AlL9lX/xT8DxVXaaLwAM4Bxu6RYPzVT/db 9vihy0CV8jXaZ1D82x6denwW/DrrzyrTdxgVeQPxfMWVJ6Zm1B+pc46/ejq1q66Jmxs7 kHLw== Received: by 10.50.168.37 with SMTP id zt5mr8628588igb.57.1351499488534; Mon, 29 Oct 2012 01:31:28 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp164520igt; Mon, 29 Oct 2012 01:31:27 -0700 (PDT) Received: by 10.204.129.23 with SMTP id m23mr9113270bks.20.1351499487273; Mon, 29 Oct 2012 01:31:27 -0700 (PDT) Received: from mail-bk0-f50.google.com (mail-bk0-f50.google.com [209.85.214.50]) by mx.google.com with ESMTPS id fq15si12308360bkc.140.2012.10.29.01.31.26 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Oct 2012 01:31:27 -0700 (PDT) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.214.50 as permitted sender) client-ip=209.85.214.50; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.214.50 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass header.i=@gmail.com Received: by mail-bk0-f50.google.com with SMTP id q16so1919559bkw.37 for ; Mon, 29 Oct 2012 01:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=1FmeFWAJ4iP/+U/mFLbEi7aV0/7EgPaKSxjIUGZZg84=; b=gKy45rV4ugxuo0DxYo1iWG0UEWtOi6FbBgqGSlaQP1uomH5ebcGcKiw7dL224sHKcp t46bW/y6Uf4lVig8e08SyR18mU7vkXwgcUTOS6egZVz/xJjjZmerSEdhh7m+OqsBX3Ib YZLzoW3OuqUtclCk28T24gT2Khn3W1AH2fgMj5bCoJ7zGq0ktS5n8ai2ak71dAkHN3VN 695MobIpDKE3gZJSgT9k8M6JNsB/OahiTsaN5EJjbU4xshTn2uEKyulW+gO0v3UN88nz 7Mw8pS7xwfoezRMW+eZoLmDKR73pnwMATjTzAwOHbfkPi6yMOWpzuBiDyMACA+gjUW1P /rAg== Received: by 10.204.7.136 with SMTP id d8mr8848181bkd.85.1351499486608; Mon, 29 Oct 2012 01:31:26 -0700 (PDT) Received: from localhost ([91.224.175.20]) by mx.google.com with ESMTPS id g8sm3188918bkv.6.2012.10.29.01.31.25 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Oct 2012 01:31:25 -0700 (PDT) Sender: Rob Clark From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: patches@linaro.org, Greg KH , Tomi Valkeinen , Andy Gross , inki.dae@samsung.com, s.hauer@pengutronix.de, Rob Clark Subject: [PATCH 1/3] drm/omap: add support for ARCH_MULTIPLATFORM Date: Mon, 29 Oct 2012 09:31:12 +0100 Message-Id: <1351499474-5937-2-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1351499474-5937-1-git-send-email-rob.clark@linaro.org> References: <1351499474-5937-1-git-send-email-rob.clark@linaro.org> X-Gm-Message-State: ALoCoQkz+1U7CG9mrFVqLsGQ8taohrmFRoq1SJ9LsJJdtqXKdxygqEguUp8HesbKG2kUmwVKi+J1 From: Rob Clark 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 --- arch/arm/mach-omap2/drm.c | 7 +++++++ drivers/staging/omapdrm/Kconfig | 2 +- drivers/staging/omapdrm/omap_dmm_tiler.h | 1 - drivers/staging/omapdrm/omap_drv.c | 6 +++++- drivers/staging/omapdrm/omap_drv.h | 2 ++ 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 72e0f01b..49a7ffb 100644 --- a/arch/arm/mach-omap2/drm.c +++ b/arch/arm/mach-omap2/drm.c @@ -23,15 +23,20 @@ #include #include #include +#include #include #include +#include #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, @@ -52,6 +57,8 @@ static int __init omap_init_drm(void) oh->name); } + platform_data.omaprev = GET_OMAP_REVISION(); + return platform_device_register(&omap_drm_device); } diff --git a/drivers/staging/omapdrm/Kconfig b/drivers/staging/omapdrm/Kconfig index 81a7cba..b724a41 100644 --- a/drivers/staging/omapdrm/Kconfig +++ b/drivers/staging/omapdrm/Kconfig @@ -2,7 +2,7 @@ config DRM_OMAP tristate "OMAP DRM" depends on DRM && !CONFIG_FB_OMAP2 - depends on ARCH_OMAP2PLUS + depends on ARCH_OMAP2PLUS || ARCH_MULTIPLATFORM select DRM_KMS_HELPER select OMAP2_DSS select FB_SYS_FILLRECT diff --git a/drivers/staging/omapdrm/omap_dmm_tiler.h b/drivers/staging/omapdrm/omap_dmm_tiler.h index c0271a2..4fdd61e 100644 --- a/drivers/staging/omapdrm/omap_dmm_tiler.h +++ b/drivers/staging/omapdrm/omap_dmm_tiler.h @@ -16,7 +16,6 @@ #ifndef OMAP_DMM_TILER_H #define OMAP_DMM_TILER_H -#include #include "omap_drv.h" #include "tcm.h" diff --git a/drivers/staging/omapdrm/omap_drv.c b/drivers/staging/omapdrm/omap_drv.c index c27d091..4f5b4c7 100644 --- a/drivers/staging/omapdrm/omap_drv.c +++ b/drivers/staging/omapdrm/omap_drv.c @@ -278,13 +278,14 @@ static void omap_modeset_free(struct drm_device *dev) 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); @@ -416,6 +417,7 @@ struct drm_ioctl_desc ioctls[DRM_COMMAND_END - DRM_COMMAND_BASE] = { */ 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; @@ -427,6 +429,8 @@ static int dev_load(struct drm_device *dev, unsigned long flags) return -ENOMEM; } + priv->omaprev = pdata->omaprev; + dev->dev_private = priv; priv->wq = alloc_ordered_workqueue("omapdrm", 0); diff --git a/drivers/staging/omapdrm/omap_drv.h b/drivers/staging/omapdrm/omap_drv.h index 834b4f1..b2f1751 100644 --- a/drivers/staging/omapdrm/omap_drv.h +++ b/drivers/staging/omapdrm/omap_drv.h @@ -89,6 +89,8 @@ int omap_irq_wait(struct drm_device *dev, struct omap_irq_wait *wait, unsigned long timeout); struct omap_drm_private { + uint32_t omaprev; + unsigned int num_crtcs; struct drm_crtc *crtcs[8]; diff --git a/include/linux/platform_data/omap_drm.h b/include/linux/platform_data/omap_drm.h index 3da73bdc..f4e4a237 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 { }; struct omap_drm_platform_data { + uint32_t omaprev; struct omap_kms_platform_data *kms_pdata; };