[PATCH v4 3/3] drm/panel: clockworkpi-cwd686: Implement .get_orientation callback
From: Charlotte �eńkec
Date: Tue Apr 01 2025 - 04:21:45 EST
From: Max Fierke <max@xxxxxxxxxxxxx>
Returns the panel's configured orientation
Signed-off-by: Max Fierke <max@xxxxxxxxxxxxx>
---
drivers/gpu/drm/panel/panel-clockwork-cwd686.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panel/panel-clockwork-cwd686.c b/drivers/gpu/drm/panel/panel-clockwork-cwd686.c
index 53d65e6df1b0..49db20de06c1 100644
--- a/drivers/gpu/drm/panel/panel-clockwork-cwd686.c
+++ b/drivers/gpu/drm/panel/panel-clockwork-cwd686.c
@@ -340,7 +340,10 @@ static int cwd686_get_modes(struct drm_panel *panel, struct drm_connector *conne
drm_mode_set_name(mode);
mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
- /* Set up connector's "panel orientation" property */
+ /*
+ * TODO: Remove once all drm drivers call
+ * drm_connector_set_orientation_from_panel()
+ */
drm_connector_set_panel_orientation(connector, ctx->orientation);
drm_mode_probed_add(connector, mode);
@@ -348,10 +351,19 @@ static int cwd686_get_modes(struct drm_panel *panel, struct drm_connector *conne
return 1; /* Number of modes */
}
+
+static enum drm_panel_orientation cwd686_get_orientation(struct drm_panel *panel)
+{
+ struct cwd686 *ctx = panel_to_cwd686(panel);
+
+ return ctx->orientation;
+}
+
static const struct drm_panel_funcs cwd686_drm_funcs = {
.unprepare = cwd686_unprepare,
.prepare = cwd686_prepare,
.get_modes = cwd686_get_modes,
+ .get_orientation = cwd686_get_orientation,
};
static int cwd686_probe(struct mipi_dsi_device *dsi)
--
2.48.1