From: Aaron Kling Date: Fri, 25 Sep 2026 02:08:20 -0500 Subject: [PATCH v2 2/4] drm/panel: visionox-vtdr6130: Add panel orientation support MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260925-rp6-panel-v2-2-19c425e523de@gmail.com> References: <20260925-rp6-panel-v2-0-19c425e523de@gmail.com> In-Reply-To: <20260925-rp6-panel-v2-0-19c425e523de@gmail.com> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Aaron Kling X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790320100; l=2208; i=webgeek1234@gmail.com; s=20250217; h=from:subject:message-id; bh=XYfhvMoyxwMtq/M1dOwLhFn0oqv6k+OlxjCG6KQEnFE=; b=ugTdYHBOlhgxveZ3vh05Cq9/fm4/x7uPDm7b3ziQhPe6yODtFtKzIESE7H/W+qaTGFQ6quPvC t47Uo0vVC37A+4sH5X+mVvp+UFrN8nFzV2zbFuBiwHojSsFTGKz8LrL X-Developer-Key: i=webgeek1234@gmail.com; a=ed25519; pk=TQwd6q26txw7bkK7B8qtI/kcAohZc7bHHGSD7domdrU= X-Endpoint-Received: by B4 Relay for webgeek1234@gmail.com/20250217 with auth_id=342 List-Id: B4 Relay Submissions Fetch orientation from the device tree if provided. Reviewed-by: Neil Armstrong Signed-off-by: Aaron Kling --- drivers/gpu/drm/panel/panel-visionox-vtdr6130.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-visionox-vtdr6130.c b/drivers/gpu/drm/panel/panel-visionox-vtdr6130.c index 6733e0e1d0612..b66d6c7128c75 100644 --- a/drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +++ b/drivers/gpu/drm/panel/panel-visionox-vtdr6130.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -22,6 +23,7 @@ struct visionox_vtdr6130 { struct mipi_dsi_device *dsi; struct gpio_desc *reset_gpio; struct regulator_bulk_data *supplies; + enum drm_panel_orientation orientation; }; static const struct regulator_bulk_data visionox_vtdr6130_supplies[] = { @@ -218,10 +220,18 @@ static int visionox_vtdr6130_get_modes(struct drm_panel *panel, return 1; } +static enum drm_panel_orientation visionox_vtdr6130_get_orientation(struct drm_panel *panel) +{ + struct visionox_vtdr6130 *ctx = to_visionox_vtdr6130(panel); + + return ctx->orientation; +} + static const struct drm_panel_funcs visionox_vtdr6130_panel_funcs = { .prepare = visionox_vtdr6130_prepare, .unprepare = visionox_vtdr6130_unprepare, .get_modes = visionox_vtdr6130_get_modes, + .get_orientation = visionox_vtdr6130_get_orientation, }; static int visionox_vtdr6130_bl_update_status(struct backlight_device *bl) @@ -293,6 +303,12 @@ static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi) MIPI_DSI_CLOCK_NON_CONTINUOUS; ctx->panel.prepare_prev_first = true; + ret = drm_of_get_panel_orientation(dev->of_node, &ctx->orientation); + if (ret < 0) { + dev_err(dev, "Failed to get orientation %d\n", ret); + return ret; + } + ctx->panel.backlight = visionox_vtdr6130_create_backlight(dsi); if (IS_ERR(ctx->panel.backlight)) return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight), -- 2.54.0