From patchwork Thu Oct 4 15:18:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Sharma X-Patchwork-Id: 1545681 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 A87933FD9C for ; Thu, 4 Oct 2012 09:30:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 88231A0B73 for ; Thu, 4 Oct 2012 02:30:28 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 8B393A0C27 for ; Thu, 4 Oct 2012 00:02:03 -0700 (PDT) Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MBC00KMJWT4NUC0@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 04 Oct 2012 16:01:43 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.126]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 1B.BE.03783.7543D605; Thu, 04 Oct 2012 16:01:43 +0900 (KST) X-AuditID: cbfee61a-b7f726d000000ec7-90-506d345758db Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 7A.BE.03783.7543D605; Thu, 04 Oct 2012 16:01:43 +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 <0MBC0040MWSZQ360@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 04 Oct 2012 16:01:43 +0900 (KST) From: Rahul Sharma To: dri-devel@lists.freedesktop.org Subject: [PATCH v1 14/14] drm: exynos: hdmi: remove drm common hdmi platform data struct Date: Thu, 04 Oct 2012 20:48:56 +0530 Message-id: <1349363936-8531-15-git-send-email-rahul.sharma@samsung.com> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1349363936-8531-1-git-send-email-rahul.sharma@samsung.com> References: <1349363936-8531-1-git-send-email-rahul.sharma@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLLMWRmVeSWpSXmKPExsWyRsSkTjfcJDfA4NZcFYsrX9+zOTB63O8+ zhTAGMVlk5Kak1mWWqRvl8CV8f5VWMFV7Yq9O+YzNzBuUOli5OSQEDCRODt3OiuELSZx4d56 ti5GLg4hgaWMEptfXGKDKdo/rZkZIjGdUeL68s1MEM5qJommfTtZQKrYBHQlZh98xghiiwgo S/yduIoRpIhZYBGTxL87H9hBEsICURKdO7rBbBYBVYm1ncfBdvMKeEjsX/CWGWKdgkTrskNg NZxA8YW/boDZQgLuEk+uXWKE6BWQ+Db5ENBiDqB6WYlNB8CukxC4zCbxfg7EQRICkhIHV9xg mcAovICRYRWjaGpBckFxUnquoV5xYm5xaV66XnJ+7iZGYBie/vdMagfjygaLQ4wCHIxKPLyG 3TkBQqyJZcWVuYcYJTiYlUR4NyvmBgjxpiRWVqUW5ccXleakFh9i9AG6ZCKzlGhyPjBG8kri DY1NzE2NTS2NjMxMTXEIK4nzNnukBAgJpCeWpGanphakFsGMY+LglGpgnFbyacuePDHtxGPF U7e1Nb4LN7vQkxF2srU+sr2bIzbwmsKphr/BvByMN1Yx9NzznFDWtpbz4hbzG+vPxaU79l+d dkNl8QlO6Qxe+2md2yxzXJfvMtGb7+1ds4n7n22K8csCp/PPjqQ9We5r0XCi7LLYFMuCsGXX p77OE0uQlT5cmfV31hIzJZbijERDLeai4kQAAEPVWnACAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42I5/e+xoG64SW6AQfcrWYsrX9+zOTB63O8+ zhTAGNXAaJORmpiSWqSQmpecn5KZl26r5B0c7xxvamZgqGtoaWGupJCXmJtqq+TiE6DrlpkD NFZJoSwxpxQoFJBYXKykb4dpQmiIm64FTGOErm9IEFyPkQEaSFjDmPH+VVjBVe2KvTvmMzcw blDpYuTkkBAwkdg/rZkZwhaTuHBvPVsXIxeHkMB0RonryzczQTirmSSa9u1kAaliE9CVmH3w GSOILSKgLPF34ipGkCJmgUVMEv/ufGAHSQgLREl07ugGs1kEVCXWdh5nBbF5BTwk9i94C7VO QaJ12SGwGk6g+MJfN8BsIQF3iSfXLjFOYORdwMiwilE0tSC5oDgpPddQrzgxt7g0L10vOT93 EyM4yJ9J7WBc2WBxiFGAg1GJh9ewOydAiDWxrLgy9xCjBAezkgjvZsXcACHelMTKqtSi/Pii 0pzU4kOMPkBXTWSWEk3OB0ZgXkm8obGJuamxqaWJhYmZJQ5hJXHeZo+UACGB9MSS1OzU1ILU IphxTBycUg2M2hO9mRacd7A9ILDp76Njf5y7thxs2DD/715p9gOMiXX6qX4fTzWaPKnQ2na8 +1U4W8ZJm45Tsz4sbX7d7ZG+4ZD8tKM7Ay3zrsVxbXsvG/zyvgB7FuveBd+76//v3HtIVqQh wLXtUX134DJbjhYpB+PQxb3zgi3srwttCDJYe7xTN+IKT5ebEktxRqKhFnNRcSIAdNlvG58C AAA= X-CFilter-Loop: Reflected X-Mailman-Approved-At: Thu, 04 Oct 2012 00:52:17 -0700 Cc: t.stanislaws@samsung.com, l.krishna@samsung.com, joshi@samsung.com, kyungmin.park@samsung.com, fahad.k@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 exynos-drm-hdmi need context pointers from hdmi and mixer. These pointers were expected from the plf data. Cleaned this dependency by exporting i/f which are called by hdmi, mixer driver probes for setting their context. Signed-off-by: Rahul Sharma --- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 51 +++++++++++++++-------------- drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 2 + drivers/gpu/drm/exynos/exynos_hdmi.c | 3 ++ drivers/gpu/drm/exynos/exynos_mixer.c | 3 ++ include/drm/exynos_drm.h | 14 -------- 5 files changed, 34 insertions(+), 39 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c index 0584132..85304c4 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c @@ -29,6 +29,11 @@ #define get_ctx_from_subdrv(subdrv) container_of(subdrv,\ struct drm_hdmi_context, subdrv); +/* Common hdmi subdrv needs to access the hdmi and mixer though context. +* These should be initialied by the repective drivers */ +static struct exynos_drm_hdmi_context *hdmi_ctx; +static struct exynos_drm_hdmi_context *mixer_ctx; + /* these callback points shoud be set by specific drivers. */ static struct exynos_hdmi_ops *hdmi_ops; static struct exynos_mixer_ops *mixer_ops; @@ -41,6 +46,18 @@ struct drm_hdmi_context { bool enabled[MIXER_WIN_NR]; }; +void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx) +{ + if (ctx) + hdmi_ctx = ctx; +} + +void exynos_mixer_drv_attach(struct exynos_drm_hdmi_context *ctx) +{ + if (ctx) + mixer_ctx = ctx; +} + void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops) { DRM_DEBUG_KMS("%s\n", __FILE__); @@ -303,46 +320,30 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev, { struct exynos_drm_subdrv *subdrv = to_subdrv(dev); struct drm_hdmi_context *ctx; - struct platform_device *pdev = to_platform_device(dev); - struct exynos_drm_common_hdmi_pd *pd; DRM_DEBUG_KMS("%s\n", __FILE__); - pd = pdev->dev.platform_data; - - if (!pd) { - DRM_DEBUG_KMS("platform data is null.\n"); + if (!hdmi_ctx) { + DRM_ERROR("hdmi context not initialized.\n"); return -EFAULT; } - if (!pd->hdmi_dev) { - DRM_DEBUG_KMS("hdmi device is null.\n"); - return -EFAULT; - } - - if (!pd->mixer_dev) { - DRM_DEBUG_KMS("mixer device is null.\n"); + if (!mixer_ctx) { + DRM_ERROR("mixer context not initialized.\n"); return -EFAULT; } ctx = get_ctx_from_subdrv(subdrv); - ctx->hdmi_ctx = (struct exynos_drm_hdmi_context *) - to_context(pd->hdmi_dev); - if (!ctx->hdmi_ctx) { - DRM_DEBUG_KMS("hdmi context is null.\n"); + if (!ctx) { + DRM_ERROR("no drm hdmi context.\n"); return -EFAULT; } - ctx->hdmi_ctx->drm_dev = drm_dev; - - ctx->mixer_ctx = (struct exynos_drm_hdmi_context *) - to_context(pd->mixer_dev); - if (!ctx->mixer_ctx) { - DRM_DEBUG_KMS("mixer context is null.\n"); - return -EFAULT; - } + ctx->hdmi_ctx = hdmi_ctx; + ctx->mixer_ctx = mixer_ctx; + ctx->hdmi_ctx->drm_dev = drm_dev; ctx->mixer_ctx->drm_dev = drm_dev; return 0; diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h index d9f9e9f..2da5ffd 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h @@ -73,6 +73,8 @@ struct exynos_mixer_ops { void (*win_disable)(void *ctx, int zpos); }; +void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx); +void exynos_mixer_drv_attach(struct exynos_drm_hdmi_context *ctx); void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops); void exynos_mixer_ops_register(struct exynos_mixer_ops *ops); #endif diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 5caf49f..e6b784d 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -2454,6 +2454,9 @@ static int __devinit hdmi_probe(struct platform_device *pdev) goto err_free_irq; } + /* Attach HDMI Driver to common hdmi. */ + exynos_hdmi_drv_attach(drm_hdmi_ctx); + /* register specific callbacks to common hdmi. */ exynos_hdmi_ops_register(&hdmi_ops); diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 39d2b95..1a319e4 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -1171,6 +1171,9 @@ static int __devinit mixer_probe(struct platform_device *pdev) } } + /* attach mixer driver to common hdmi. */ + exynos_mixer_drv_attach(drm_hdmi_ctx); + /* register specific callback point to common hdmi. */ exynos_mixer_ops_register(&mixer_ops); diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h index 8bdd49a..8ac4079 100644 --- a/include/drm/exynos_drm.h +++ b/include/drm/exynos_drm.h @@ -240,19 +240,5 @@ struct exynos_drm_fimd_pdata { unsigned int bpp; }; -/** - * Platform Specific Structure for DRM based HDMI. - * - * @hdmi_dev: device point to specific hdmi driver. - * @mixer_dev: device point to specific mixer driver. - * - * this structure is used for common hdmi driver and each device object - * would be used to access specific device driver(hdmi or mixer driver) - */ -struct exynos_drm_common_hdmi_pd { - struct device *hdmi_dev; - struct device *mixer_dev; -}; - #endif /* __KERNEL__ */ #endif /* _EXYNOS_DRM_H_ */