From patchwork Thu Feb 7 12:12:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Sharma X-Patchwork-Id: 2110181 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id A3F01DFB7B for ; Thu, 7 Feb 2013 11:52:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755390Ab3BGLwY (ORCPT ); Thu, 7 Feb 2013 06:52:24 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:40137 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752617Ab3BGLwX (ORCPT ); Thu, 7 Feb 2013 06:52:23 -0500 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MHU00EE1MB9NPW0@mailout4.samsung.com>; Thu, 07 Feb 2013 20:52:21 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.123]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id A3.BB.03918.57593115; Thu, 07 Feb 2013 20:52:21 +0900 (KST) X-AuditID: cbfee61a-b7f7d6d000000f4e-8a-511395752d17 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 42.BB.03918.57593115; Thu, 07 Feb 2013 20:52:21 +0900 (KST) Received: from chrome-ubuntu.sisodomain.com ([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 <0MHU0090BM8VJG30@mmp2.samsung.com>; Thu, 07 Feb 2013 20:52:21 +0900 (KST) From: Rahul Sharma To: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, alsa-devel@alsa-project.org, linux-fbdev@vger.kernel.org Cc: tomi.valkeinen@ti.com, laurent.pinchart@ideasonboard.com, broonie@opensource.wolfsonmicro.com, inki.dae@samsung.com, kyungmin.park@samsung.com, r.sh.open@gmail.com, joshi@samsung.com Subject: [RFC PATCH v2 3/5] drm/exynos: moved drm hdmi driver to cdf framework Date: Thu, 07 Feb 2013 07:12:10 -0500 Message-id: <1360239132-15557-1-git-send-email-rahul.sharma@samsung.com> X-Mailer: git-send-email 1.8.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRmVeSWpSXmKPExsWyRsSkWrd0qnCgwbaFRhYn+j6wWvRs2Mrq wOTxeZNcAGMUl01Kak5mWWqRvl0CV8b/N89ZC372MFXse7iCsYHxwT3GLkZODgkBE4nu6b/Y IGwxiQv31oPZQgJLGSW2z5WCqTk74TFLFyMXUHw6o0Tfoj9QTi+TxNG9N8EmsQnoSsw++AzM FhGokZj7dQcbSBGzwD5GiZnNN9lBEsICfhKr34F0c3KwCKhKrP/2CCzOK+AhsePcVagz5CQ+ 7AGJcwHZB9gkLu3ewgrRICDxbfIhoGYOoISsxKYDzBD1khIHV9xgmcAouICRYRWjaGpBckFx UnquoV5xYm5xaV66XnJ+7iZGYIid/vdMagfjygaLQ4wCHIxKPLw3lgoFCrEmlhVX5h5ilOBg VhLhPVkjHCjEm5JYWZValB9fVJqTWnyIMRlo+URmKdHkfGD455XEGxqbmJsam1oaGZmZmpIm rCTOy3jqSYCQQHpiSWp2ampBahHMFiYOTqkGRsZFc9r+8dZUqsU0l2zp38/Mb8e1MuG6m6aT Y6T4A5+e+As/VcJMlrbud7I+XVzfa7b5/ktbG8HvX/4Y38pxn71Gu/7xbq22F5WfcqSm3Zw6 4fWnRrWcA5zXWtcnBb4Kb9m+71JKyO+em0ysauyKa+59fZTPfLtvlovyoikp+4uEWpTYN8l4 K7EUZyQaajEXFScCAM7d5iN1AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprEIsWRmVeSWpSXmKPExsVy+t9jQd3SqcKBBitPSlqc6PvAatGzYSur A5PH501yAYxRDYw2GamJKalFCql5yfkpmXnptkrewfHO8aZmBoa6hpYW5koKeYm5qbZKLj4B um6ZOUCjlRTKEnNKgUIBicXFSvp2mCaEhrjpWsA0Ruj6hgTB9RgZoIGENYwZ/988Zy342cNU se/hCsYGxgf3GLsYOTkkBEwkzk54zAJhi0lcuLeerYuRi0NIYDqjRN+iPywQTi+TxNG9N8E6 2AR0JWYffAZmiwjUSMz9ugOsg1lgH6PEzOab7CAJYQE/idXv/oCNZRFQlVj/7RFYnFfAQ2LH uatsEOvkJD7secQ+gZF7ASPDKkbR1ILkguKk9FxDveLE3OLSvHS95PzcTYzgEH4mtYNxZYPF IUYBDkYlHt4bS4UChVgTy4orcw8xSnAwK4nwnqwRDhTiTUmsrEotyo8vKs1JLT7EmAy0fSKz lGhyPjC+8kriDY1NzE2NTS1NLEzMLEkTVhLnZTz1JEBIID2xJDU7NbUgtQhmCxMHp1QD4+Eu y/CYs+dOabnMDa8QzxL2l1m26IP8hLT822vUmSw/chc779wZtMqGZ2by0hteJmypsvNU/v6N LP/x4Gjej3epqrG3rLsayjMehflV/P2+1fvKPQ2p+GsPvrtE9vzTyKis27TZ6Lb42alJa+5e 7Z6xaA3nkYvXVBuffPC1q1gkKmcSf2KisRJLcUaioRZzUXEiAMmU+8ilAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org This patch implements exynos_hdmi_cdf.c which is a glue component between exynos DRM and hdmi cdf panel. It is a platform driver register through exynos_drm_drv.c. Exynos_hdmi.c is modified to register hdmi as display panel. exynos_hdmi_cdf.c registers for exynos hdmi display entity and if successful, proceeds for mode setting. Signed-off-by: Rahul Sharma --- drivers/gpu/drm/exynos/Kconfig | 6 + drivers/gpu/drm/exynos/Makefile | 1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 24 ++ drivers/gpu/drm/exynos/exynos_drm_drv.h | 1 + drivers/gpu/drm/exynos/exynos_hdmi.c | 445 ++++++++++++++++--------------- drivers/gpu/drm/exynos/exynos_hdmi_cdf.c | 370 +++++++++++++++++++++++++ include/video/exynos_hdmi.h | 25 ++ 7 files changed, 658 insertions(+), 214 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_hdmi_cdf.c create mode 100644 include/video/exynos_hdmi.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 1d1f1e5..309e62a 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -34,6 +34,12 @@ config DRM_EXYNOS_HDMI help Choose this option if you want to use Exynos HDMI for DRM. +config DRM_EXYNOS_HDMI_CDF + bool "Exynos DRM HDMI using CDF" + depends on DRM_EXYNOS_HDMI && DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV + help + Choose this option if you want to use Exynos HDMI for DRM using CDF. + config DRM_EXYNOS_VIDI bool "Exynos DRM Virtual Display" depends on DRM_EXYNOS diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 639b49e..e946ed6 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -20,5 +20,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC) += exynos_drm_fimc.o exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR) += exynos_drm_rotator.o exynosdrm-$(CONFIG_DRM_EXYNOS_GSC) += exynos_drm_gsc.o +exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI_CDF) += exynos_hdmi_cdf.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 3da5c2d..7876c3c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -40,6 +40,9 @@ /* platform device pointer for eynos drm device. */ static struct platform_device *exynos_drm_pdev; +/* platform device pointer for eynos hdmi cdf device. */ +static struct platform_device *exynos_hdmi_cdf_pdev; + static int exynos_drm_load(struct drm_device *dev, unsigned long flags) { struct exynos_drm_private *private; @@ -331,6 +334,18 @@ static int __init exynos_drm_init(void) #endif #ifdef CONFIG_DRM_EXYNOS_HDMI + + ret = platform_driver_register(&hdmi_cdf_driver); + if (ret < 0) + goto out_hdmi_cdf_driver; + + exynos_hdmi_cdf_pdev = platform_device_register_simple( + "exynos-hdmi-cdf", -1, NULL, 0); + if (IS_ERR_OR_NULL(exynos_hdmi_cdf_pdev)) { + ret = PTR_ERR(exynos_hdmi_cdf_pdev); + goto out_hdmi_cdf_device; + } + ret = platform_driver_register(&hdmi_driver); if (ret < 0) goto out_hdmi; @@ -438,6 +453,13 @@ out_common_hdmi: out_mixer: platform_driver_unregister(&hdmi_driver); out_hdmi: + +out_hdmi_cdf_device: + platform_device_unregister(exynos_hdmi_cdf_pdev); + +out_hdmi_cdf_driver: + platform_driver_unregister(&hdmi_cdf_driver); + #endif #ifdef CONFIG_DRM_EXYNOS_FIMD @@ -480,6 +502,8 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(&exynos_drm_common_hdmi_driver); platform_driver_unregister(&mixer_driver); platform_driver_unregister(&hdmi_driver); + platform_driver_unregister(&hdmi_cdf_driver); + platform_device_unregister(exynos_hdmi_cdf_pdev); #endif #ifdef CONFIG_DRM_EXYNOS_VIDI diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index b9e51bc..961fe14 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -332,6 +332,7 @@ void exynos_platform_device_hdmi_unregister(void); extern struct platform_driver fimd_driver; extern struct platform_driver hdmi_driver; extern struct platform_driver mixer_driver; +extern struct platform_driver hdmi_cdf_driver; extern struct platform_driver exynos_drm_common_hdmi_driver; extern struct platform_driver vidi_driver; extern struct platform_driver g2d_driver; diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 6f844b1..548cd32 100755 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -34,13 +34,12 @@ #include #include #include +#include