From patchwork Tue Apr 23 05:02:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seung-Woo Kim X-Patchwork-Id: 2475401 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 97D3C3FD1A for ; Tue, 23 Apr 2013 05:03:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2AFE7E610C for ; Mon, 22 Apr 2013 22:03:06 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by gabe.freedesktop.org (Postfix) with ESMTP id 661EBE5FAE for ; Mon, 22 Apr 2013 22:02:53 -0700 (PDT) Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MLO00NTRZC94QF0@mailout3.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 23 Apr 2013 14:02:52 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.114]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id B2.30.21454.BF516715; Tue, 23 Apr 2013 14:02:52 +0900 (KST) X-AuditID: cbfee68e-b7f0d6d0000053ce-1e-517615fbd8fc Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 09.3A.10837.BF516715; Tue, 23 Apr 2013 14:02:51 +0900 (KST) Received: from localhost.localdomain ([10.90.8.56]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MLO001IMZCP9Y40@mmp2.samsung.com>; Tue, 23 Apr 2013 14:02:51 +0900 (KST) From: Seung-Woo Kim To: dri-devel@lists.freedesktop.org, inki.dae@samsung.com Subject: [PATCH] drm/exynos: added ipp device registration to drm driver Date: Tue, 23 Apr 2013 14:02:53 +0900 Message-id: <1366693373-13236-1-git-send-email-sw0312.kim@samsung.com> X-Mailer: git-send-email 1.7.4.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBLMWRmVeSWpSXmKPExsWyRsSkSPePaFmgwbYai95zJ5ksXh6czW5x /bydxZWv79ksJt2fwGKxeIutxdmmN+wWMya/ZHPg8Nj+7QGrx/3u40wefVtWMQYwR3HZpKTm ZJalFunbJXBl7GrfyVZwWKbi7K55rA2M+yS6GDk5JARMJP7cfsEGYYtJXLi3Hsjm4hASWMoo sfv2I2aYovMrYBLTGSUuPZsK5TQzSSzZPAGsik1AR2L/kt+sILaIgKXEg62/weLMAv2MEnOv 6YHYwgIeEkdm3QOLswioSkzt+sUCYvMKuEk8u7WYFWKbgsSCe2/BFkgIfGaT2NP+mQWiQUDi 2+RDQDYHUEJWYtMBqOskJQ6uuMEygVFwASPDKkbR1ILkguKk9CIjveLE3OLSvHS95PzcTYzA UD3971nfDsabB6wPMSYDjZvILCWanA8M9bySeENjMyMLUxNTYyNzSzPShJXEedVarAOFBNIT S1KzU1MLUovii0pzUosPMTJxcEo1MJpcmVqnHpFlem/v7Edm8zZuYZR/bZFVKnE8e5u+vX3u 9wjJlIr0bwtFZl9cW/6/IGabwPeox06TPxpFpofYxjVIb26f69t9riT7aKav8l3e/3wb6za8 3Dfj1HPRLayTP9V+/eIT7MuVuWem2qTDTkmv/LfUS2kqyXNdzjMNft9tIbwzY1KirBJLcUai oRZzUXEiAFjUcOBrAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRmVeSWpSXmKPExsVy+t9jQd3fomWBBvcOmFr0njvJZPHy4Gx2 i+vn7SyufH3PZjHp/gQWi8VbbC3ONr1ht5gx+SWbA4fH9m8PWD3udx9n8ujbsooxgDmqgdEm IzUxJbVIITUvOT8lMy/dVsk7ON453tTMwFDX0NLCXEkhLzE31VbJxSdA1y0zB+gCJYWyxJxS oFBAYnGxkr4dpgmhIW66FjCNEbq+IUFwPUYGaCBhDWPGrvadbAWHZSrO7prH2sC4T6KLkZND QsBE4vyK9WwQtpjEhXsgNheHkMB0RolLz6ZCOc1MEks2T2AGqWIT0JHYv+Q3K4gtImAp8WDr b7A4s0A/o8Tca3ogtrCAh8SRWffA4iwCqhJTu36xgNi8Am4Sz24tZoXYpiCx4N5btgmM3AsY GVYxiqYWJBcUJ6XnGuoVJ+YWl+al6yXn525iBMfCM6kdjCsbLA4xCnAwKvHwCriXBgqxJpYV V+YeYpTgYFYS4f0qUhYoxJuSWFmVWpQfX1Sak1p8iDEZaPtEZinR5HxgnOaVxBsam5gZWRqZ G1oYGZuTJqwkznug1TpQSCA9sSQ1OzW1ILUIZgsTB6dUA2P51YPeHVzpG0xMlb3WbXk9czWj tgGfrWVIp3+oLfu7248rDdXNYjqStOeoXz4rkLf/ivcBb9sNC37+bF+3v2fqq4eZs00d1k2Y 56ucvvnxp4gbPTZen54sqpyeop7kU75GykiZW+a/jc8++e2ri6pSZqTW8FyRTrW4wxO3vEF0 hVTSi/OdZ5VYijMSDbWYi4oTAQ4jR3DJAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: sw0312.kim@samsung.com, dh09.lee@samsung.com, jy0.jeon@samsung.com, kyungmin.park@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 added exynos-drm-ipp platform device registration to the exynos drm driver. When DT is enabled, platform devices need to be registered within the driver code. This patch fits the requirement of both DT and Non DT based drm drivers. Signed-off-by: Seung-Woo Kim Signed-off-by: Donghwa Lee --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 7 +++++++ drivers/gpu/drm/exynos/exynos_drm_drv.h | 10 ++++++++++ drivers/gpu/drm/exynos/exynos_drm_ipp.c | 27 +++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 3da5c2d..4ef6fa0 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -380,6 +380,10 @@ static int __init exynos_drm_init(void) ret = platform_driver_register(&ipp_driver); if (ret < 0) goto out_ipp; + + ret = exynos_platform_device_ipp_register(); + if (ret < 0) + goto out_ipp_dev; #endif ret = platform_driver_register(&exynos_drm_platform_driver); @@ -400,6 +404,8 @@ out: out_drm: #ifdef CONFIG_DRM_EXYNOS_IPP + exynos_platform_device_ipp_unregister(); +out_ipp_dev: platform_driver_unregister(&ipp_driver); out_ipp: #endif @@ -456,6 +462,7 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(&exynos_drm_platform_driver); #ifdef CONFIG_DRM_EXYNOS_IPP + exynos_platform_device_ipp_unregister(); platform_driver_unregister(&ipp_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 4606fac..b09ee2e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -329,6 +329,16 @@ extern int exynos_platform_device_hdmi_register(void); */ void exynos_platform_device_hdmi_unregister(void); +/* + * this function registers exynos drm ipp platform device. + */ +int exynos_platform_device_ipp_register(void); + +/* + * this function unregisters exynos drm ipp platform device if it exists. + */ +void exynos_platform_device_ipp_unregister(void); + extern struct platform_driver fimd_driver; extern struct platform_driver hdmi_driver; extern struct platform_driver mixer_driver; diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 1adce07..29d2ad3 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -47,6 +47,9 @@ #define get_ipp_context(dev) platform_get_drvdata(to_platform_device(dev)) #define ipp_is_m2m_cmd(c) (c == IPP_CMD_M2M) +/* platform device pointer for ipp device. */ +static struct platform_device *exynos_drm_ipp_pdev; + /* * A structure of event. * @@ -102,6 +105,30 @@ static LIST_HEAD(exynos_drm_ippdrv_list); static DEFINE_MUTEX(exynos_drm_ippdrv_lock); static BLOCKING_NOTIFIER_HEAD(exynos_drm_ippnb_list); +int exynos_platform_device_ipp_register(void) +{ + struct platform_device *pdev; + + if (exynos_drm_ipp_pdev) + return -EEXIST; + + pdev = platform_device_register_simple("exynos-drm-ipp", -1, NULL, 0); + if (IS_ERR(pdev)) + return PTR_ERR(pdev); + + exynos_drm_ipp_pdev = pdev; + + return 0; +} + +void exynos_platform_device_ipp_unregister(void) +{ + if (exynos_drm_ipp_pdev) { + platform_device_unregister(exynos_drm_ipp_pdev); + exynos_drm_ipp_pdev = NULL; + } +} + int exynos_drm_ippdrv_register(struct exynos_drm_ippdrv *ippdrv) { DRM_DEBUG_KMS("%s\n", __func__);