提交 578b6065 编写于 作者: J Joonyoung Shim 提交者: Inki Dae

drm/exynos: fix struct for operation callback functions to driver name

The mixer driver and hdmi driver have each operation callback functions
and they is registered to hdmi common driver. Their struct names in hdmi
common driver include display, manager and overlay. It confuses to
appear whose operation and two driver cannot register same operation
callback functions at the same time. Use their struct names to driver
name.
Signed-off-by: NJoonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: NInki Dae <inki.dae@samsung.com>
上级 a2ee151b
...@@ -30,9 +30,8 @@ ...@@ -30,9 +30,8 @@
struct drm_hdmi_context, subdrv); struct drm_hdmi_context, subdrv);
/* these callback points shoud be set by specific drivers. */ /* these callback points shoud be set by specific drivers. */
static struct exynos_hdmi_display_ops *hdmi_display_ops; static struct exynos_hdmi_ops *hdmi_ops;
static struct exynos_hdmi_manager_ops *hdmi_manager_ops; static struct exynos_mixer_ops *mixer_ops;
static struct exynos_hdmi_overlay_ops *hdmi_overlay_ops;
struct drm_hdmi_context { struct drm_hdmi_context {
struct exynos_drm_subdrv subdrv; struct exynos_drm_subdrv subdrv;
...@@ -40,31 +39,20 @@ struct drm_hdmi_context { ...@@ -40,31 +39,20 @@ struct drm_hdmi_context {
struct exynos_drm_hdmi_context *mixer_ctx; struct exynos_drm_hdmi_context *mixer_ctx;
}; };
void exynos_drm_display_ops_register(struct exynos_hdmi_display_ops void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops)
*display_ops)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (display_ops) if (ops)
hdmi_display_ops = display_ops; hdmi_ops = ops;
} }
void exynos_drm_manager_ops_register(struct exynos_hdmi_manager_ops void exynos_mixer_ops_register(struct exynos_mixer_ops *ops)
*manager_ops)
{ {
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (manager_ops) if (ops)
hdmi_manager_ops = manager_ops; mixer_ops = ops;
}
void exynos_drm_overlay_ops_register(struct exynos_hdmi_overlay_ops
*overlay_ops)
{
DRM_DEBUG_KMS("%s\n", __FILE__);
if (overlay_ops)
hdmi_overlay_ops = overlay_ops;
} }
static bool drm_hdmi_is_connected(struct device *dev) static bool drm_hdmi_is_connected(struct device *dev)
...@@ -73,8 +61,8 @@ static bool drm_hdmi_is_connected(struct device *dev) ...@@ -73,8 +61,8 @@ static bool drm_hdmi_is_connected(struct device *dev)
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_display_ops && hdmi_display_ops->is_connected) if (hdmi_ops && hdmi_ops->is_connected)
return hdmi_display_ops->is_connected(ctx->hdmi_ctx->ctx); return hdmi_ops->is_connected(ctx->hdmi_ctx->ctx);
return false; return false;
} }
...@@ -86,9 +74,9 @@ static int drm_hdmi_get_edid(struct device *dev, ...@@ -86,9 +74,9 @@ static int drm_hdmi_get_edid(struct device *dev,
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_display_ops && hdmi_display_ops->get_edid) if (hdmi_ops && hdmi_ops->get_edid)
return hdmi_display_ops->get_edid(ctx->hdmi_ctx->ctx, return hdmi_ops->get_edid(ctx->hdmi_ctx->ctx, connector, edid,
connector, edid, len); len);
return 0; return 0;
} }
...@@ -99,9 +87,8 @@ static int drm_hdmi_check_timing(struct device *dev, void *timing) ...@@ -99,9 +87,8 @@ static int drm_hdmi_check_timing(struct device *dev, void *timing)
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_display_ops && hdmi_display_ops->check_timing) if (hdmi_ops && hdmi_ops->check_timing)
return hdmi_display_ops->check_timing(ctx->hdmi_ctx->ctx, return hdmi_ops->check_timing(ctx->hdmi_ctx->ctx, timing);
timing);
return 0; return 0;
} }
...@@ -112,8 +99,8 @@ static int drm_hdmi_power_on(struct device *dev, int mode) ...@@ -112,8 +99,8 @@ static int drm_hdmi_power_on(struct device *dev, int mode)
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_display_ops && hdmi_display_ops->power_on) if (hdmi_ops && hdmi_ops->power_on)
return hdmi_display_ops->power_on(ctx->hdmi_ctx->ctx, mode); return hdmi_ops->power_on(ctx->hdmi_ctx->ctx, mode);
return 0; return 0;
} }
...@@ -134,9 +121,9 @@ static int drm_hdmi_enable_vblank(struct device *subdrv_dev) ...@@ -134,9 +121,9 @@ static int drm_hdmi_enable_vblank(struct device *subdrv_dev)
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_overlay_ops && hdmi_overlay_ops->enable_vblank) if (mixer_ops && mixer_ops->enable_vblank)
return hdmi_overlay_ops->enable_vblank(ctx->mixer_ctx->ctx, return mixer_ops->enable_vblank(ctx->mixer_ctx->ctx,
manager->pipe); manager->pipe);
return 0; return 0;
} }
...@@ -147,8 +134,8 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev) ...@@ -147,8 +134,8 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev)
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_overlay_ops && hdmi_overlay_ops->disable_vblank) if (mixer_ops && mixer_ops->disable_vblank)
return hdmi_overlay_ops->disable_vblank(ctx->mixer_ctx->ctx); return mixer_ops->disable_vblank(ctx->mixer_ctx->ctx);
} }
static void drm_hdmi_mode_fixup(struct device *subdrv_dev, static void drm_hdmi_mode_fixup(struct device *subdrv_dev,
...@@ -160,9 +147,9 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev, ...@@ -160,9 +147,9 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev,
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_manager_ops && hdmi_manager_ops->mode_fixup) if (hdmi_ops && hdmi_ops->mode_fixup)
hdmi_manager_ops->mode_fixup(ctx->hdmi_ctx->ctx, connector, hdmi_ops->mode_fixup(ctx->hdmi_ctx->ctx, connector, mode,
mode, adjusted_mode); adjusted_mode);
} }
static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode) static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode)
...@@ -171,8 +158,8 @@ static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode) ...@@ -171,8 +158,8 @@ static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode)
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_manager_ops && hdmi_manager_ops->mode_set) if (hdmi_ops && hdmi_ops->mode_set)
hdmi_manager_ops->mode_set(ctx->hdmi_ctx->ctx, mode); hdmi_ops->mode_set(ctx->hdmi_ctx->ctx, mode);
} }
static void drm_hdmi_get_max_resol(struct device *subdrv_dev, static void drm_hdmi_get_max_resol(struct device *subdrv_dev,
...@@ -182,9 +169,8 @@ static void drm_hdmi_get_max_resol(struct device *subdrv_dev, ...@@ -182,9 +169,8 @@ static void drm_hdmi_get_max_resol(struct device *subdrv_dev,
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_manager_ops && hdmi_manager_ops->get_max_resol) if (hdmi_ops && hdmi_ops->get_max_resol)
hdmi_manager_ops->get_max_resol(ctx->hdmi_ctx->ctx, width, hdmi_ops->get_max_resol(ctx->hdmi_ctx->ctx, width, height);
height);
} }
static void drm_hdmi_commit(struct device *subdrv_dev) static void drm_hdmi_commit(struct device *subdrv_dev)
...@@ -193,8 +179,8 @@ static void drm_hdmi_commit(struct device *subdrv_dev) ...@@ -193,8 +179,8 @@ static void drm_hdmi_commit(struct device *subdrv_dev)
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_manager_ops && hdmi_manager_ops->commit) if (hdmi_ops && hdmi_ops->commit)
hdmi_manager_ops->commit(ctx->hdmi_ctx->ctx); hdmi_ops->commit(ctx->hdmi_ctx->ctx);
} }
static void drm_hdmi_dpms(struct device *subdrv_dev, int mode) static void drm_hdmi_dpms(struct device *subdrv_dev, int mode)
...@@ -209,8 +195,8 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode) ...@@ -209,8 +195,8 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode)
case DRM_MODE_DPMS_STANDBY: case DRM_MODE_DPMS_STANDBY:
case DRM_MODE_DPMS_SUSPEND: case DRM_MODE_DPMS_SUSPEND:
case DRM_MODE_DPMS_OFF: case DRM_MODE_DPMS_OFF:
if (hdmi_manager_ops && hdmi_manager_ops->disable) if (hdmi_ops && hdmi_ops->disable)
hdmi_manager_ops->disable(ctx->hdmi_ctx->ctx); hdmi_ops->disable(ctx->hdmi_ctx->ctx);
break; break;
default: default:
DRM_DEBUG_KMS("unkown dps mode: %d\n", mode); DRM_DEBUG_KMS("unkown dps mode: %d\n", mode);
...@@ -235,8 +221,8 @@ static void drm_mixer_mode_set(struct device *subdrv_dev, ...@@ -235,8 +221,8 @@ static void drm_mixer_mode_set(struct device *subdrv_dev,
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_overlay_ops && hdmi_overlay_ops->win_mode_set) if (mixer_ops && mixer_ops->win_mode_set)
hdmi_overlay_ops->win_mode_set(ctx->mixer_ctx->ctx, overlay); mixer_ops->win_mode_set(ctx->mixer_ctx->ctx, overlay);
} }
static void drm_mixer_commit(struct device *subdrv_dev, int zpos) static void drm_mixer_commit(struct device *subdrv_dev, int zpos)
...@@ -245,8 +231,8 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos) ...@@ -245,8 +231,8 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos)
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_overlay_ops && hdmi_overlay_ops->win_commit) if (mixer_ops && mixer_ops->win_commit)
hdmi_overlay_ops->win_commit(ctx->mixer_ctx->ctx, zpos); mixer_ops->win_commit(ctx->mixer_ctx->ctx, zpos);
} }
static void drm_mixer_disable(struct device *subdrv_dev, int zpos) static void drm_mixer_disable(struct device *subdrv_dev, int zpos)
...@@ -255,8 +241,8 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) ...@@ -255,8 +241,8 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos)
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
if (hdmi_overlay_ops && hdmi_overlay_ops->win_disable) if (mixer_ops && mixer_ops->win_disable)
hdmi_overlay_ops->win_disable(ctx->mixer_ctx->ctx, zpos); mixer_ops->win_disable(ctx->mixer_ctx->ctx, zpos);
} }
static struct exynos_drm_overlay_ops drm_hdmi_overlay_ops = { static struct exynos_drm_overlay_ops drm_hdmi_overlay_ops = {
......
...@@ -38,15 +38,15 @@ struct exynos_drm_hdmi_context { ...@@ -38,15 +38,15 @@ struct exynos_drm_hdmi_context {
void *ctx; void *ctx;
}; };
struct exynos_hdmi_display_ops { struct exynos_hdmi_ops {
/* display */
bool (*is_connected)(void *ctx); bool (*is_connected)(void *ctx);
int (*get_edid)(void *ctx, struct drm_connector *connector, int (*get_edid)(void *ctx, struct drm_connector *connector,
u8 *edid, int len); u8 *edid, int len);
int (*check_timing)(void *ctx, void *timing); int (*check_timing)(void *ctx, void *timing);
int (*power_on)(void *ctx, int mode); int (*power_on)(void *ctx, int mode);
};
struct exynos_hdmi_manager_ops { /* manager */
void (*mode_fixup)(void *ctx, struct drm_connector *connector, void (*mode_fixup)(void *ctx, struct drm_connector *connector,
struct drm_display_mode *mode, struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode); struct drm_display_mode *adjusted_mode);
...@@ -57,22 +57,17 @@ struct exynos_hdmi_manager_ops { ...@@ -57,22 +57,17 @@ struct exynos_hdmi_manager_ops {
void (*disable)(void *ctx); void (*disable)(void *ctx);
}; };
struct exynos_hdmi_overlay_ops { struct exynos_mixer_ops {
/* manager */
int (*enable_vblank)(void *ctx, int pipe); int (*enable_vblank)(void *ctx, int pipe);
void (*disable_vblank)(void *ctx); void (*disable_vblank)(void *ctx);
/* overlay */
void (*win_mode_set)(void *ctx, struct exynos_drm_overlay *overlay); void (*win_mode_set)(void *ctx, struct exynos_drm_overlay *overlay);
void (*win_commit)(void *ctx, int zpos); void (*win_commit)(void *ctx, int zpos);
void (*win_disable)(void *ctx, int zpos); void (*win_disable)(void *ctx, int zpos);
}; };
extern struct platform_driver hdmi_driver; void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops);
extern struct platform_driver mixer_driver; void exynos_mixer_ops_register(struct exynos_mixer_ops *ops);
void exynos_drm_display_ops_register(struct exynos_hdmi_display_ops
*display_ops);
void exynos_drm_manager_ops_register(struct exynos_hdmi_manager_ops
*manager_ops);
void exynos_drm_overlay_ops_register(struct exynos_hdmi_overlay_ops
*overlay_ops);
#endif #endif
...@@ -1311,13 +1311,6 @@ static int hdmi_display_power_on(void *ctx, int mode) ...@@ -1311,13 +1311,6 @@ static int hdmi_display_power_on(void *ctx, int mode)
return 0; return 0;
} }
static struct exynos_hdmi_display_ops display_ops = {
.is_connected = hdmi_is_connected,
.get_edid = hdmi_get_edid,
.check_timing = hdmi_check_timing,
.power_on = hdmi_display_power_on,
};
static void hdmi_set_acr(u32 freq, u8 *acr) static void hdmi_set_acr(u32 freq, u8 *acr)
{ {
u32 n, cts; u32 n, cts;
...@@ -1995,7 +1988,14 @@ static void hdmi_disable(void *ctx) ...@@ -1995,7 +1988,14 @@ static void hdmi_disable(void *ctx)
} }
} }
static struct exynos_hdmi_manager_ops manager_ops = { static struct exynos_hdmi_ops hdmi_ops = {
/* display */
.is_connected = hdmi_is_connected,
.get_edid = hdmi_get_edid,
.check_timing = hdmi_check_timing,
.power_on = hdmi_display_power_on,
/* manager */
.mode_fixup = hdmi_mode_fixup, .mode_fixup = hdmi_mode_fixup,
.mode_set = hdmi_mode_set, .mode_set = hdmi_mode_set,
.get_max_resol = hdmi_get_max_resol, .get_max_resol = hdmi_get_max_resol,
...@@ -2321,8 +2321,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev) ...@@ -2321,8 +2321,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev)
hdata->irq = res->start; hdata->irq = res->start;
/* register specific callbacks to common hdmi. */ /* register specific callbacks to common hdmi. */
exynos_drm_display_ops_register(&display_ops); exynos_hdmi_ops_register(&hdmi_ops);
exynos_drm_manager_ops_register(&manager_ops);
hdmi_resource_poweron(hdata); hdmi_resource_poweron(hdata);
......
...@@ -719,9 +719,12 @@ static void mixer_win_disable(void *ctx, int zpos) ...@@ -719,9 +719,12 @@ static void mixer_win_disable(void *ctx, int zpos)
spin_unlock_irqrestore(&res->reg_slock, flags); spin_unlock_irqrestore(&res->reg_slock, flags);
} }
static struct exynos_hdmi_overlay_ops overlay_ops = { static struct exynos_mixer_ops mixer_ops = {
/* manager */
.enable_vblank = mixer_enable_vblank, .enable_vblank = mixer_enable_vblank,
.disable_vblank = mixer_disable_vblank, .disable_vblank = mixer_disable_vblank,
/* overlay */
.win_mode_set = mixer_win_mode_set, .win_mode_set = mixer_win_mode_set,
.win_commit = mixer_win_commit, .win_commit = mixer_win_commit,
.win_disable = mixer_win_disable, .win_disable = mixer_win_disable,
...@@ -1071,7 +1074,7 @@ static int __devinit mixer_probe(struct platform_device *pdev) ...@@ -1071,7 +1074,7 @@ static int __devinit mixer_probe(struct platform_device *pdev)
goto fail; goto fail;
/* register specific callback point to common hdmi. */ /* register specific callback point to common hdmi. */
exynos_drm_overlay_ops_register(&overlay_ops); exynos_mixer_ops_register(&mixer_ops);
mixer_resource_poweron(ctx); mixer_resource_poweron(ctx);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册