提交 11622d4c 编写于 作者: L Laurent Pinchart 提交者: Daniel Vetter

drm: bridge: Make (pre/post) enable/disable callbacks optional

Instead of forcing bridges to implement empty callbacks make them all
optional.
Signed-off-by: NLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1456480266-7904-1-git-send-email-laurent.pinchart+renesas@ideasonboard.comAcked-by: NArchit Taneja <architt@codeaurora.org>
Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
上级 b47bcb93
...@@ -186,7 +186,8 @@ void drm_bridge_disable(struct drm_bridge *bridge) ...@@ -186,7 +186,8 @@ void drm_bridge_disable(struct drm_bridge *bridge)
drm_bridge_disable(bridge->next); drm_bridge_disable(bridge->next);
bridge->funcs->disable(bridge); if (bridge->funcs->disable)
bridge->funcs->disable(bridge);
} }
EXPORT_SYMBOL(drm_bridge_disable); EXPORT_SYMBOL(drm_bridge_disable);
...@@ -206,7 +207,8 @@ void drm_bridge_post_disable(struct drm_bridge *bridge) ...@@ -206,7 +207,8 @@ void drm_bridge_post_disable(struct drm_bridge *bridge)
if (!bridge) if (!bridge)
return; return;
bridge->funcs->post_disable(bridge); if (bridge->funcs->post_disable)
bridge->funcs->post_disable(bridge);
drm_bridge_post_disable(bridge->next); drm_bridge_post_disable(bridge->next);
} }
...@@ -256,7 +258,8 @@ void drm_bridge_pre_enable(struct drm_bridge *bridge) ...@@ -256,7 +258,8 @@ void drm_bridge_pre_enable(struct drm_bridge *bridge)
drm_bridge_pre_enable(bridge->next); drm_bridge_pre_enable(bridge->next);
bridge->funcs->pre_enable(bridge); if (bridge->funcs->pre_enable)
bridge->funcs->pre_enable(bridge);
} }
EXPORT_SYMBOL(drm_bridge_pre_enable); EXPORT_SYMBOL(drm_bridge_pre_enable);
...@@ -276,7 +279,8 @@ void drm_bridge_enable(struct drm_bridge *bridge) ...@@ -276,7 +279,8 @@ void drm_bridge_enable(struct drm_bridge *bridge)
if (!bridge) if (!bridge)
return; return;
bridge->funcs->enable(bridge); if (bridge->funcs->enable)
bridge->funcs->enable(bridge);
drm_bridge_enable(bridge->next); drm_bridge_enable(bridge->next);
} }
......
...@@ -1596,6 +1596,8 @@ struct drm_bridge_funcs { ...@@ -1596,6 +1596,8 @@ struct drm_bridge_funcs {
* *
* The bridge can assume that the display pipe (i.e. clocks and timing * The bridge can assume that the display pipe (i.e. clocks and timing
* signals) feeding it is still running when this callback is called. * signals) feeding it is still running when this callback is called.
*
* The disable callback is optional.
*/ */
void (*disable)(struct drm_bridge *bridge); void (*disable)(struct drm_bridge *bridge);
...@@ -1612,6 +1614,8 @@ struct drm_bridge_funcs { ...@@ -1612,6 +1614,8 @@ struct drm_bridge_funcs {
* The bridge must assume that the display pipe (i.e. clocks and timing * The bridge must assume that the display pipe (i.e. clocks and timing
* singals) feeding it is no longer running when this callback is * singals) feeding it is no longer running when this callback is
* called. * called.
*
* The post_disable callback is optional.
*/ */
void (*post_disable)(struct drm_bridge *bridge); void (*post_disable)(struct drm_bridge *bridge);
...@@ -1640,6 +1644,8 @@ struct drm_bridge_funcs { ...@@ -1640,6 +1644,8 @@ struct drm_bridge_funcs {
* will not yet be running when this callback is called. The bridge must * will not yet be running when this callback is called. The bridge must
* not enable the display link feeding the next bridge in the chain (if * not enable the display link feeding the next bridge in the chain (if
* there is one) when this callback is called. * there is one) when this callback is called.
*
* The pre_enable callback is optional.
*/ */
void (*pre_enable)(struct drm_bridge *bridge); void (*pre_enable)(struct drm_bridge *bridge);
...@@ -1657,6 +1663,8 @@ struct drm_bridge_funcs { ...@@ -1657,6 +1663,8 @@ struct drm_bridge_funcs {
* signals) feeding it is running when this callback is called. This * signals) feeding it is running when this callback is called. This
* callback must enable the display link feeding the next bridge in the * callback must enable the display link feeding the next bridge in the
* chain if there is one. * chain if there is one.
*
* The enable callback is optional.
*/ */
void (*enable)(struct drm_bridge *bridge); void (*enable)(struct drm_bridge *bridge);
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册