summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2016-02-26 04:51:06 -0500
committerThierry Reding <treding@nvidia.com>2016-03-02 11:31:03 -0500
commitc8a3b2ae07130042682bc8e031bcfbae3754463d (patch)
tree6594793d6229f8cacbba4667d80000eb1abee438
parent06a9dc65afbd9d9e81ee6352a13f968e0540237e (diff)
drm/bridge: Make (pre/post) enable/disable callbacks optional
Instead of forcing bridges to implement empty callbacks make them all optional. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/gpu/drm/drm_bridge.c12
-rw-r--r--include/drm/drm_crtc.h8
2 files changed, 16 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index bd93453afa61..b3654404abd0 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -186,7 +186,8 @@ void drm_bridge_disable(struct drm_bridge *bridge)
186 186
187 drm_bridge_disable(bridge->next); 187 drm_bridge_disable(bridge->next);
188 188
189 bridge->funcs->disable(bridge); 189 if (bridge->funcs->disable)
190 bridge->funcs->disable(bridge);
190} 191}
191EXPORT_SYMBOL(drm_bridge_disable); 192EXPORT_SYMBOL(drm_bridge_disable);
192 193
@@ -206,7 +207,8 @@ void drm_bridge_post_disable(struct drm_bridge *bridge)
206 if (!bridge) 207 if (!bridge)
207 return; 208 return;
208 209
209 bridge->funcs->post_disable(bridge); 210 if (bridge->funcs->post_disable)
211 bridge->funcs->post_disable(bridge);
210 212
211 drm_bridge_post_disable(bridge->next); 213 drm_bridge_post_disable(bridge->next);
212} 214}
@@ -256,7 +258,8 @@ void drm_bridge_pre_enable(struct drm_bridge *bridge)
256 258
257 drm_bridge_pre_enable(bridge->next); 259 drm_bridge_pre_enable(bridge->next);
258 260
259 bridge->funcs->pre_enable(bridge); 261 if (bridge->funcs->pre_enable)
262 bridge->funcs->pre_enable(bridge);
260} 263}
261EXPORT_SYMBOL(drm_bridge_pre_enable); 264EXPORT_SYMBOL(drm_bridge_pre_enable);
262 265
@@ -276,7 +279,8 @@ void drm_bridge_enable(struct drm_bridge *bridge)
276 if (!bridge) 279 if (!bridge)
277 return; 280 return;
278 281
279 bridge->funcs->enable(bridge); 282 if (bridge->funcs->enable)
283 bridge->funcs->enable(bridge);
280 284
281 drm_bridge_enable(bridge->next); 285 drm_bridge_enable(bridge->next);
282} 286}
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index c65a212db77e..f336671ca932 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1581,6 +1581,8 @@ struct drm_bridge_funcs {
1581 * 1581 *
1582 * The bridge can assume that the display pipe (i.e. clocks and timing 1582 * The bridge can assume that the display pipe (i.e. clocks and timing
1583 * signals) feeding it is still running when this callback is called. 1583 * signals) feeding it is still running when this callback is called.
1584 *
1585 * The disable callback is optional.
1584 */ 1586 */
1585 void (*disable)(struct drm_bridge *bridge); 1587 void (*disable)(struct drm_bridge *bridge);
1586 1588
@@ -1597,6 +1599,8 @@ struct drm_bridge_funcs {
1597 * The bridge must assume that the display pipe (i.e. clocks and timing 1599 * The bridge must assume that the display pipe (i.e. clocks and timing
1598 * singals) feeding it is no longer running when this callback is 1600 * singals) feeding it is no longer running when this callback is
1599 * called. 1601 * called.
1602 *
1603 * The post_disable callback is optional.
1600 */ 1604 */
1601 void (*post_disable)(struct drm_bridge *bridge); 1605 void (*post_disable)(struct drm_bridge *bridge);
1602 1606
@@ -1625,6 +1629,8 @@ struct drm_bridge_funcs {
1625 * will not yet be running when this callback is called. The bridge must 1629 * will not yet be running when this callback is called. The bridge must
1626 * not enable the display link feeding the next bridge in the chain (if 1630 * not enable the display link feeding the next bridge in the chain (if
1627 * there is one) when this callback is called. 1631 * there is one) when this callback is called.
1632 *
1633 * The pre_enable callback is optional.
1628 */ 1634 */
1629 void (*pre_enable)(struct drm_bridge *bridge); 1635 void (*pre_enable)(struct drm_bridge *bridge);
1630 1636
@@ -1642,6 +1648,8 @@ struct drm_bridge_funcs {
1642 * signals) feeding it is running when this callback is called. This 1648 * signals) feeding it is running when this callback is called. This
1643 * callback must enable the display link feeding the next bridge in the 1649 * callback must enable the display link feeding the next bridge in the
1644 * chain if there is one. 1650 * chain if there is one.
1651 *
1652 * The enable callback is optional.
1645 */ 1653 */
1646 void (*enable)(struct drm_bridge *bridge); 1654 void (*enable)(struct drm_bridge *bridge);
1647}; 1655};