1 From 9ac3eedd8cda7d5f2429edc0bdba137c35e07157 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 23 Feb 2022 15:36:56 +0000
4 Subject: [PATCH] drm/panel: Add prepare_upstream_first flag to
7 Mapping to the drm_bridge flag pre_enable_upstream_first,
8 add a new flag prepare_upstream_first to drm_panel to allow
9 the panel driver to request that the upstream bridge should
10 be pre_enabled before the panel prepare.
12 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
14 drivers/gpu/drm/bridge/panel.c | 3 +++
15 include/drm/drm_panel.h | 10 ++++++++++
16 2 files changed, 13 insertions(+)
18 --- a/drivers/gpu/drm/bridge/panel.c
19 +++ b/drivers/gpu/drm/bridge/panel.c
20 @@ -258,6 +258,9 @@ struct drm_bridge *drm_panel_bridge_add_
21 panel_bridge->bridge.ops = DRM_BRIDGE_OP_MODES;
22 panel_bridge->bridge.type = connector_type;
24 + panel_bridge->bridge.pre_enable_upstream_first =
25 + panel->prepare_upstream_first;
27 drm_bridge_add(&panel_bridge->bridge);
29 return &panel_bridge->bridge;
30 --- a/include/drm/drm_panel.h
31 +++ b/include/drm/drm_panel.h
32 @@ -196,6 +196,16 @@ struct drm_panel {
33 * Panel entry in registry.
35 struct list_head list;
38 + * @prepare_upstream_first:
40 + * The upstream controller should be prepared first, before the prepare
41 + * for the panel is called. This is largely required for DSI panels
42 + * where the DSI host controller should be initialised to LP-11 before
43 + * the panel is powered up.
45 + bool prepare_upstream_first;
48 void drm_panel_init(struct drm_panel *panel, struct device *dev,