From patchwork Fri Sep 28 14:25:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Sharma X-Patchwork-Id: 1520261 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 141A83FDAE for ; Fri, 28 Sep 2012 16:30:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 16272A0F88 for ; Fri, 28 Sep 2012 09:30:09 -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 637909EB37 for ; Fri, 28 Sep 2012 00:02:19 -0700 (PDT) Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MB100IQ0SS0ZFN0@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 28 Sep 2012 16:00:53 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.125]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id F8.6B.03860.52B45605; Fri, 28 Sep 2012 16:00:53 +0900 (KST) X-AuditID: cbfee61b-b7f2b6d000000f14-3a-50654b2556d6 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 38.6B.03860.52B45605; Fri, 28 Sep 2012 16:00:53 +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 <0MB100IE3SS09G80@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 28 Sep 2012 16:00:53 +0900 (KST) From: Rahul Sharma To: dri-devel@lists.freedesktop.org Subject: [PATCH 14/14] drm: exynos: hdmi: remove drm common hdmi platform data struct Date: Fri, 28 Sep 2012 19:55:36 +0530 Message-id: <1348842336-2153-15-git-send-email-rahul.sharma@samsung.com> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1348842336-2153-1-git-send-email-rahul.sharma@samsung.com> References: <1348842336-2153-1-git-send-email-rahul.sharma@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHLMWRmVeSWpSXmKPExsWyRsSkVlfVOzXA4PErMYsrX9+zOTB63O8+ zhTAGMVlk5Kak1mWWqRvl8CV8eBhG3PBVe2KlS9OszYwblDpYuTkkBAwkWjo+cwKYYtJXLi3 nq2LkYtDSGApo8S9ZxNYYIr2/FrICpFYxChx7P8iKGc1k8S7BffZQKrYBHQlZh98xghiiwgo S/yduIoRpIhZoINJoqNhKjtIQlggXOL2tcNgY1kEVCX+dq8E280r4CFxbeUmRoh1ChKtyw6B 1XMCxWfemwK2QEjAXaLzbhM7RK+AxLfJh4DmcADVy0psOsAMsktC4DqbROfHeVD/SEocXHGD ZQKj8AJGhlWMoqkFyQXFSem5RnrFibnFpXnpesn5uZsYgYF4+t8z6R2MqxosDjEKcDAq8fDe mJ8SIMSaWFZcmXuIUYKDWUmE13kxUIg3JbGyKrUoP76oNCe1+BCjD9AlE5mlRJPzgVGSVxJv aGxibmpsamlkZGZqikNYSZy32QNolkB6YklqdmpqQWoRzDgmDk6pBsaZjhJ6330fc0lfrzzx /JFjZOzNzQ+fHYt+tGR1l5ucaoiH6uNbF6JMePOOLdu8lvFDppb0sRmRvWZrdgbYb2Lt9Uvi LbjYZTHn5q+EaxNEFM+ty/PePu1sSQ6PznnbCWYFW5ofXpT5F1aVPzmKQWvbhKfsN70vLJt8 Mp6D/5f8aqfEgykJf98psRRnJBpqMRcVJwIA/aETS3ECAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplkeLIzCtJLcpLzFFi42I5/e+xgK6qd2qAwY8NXBZXvr5nc2D0uN99 nCmAMaqB0SYjNTEltUghNS85PyUzL91WyTs43jne1MzAUNfQ0sJcSSEvMTfVVsnFJ0DXLTMH aKySQlliTilQKCCxuFhJ3w7ThNAQN10LmMYIXd+QILgeIwM0kLCGMePBwzbmgqvaFStfnGZt YNyg0sXIySEhYCKx59dCVghbTOLCvfVsXYxcHEICixgljv1fxArhrGaSeLfgPhtIFZuArsTs g88YQWwRAWWJvxNXMYIUMQt0MEl0NExlB0kIC4RL3L52mAXEZhFQlfjbvRJsBa+Ah8S1lZsY IdYpSLQuOwRWzwkUn3lvCtgCIQF3ic67TewTGHkXMDKsYhRNLUguKE5KzzXSK07MLS7NS9dL zs/dxAgO82fSOxhXNVgcYhTgYFTi4b0xPyVAiDWxrLgy9xCjBAezkgiv82KgEG9KYmVValF+ fFFpTmrxIUYfoKsmMkuJJucDYzCvJN7Q2MTc1NjU0sTCxMwSh7CSOG+zB9AsgfTEktTs1NSC 1CKYcUwcnFINjD6rpqkeWHFlT2yAzM8HFyS2Wh4Vu6sgrp8nde1O8JKzVg1Pmh3U9+Yaultx NtifqeJ58NR7cdbMi2sN/vbr7K29GJLadGVp495yn807j+3c3HVnW+TJS7v62Y/1a3Rw7g9W /rn9/9v5zFJhZi3hnyYeWrQizl/cxfXFhrOSGx+dlU2Ke8vjZanEUpyRaKjFXFScCABdCduZ oAIAAA== X-CFilter-Loop: Reflected X-Mailman-Approved-At: Fri, 28 Sep 2012 09:18:26 -0700 Cc: 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 d34562a..672e6f7 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -1163,6 +1163,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_ */