From patchwork Fri Oct 12 16:00:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Sharma X-Patchwork-Id: 1585851 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 844964025F for ; Fri, 12 Oct 2012 09:01:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6BA98A0E0A for ; Fri, 12 Oct 2012 02:01:38 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E001A0D8A for ; Thu, 11 Oct 2012 23:32:50 -0700 (PDT) Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MBR00CRLOTZ66P0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 12 Oct 2012 15:32:32 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.123]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id E5.C0.18144.089B7705; Fri, 12 Oct 2012 15:32:32 +0900 (KST) X-AuditID: cbfee61b-b7fd46d0000046e0-92-5077b980c906 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 45.C0.18144.089B7705; Fri, 12 Oct 2012 15:32:32 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MBR00LMHOTLXQ10@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 12 Oct 2012 15:32:32 +0900 (KST) From: Rahul Sharma To: dri-devel@lists.freedesktop.org Subject: [PATCH v1 1/2] drm: exynos: moved exynos drm device registration to drm driver Date: Fri, 12 Oct 2012 21:30:39 +0530 Message-id: <1350057640-20984-2-git-send-email-rahul.sharma@samsung.com> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1350057640-20984-1-git-send-email-rahul.sharma@samsung.com> References: <1350057640-20984-1-git-send-email-rahul.sharma@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNLMWRmVeSWpSXmKPExsWyRsSkWrdhZ3mAQdt3OYsrX9+zOTB63O8+ zhTAGMVlk5Kak1mWWqRvl8CV8f3fHbaCH/wV34+2sTYw7uTtYuTkkBAwkfjwYyIrhC0mceHe erYuRi4OIYGljBLHfkxngil6vGg5I0RiEaPE9f61YB1CAquZJLZMSwax2QR0JWYffMYIYosI KEv8nbgKrIFZoJdJYt78w0BjOTiEBSIl+vbLgJgsAqoSDd2xIOW8Ah4S9+88YIbYpSDRuuwQ O4jNKeApMfnjLSaIVR4Suzs+gdksAgIS3yYfYgEZIyEgK7HpADPIJgmBy2wS/Q9boW6WlDi4 4gbLBEbhBYwMqxhFUwuSC4qT0nON9IoTc4tL89L1kvNzNzECQ/D0v2fSOxhXNVgcYhTgYFTi 4S1gKQ8QYk0sK67MPcQowcGsJMJ7sA8oxJuSWFmVWpQfX1Sak1p8iNEH6JKJzFKiyfnA+Mgr iTc0NjE3NTa1NDIyMzXFIawkztvskRIgJJCeWJKanZpakFoEM46Jg1OqgdEqTelY2VOrn/N+ MiQuLasyb40IN3khoih+qJjRLXCzZ8HX05Lb3prGc5u/MItxkXmgwdf+9or/+Xkb9zI6qT76 oHYpZ8bSrdVLPnnuybz6/cR7sep1Hw6I1nQvS/FkMZrbu5DxrXXnD0lp17XPZdsnHpBZEv71 +69Ajr3nRFeUcqb/5f7m5avEUpyRaKjFXFScCACxDCxrbgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupikeLIzCtJLcpLzFFi42I5/e+xgG7DzvIAgxdnRCyufH3P5sDocb/7 OFMAY1QDo01GamJKapFCal5yfkpmXrqtkndwvHO8qZmBoa6hpYW5kkJeYm6qrZKLT4CuW2YO 0FglhbLEnFKgUEBicbGSvh2mCaEhbroWMI0Rur4hQXA9RgZoIGENY8b3f3fYCn7wV3w/2sba wLiTt4uRk0NCwETi8aLljBC2mMSFe+vZuhi5OIQEFjFKXO9fywqSEBJYzSSxZVoyiM0moCsx ++AzsAYRAWWJvxNXMYI0MAv0MknMm38YqJuDQ1ggUqJvvwyIySKgKtHQHQtSzivgIXH/zgNm iF0KEq3LDrGD2JwCnhKTP95igljlIbG74xPTBEbeBYwMqxhFUwuSC4qT0nON9IoTc4tL89L1 kvNzNzGCA/yZ9A7GVQ0WhxgFOBiVeHgLWMoDhFgTy4orcw8xSnAwK4nwHuwDCvGmJFZWpRbl xxeV5qQWH2L0ATpqIrOUaHI+MPrySuINjU3MTY1NLU0sTMwscQgrifM2e6QECAmkJ5akZqem FqQWwYxj4uCUamDc5io/02pR0FHWpjufZ1XqLj7Lc6MyiLOz9cY9kbsP9zE2vBB0+XdKIeX5 qi0dPAbbOw3fSk9T2alf7C+2WsW+3ZYj741KHZPK4fYi8cXiQV2mp37fcA67mnugRU1sQjbP LrEmL5/T58UDvtoeURc4atzMWtS6rmKXI0uWQ5Yoe12OY/xmESWW4oxEQy3mouJEANUQlDid AgAA X-CFilter-Loop: Reflected X-Mailman-Approved-At: Fri, 12 Oct 2012 01:59:14 -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