From patchwork Thu Oct 11 19:00:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Sharma X-Patchwork-Id: 1581731 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 8BBB4DFABE for ; Thu, 11 Oct 2012 10:51:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B20B9EEBC for ; Thu, 11 Oct 2012 03:51:27 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id D591F9E75F for ; Thu, 11 Oct 2012 02:39:51 -0700 (PDT) Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MBQ0057K2U4MON0@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 11 Oct 2012 18:39:50 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.123]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 8B.FC.03783.6E396705; Thu, 11 Oct 2012 18:39:50 +0900 (KST) X-AuditID: cbfee61a-b7f726d000000ec7-08-507693e66a8e Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id EA.FC.03783.6E396705; Thu, 11 Oct 2012 18:39:50 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MBQ004RI2TXZ250@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 11 Oct 2012 18:39:50 +0900 (KST) From: Rahul Sharma To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm: exynos: moved exynos drm device registration to drm driver Date: Fri, 12 Oct 2012 00:30:24 +0530 Message-id: <1349982025-3952-2-git-send-email-rahul.sharma@samsung.com> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1349982025-3952-1-git-send-email-rahul.sharma@samsung.com> References: <1349982025-3952-1-git-send-email-rahul.sharma@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLLMWRmVeSWpSXmKPExsWyRsSkWvfZ5LIAg9d7LC2ufH3P5sDocb/7 OFMAYxSXTUpqTmZZapG+XQJXxvd/d9gKfvBXfD/axtrAuJO3i5GTQ0LAROJvaxcLhC0mceHe erYuRi4OIYGljBJLb21k6mLkACuasS4BIj6dUWLB3lnsEM5qJol1b4+xgXSzCehKzD74jBHE FhFQlvg7cRUjSBGzQC+TxLz5h8GKhAXCJDZt2w+2jkVAVaJp3TFWEJtXwF3ixsNj7BBnKEi0 LjsEZnMKeEi032gEqxcCqrm7eglUr4DEt8mHWCCuk5XYdIAZZJeEwG02iQM3N0K9IylxcMUN lgmMwgsYGVYxiqYWJBcUJ6XnGuoVJ+YWl+al6yXn525iBIbh6X/PpHYwrmywOMQowMGoxMM7 cWVpgBBrYllxZe4hRgkOZiUR3su1ZQFCvCmJlVWpRfnxRaU5qcWHGH2ALpnILCWanA+MkbyS eENjE3NTY1NLIyMzU1McwkrivM0eKQFCAumJJanZqakFqUUw45g4OKUaGPc9fLWzL8N9nsuy Hewt6/xmz9smz6J17pyyRLJEd6hr9ocl594Uz1NxDu3fseQKf1fRYsnT1z/863gvED9lr0f+ Gp4tyU/0g2Y3lG38kaJvJO54Z9o+C6UrDUaFCWc5Qr/V9tx63Px0yxHJh6W1Gcx1N3xe8XWa dK/+p3dh0SSudhaz84Xlx5VYijMSDbWYi4oTAZbdECZwAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42I5/e+xoO6zyWUBBnum61tc+fqezYHR4373 caYAxqgGRpuM1MSU1CKF1Lzk/JTMvHRbJe/geOd4UzMDQ11DSwtzJYW8xNxUWyUXnwBdt8wc oLFKCmWJOaVAoYDE4mIlfTtME0JD3HQtYBojdH1DguB6jAzQQMIaxozv/+6wFfzgr/h+tI21 gXEnbxcjB4eEgInEjHUJXYycQKaYxIV769m6GLk4hASmM0os2DuLHcJZzSSx7u0xNpAqNgFd idkHnzGC2CICyhJ/J65iBCliFuhlkpg3/zBYkbBAmMSmbftZQGwWAVWJpnXHWEFsXgF3iRsP j7FDrFOQaF12CMzmFPCQaL/RCFYvBFRzd/USlgmMvAsYGVYxiqYWJBcUJ6XnGuoVJ+YWl+al 6yXn525iBAf5M6kdjCsbLA4xCnAwKvHwTlxZGiDEmlhWXJl7iFGCg1lJhPdybVmAEG9KYmVV alF+fFFpTmrxIUYfoKsmMkuJJucDIzCvJN7Q2MTc1NjU0sTCxMwSh7CSOG+zR0qAkEB6Yklq dmpqQWoRzDgmDk6pBsb9FsHBfnIWi5VP/IjslirNfbTu3eaa6dIPnlceFrggP+nvdPH8z5PL jza7XNjP+j40YmLsw+3PLG7Fsqse3rgs7EzrLF23T+Xrne+q1TPN3n3a7ebChY/P23bp+LNd jX1wyz+lmb1rsrWIjtWkTZffPhb0+r6G3fJc4f3osPfH9U3PCKd3LDmmxFKckWioxVxUnAgA w5ap4J8CAAA= X-CFilter-Loop: Reflected X-Mailman-Approved-At: Thu, 11 Oct 2012 03:50:19 -0700 Cc: t.stanislaws@samsung.com, joshi@samsung.com, kyungmin.park@samsung.com, thomas.ab@samsung.com, rahul.sharma@samsung.com, prashanth.g@samsung.com, s.shirish@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org This patch moved the exynos-drm platform device registration to the drm driver. When DT is enabled, platform devices needs to be registered within the driver code. This patch fits the requirement of both DT and Non DT based drm drivers. Signed-off-by: Rahul Sharma --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index d070719..4200f15 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -50,6 +50,9 @@ #define VBLANK_OFF_DELAY 50000 +/* platform device pointer for eynos drm device. */ +static struct platform_device *exynos_drm_pdev; + static int exynos_drm_load(struct drm_device *dev, unsigned long flags) { struct exynos_drm_private *private; @@ -280,6 +283,7 @@ static int exynos_drm_platform_probe(struct platform_device *pdev) { DRM_DEBUG_DRIVER("%s\n", __FILE__); + pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); exynos_drm_driver.num_ioctls = DRM_ARRAY_SIZE(exynos_ioctls); return drm_platform_init(&exynos_drm_driver, pdev); @@ -341,11 +345,21 @@ static int __init exynos_drm_init(void) ret = platform_driver_register(&exynos_drm_platform_driver); if (ret < 0) + goto out_drm; + + exynos_drm_pdev = platform_device_register_simple("exynos-drm", -1, + NULL, 0); + if (IS_ERR_OR_NULL(exynos_drm_pdev)) { + ret = PTR_ERR(exynos_drm_pdev); goto out; + } return 0; out: + platform_driver_unregister(&exynos_drm_platform_driver); + +out_drm: #ifdef CONFIG_DRM_EXYNOS_G2D platform_driver_unregister(&g2d_driver); out_g2d: @@ -376,6 +390,8 @@ static void __exit exynos_drm_exit(void) { DRM_DEBUG_DRIVER("%s\n", __FILE__); + platform_device_unregister(exynos_drm_pdev); + platform_driver_unregister(&exynos_drm_platform_driver); #ifdef CONFIG_DRM_EXYNOS_G2D