0633e6080ef36899d4d1a918b94b4f95106f820a
[openwrt/staging/lynxis.git] /
1 From b5a2faf6deb6e7accec2c121840a72bdf6e97b4c 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
5 drm_panel
6
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.
11
12 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
13 ---
14 drivers/gpu/drm/bridge/panel.c | 3 +++
15 include/drm/drm_panel.h | 10 ++++++++++
16 2 files changed, 13 insertions(+)
17
18 --- a/drivers/gpu/drm/bridge/panel.c
19 +++ b/drivers/gpu/drm/bridge/panel.c
20 @@ -225,6 +225,9 @@ struct drm_bridge *drm_panel_bridge_add_
21 panel_bridge->bridge.ops = DRM_BRIDGE_OP_MODES;
22 panel_bridge->bridge.type = connector_type;
23
24 + panel_bridge->bridge.pre_enable_upstream_first =
25 + panel->prepare_upstream_first;
26 +
27 drm_bridge_add(&panel_bridge->bridge);
28
29 return &panel_bridge->bridge;
30 --- a/include/drm/drm_panel.h
31 +++ b/include/drm/drm_panel.h
32 @@ -179,6 +179,16 @@ struct drm_panel {
33 * Panel entry in registry.
34 */
35 struct list_head list;
36 +
37 + /**
38 + * @prepare_upstream_first:
39 + *
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.
44 + */
45 + bool prepare_upstream_first;
46 };
47
48 void drm_panel_init(struct drm_panel *panel, struct device *dev,