drm/bridge: Introduce pre_enable_upstream_first to alter bridge init order
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Thu, 16 Dec 2021 15:25:35 +0000 (15:25 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 21 Mar 2022 16:04:47 +0000 (16:04 +0000)
commit0378307fb0196607ee3cc1fb5f5c588ab00918b0
tree9af115cc4d0f766f7427fc8ad37dcdf1ff76b9f2
parentf5c20eb32a93e936f7067bb0ce9efffc08d5bb59
drm/bridge: Introduce pre_enable_upstream_first to alter bridge init order

DSI sink devices typically want the DSI host powered up and configured
before they are powered up. pre_enable is the place this would normally
happen, but they are called in reverse order from panel/connector towards
the encoder, which is the "wrong" order.

Add a new flag pre_enable_upstream_first that any bridge can set
to swap the order of pre_enable (and post_disable) for that and the
immediately upstream bridge.
Should the immediately upstream bridge also set the
pre_enable_upstream_first flag, the bridge upstream of that will be called
before either of those which requested pre_enable_upstream_first.

eg:
- Panel
- Bridge 1
- Bridge 2 pre_enable_upstream_first
- Bridge 3
- Bridge 4 pre_enable_upstream_first
- Bridge 5 pre_enable_upstream_first
- Bridge 6
- Encoder
Would result in pre_enable's being called as Panel, Bridge 1, Bridge 3,
Bridge 2, Bridge 6, Bridge 5, Bridge 4, Encoder.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
drivers/gpu/drm/drm_bridge.c
include/drm/drm_bridge.h