Commit 768c3059 authored by Rahul Sharma's avatar Rahul Sharma Committed by Inki Dae

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: default avatarRahul Sharma <rahul.sharma@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent 22c4f428
...@@ -29,6 +29,11 @@ ...@@ -29,6 +29,11 @@
#define get_ctx_from_subdrv(subdrv) container_of(subdrv,\ #define get_ctx_from_subdrv(subdrv) container_of(subdrv,\
struct drm_hdmi_context, 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. */ /* these callback points shoud be set by specific drivers. */
static struct exynos_hdmi_ops *hdmi_ops; static struct exynos_hdmi_ops *hdmi_ops;
static struct exynos_mixer_ops *mixer_ops; static struct exynos_mixer_ops *mixer_ops;
...@@ -41,6 +46,18 @@ struct drm_hdmi_context { ...@@ -41,6 +46,18 @@ struct drm_hdmi_context {
bool enabled[MIXER_WIN_NR]; 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) void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
...@@ -303,46 +320,30 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev, ...@@ -303,46 +320,30 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev,
{ {
struct exynos_drm_subdrv *subdrv = to_subdrv(dev); struct exynos_drm_subdrv *subdrv = to_subdrv(dev);
struct drm_hdmi_context *ctx; 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__); DRM_DEBUG_KMS("%s\n", __FILE__);
pd = pdev->dev.platform_data; if (!hdmi_ctx) {
DRM_ERROR("hdmi context not initialized.\n");
if (!pd) {
DRM_DEBUG_KMS("platform data is null.\n");
return -EFAULT; return -EFAULT;
} }
if (!pd->hdmi_dev) { if (!mixer_ctx) {
DRM_DEBUG_KMS("hdmi device is null.\n"); DRM_ERROR("mixer context not initialized.\n");
return -EFAULT;
}
if (!pd->mixer_dev) {
DRM_DEBUG_KMS("mixer device is null.\n");
return -EFAULT; return -EFAULT;
} }
ctx = get_ctx_from_subdrv(subdrv); ctx = get_ctx_from_subdrv(subdrv);
ctx->hdmi_ctx = (struct exynos_drm_hdmi_context *) if (!ctx) {
to_context(pd->hdmi_dev); DRM_ERROR("no drm hdmi context.\n");
if (!ctx->hdmi_ctx) {
DRM_DEBUG_KMS("hdmi context is null.\n");
return -EFAULT; return -EFAULT;
} }
ctx->hdmi_ctx->drm_dev = drm_dev; ctx->hdmi_ctx = hdmi_ctx;
ctx->mixer_ctx = mixer_ctx;
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->drm_dev = drm_dev;
ctx->mixer_ctx->drm_dev = drm_dev; ctx->mixer_ctx->drm_dev = drm_dev;
return 0; return 0;
......
...@@ -73,6 +73,8 @@ struct exynos_mixer_ops { ...@@ -73,6 +73,8 @@ struct exynos_mixer_ops {
void (*win_disable)(void *ctx, int zpos); 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_hdmi_ops_register(struct exynos_hdmi_ops *ops);
void exynos_mixer_ops_register(struct exynos_mixer_ops *ops); void exynos_mixer_ops_register(struct exynos_mixer_ops *ops);
#endif #endif
...@@ -2454,6 +2454,9 @@ static int __devinit hdmi_probe(struct platform_device *pdev) ...@@ -2454,6 +2454,9 @@ static int __devinit hdmi_probe(struct platform_device *pdev)
goto err_free_irq; goto err_free_irq;
} }
/* Attach HDMI Driver to common hdmi. */
exynos_hdmi_drv_attach(drm_hdmi_ctx);
/* register specific callbacks to common hdmi. */ /* register specific callbacks to common hdmi. */
exynos_hdmi_ops_register(&hdmi_ops); exynos_hdmi_ops_register(&hdmi_ops);
......
...@@ -1171,6 +1171,9 @@ static int __devinit mixer_probe(struct platform_device *pdev) ...@@ -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. */ /* register specific callback point to common hdmi. */
exynos_mixer_ops_register(&mixer_ops); exynos_mixer_ops_register(&mixer_ops);
......
...@@ -240,19 +240,5 @@ struct exynos_drm_fimd_pdata { ...@@ -240,19 +240,5 @@ struct exynos_drm_fimd_pdata {
unsigned int bpp; 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 /* __KERNEL__ */
#endif /* _EXYNOS_DRM_H_ */ #endif /* _EXYNOS_DRM_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment