aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
diff options
context:
space:
mode:
authorRahul Sharma <rahul.sharma@samsung.com>2012-10-04 11:18:56 -0400
committerInki Dae <inki.dae@samsung.com>2012-10-05 06:15:16 -0400
commit768c3059d87876ce124dafc40078718dc85cec65 (patch)
tree93f44ffe8396ddfb18aecbbabf2f6eb922a295bf /drivers/gpu/drm/exynos/exynos_drm_hdmi.c
parent22c4f428979521f3ba3398a1eb5c0be07396f357 (diff)
drm: exynos: hdmi: remove drm common hdmi platform data struct
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 <rahul.sharma@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_hdmi.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_hdmi.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
index 0584132dc608..85304c46a8cd 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
@@ -29,6 +29,11 @@
29#define get_ctx_from_subdrv(subdrv) container_of(subdrv,\ 29#define get_ctx_from_subdrv(subdrv) container_of(subdrv,\
30 struct drm_hdmi_context, subdrv); 30 struct drm_hdmi_context, subdrv);
31 31
32/* Common hdmi subdrv needs to access the hdmi and mixer though context.
33* These should be initialied by the repective drivers */
34static struct exynos_drm_hdmi_context *hdmi_ctx;
35static struct exynos_drm_hdmi_context *mixer_ctx;
36
32/* these callback points shoud be set by specific drivers. */ 37/* these callback points shoud be set by specific drivers. */
33static struct exynos_hdmi_ops *hdmi_ops; 38static struct exynos_hdmi_ops *hdmi_ops;
34static struct exynos_mixer_ops *mixer_ops; 39static struct exynos_mixer_ops *mixer_ops;
@@ -41,6 +46,18 @@ struct drm_hdmi_context {
41 bool enabled[MIXER_WIN_NR]; 46 bool enabled[MIXER_WIN_NR];
42}; 47};
43 48
49void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx)
50{
51 if (ctx)
52 hdmi_ctx = ctx;
53}
54
55void exynos_mixer_drv_attach(struct exynos_drm_hdmi_context *ctx)
56{
57 if (ctx)
58 mixer_ctx = ctx;
59}
60
44void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops) 61void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops)
45{ 62{
46 DRM_DEBUG_KMS("%s\n", __FILE__); 63 DRM_DEBUG_KMS("%s\n", __FILE__);
@@ -303,46 +320,30 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev,
303{ 320{
304 struct exynos_drm_subdrv *subdrv = to_subdrv(dev); 321 struct exynos_drm_subdrv *subdrv = to_subdrv(dev);
305 struct drm_hdmi_context *ctx; 322 struct drm_hdmi_context *ctx;
306 struct platform_device *pdev = to_platform_device(dev);
307 struct exynos_drm_common_hdmi_pd *pd;
308 323
309 DRM_DEBUG_KMS("%s\n", __FILE__); 324 DRM_DEBUG_KMS("%s\n", __FILE__);
310 325
311 pd = pdev->dev.platform_data; 326 if (!hdmi_ctx) {
312 327 DRM_ERROR("hdmi context not initialized.\n");
313 if (!pd) {
314 DRM_DEBUG_KMS("platform data is null.\n");
315 return -EFAULT; 328 return -EFAULT;
316 } 329 }
317 330
318 if (!pd->hdmi_dev) { 331 if (!mixer_ctx) {
319 DRM_DEBUG_KMS("hdmi device is null.\n"); 332 DRM_ERROR("mixer context not initialized.\n");
320 return -EFAULT;
321 }
322
323 if (!pd->mixer_dev) {
324 DRM_DEBUG_KMS("mixer device is null.\n");
325 return -EFAULT; 333 return -EFAULT;
326 } 334 }
327 335
328 ctx = get_ctx_from_subdrv(subdrv); 336 ctx = get_ctx_from_subdrv(subdrv);
329 337
330 ctx->hdmi_ctx = (struct exynos_drm_hdmi_context *) 338 if (!ctx) {
331 to_context(pd->hdmi_dev); 339 DRM_ERROR("no drm hdmi context.\n");
332 if (!ctx->hdmi_ctx) {
333 DRM_DEBUG_KMS("hdmi context is null.\n");
334 return -EFAULT; 340 return -EFAULT;
335 } 341 }
336 342
337 ctx->hdmi_ctx->drm_dev = drm_dev; 343 ctx->hdmi_ctx = hdmi_ctx;
338 344 ctx->mixer_ctx = mixer_ctx;
339 ctx->mixer_ctx = (struct exynos_drm_hdmi_context *)
340 to_context(pd->mixer_dev);
341 if (!ctx->mixer_ctx) {
342 DRM_DEBUG_KMS("mixer context is null.\n");
343 return -EFAULT;
344 }
345 345
346 ctx->hdmi_ctx->drm_dev = drm_dev;
346 ctx->mixer_ctx->drm_dev = drm_dev; 347 ctx->mixer_ctx->drm_dev = drm_dev;
347 348
348 return 0; 349 return 0;