aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/panel
diff options
context:
space:
mode:
authorJohn Keeping <john@metanate.com>2021-10-20 16:34:30 +0100
committerSam Ravnborg <sam@ravnborg.org>2021-10-25 18:43:39 +0200
commitd9c022d5dfea9f0b550a3d24ec786d39ff55ad6b (patch)
tree1199270f33ebb58417624631b2617acee9a0024d /drivers/gpu/drm/panel
parentdt-bindings: ili9881c: add rotation property (diff)
downloadlinux-dev-d9c022d5dfea9f0b550a3d24ec786d39ff55ad6b.tar.xz
linux-dev-d9c022d5dfea9f0b550a3d24ec786d39ff55ad6b.zip
drm/panel: ilitek-ili9881c: Read panel orientation
The panel orientation needs to parsed from a device-tree and assigned to the panel's connector in order to make orientation property available to userspace. That's what this patch does for ILI9881C based panels. Signed-off-by: John Keeping <john@metanate.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20211020153432.383845-4-john@metanate.com
Diffstat (limited to 'drivers/gpu/drm/panel')
-rw-r--r--drivers/gpu/drm/panel/panel-ilitek-ili9881c.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
index c12faef76282..754a0c775801 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
@@ -52,6 +52,8 @@ struct ili9881c {
struct regulator *power;
struct gpio_desc *reset;
+
+ enum drm_panel_orientation orientation;
};
#define ILI9881C_SWITCH_PAGE_INSTR(_page) \
@@ -851,6 +853,8 @@ static int ili9881c_get_modes(struct drm_panel *panel,
connector->display_info.width_mm = mode->width_mm;
connector->display_info.height_mm = mode->height_mm;
+ drm_connector_set_panel_orientation(connector, ctx->orientation);
+
return 1;
}
@@ -887,6 +891,13 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
return dev_err_probe(&dsi->dev, PTR_ERR(ctx->reset),
"Couldn't get our reset GPIO\n");
+ ret = of_drm_get_panel_orientation(dsi->dev.of_node, &ctx->orientation);
+ if (ret) {
+ dev_err(&dsi->dev, "%pOF: failed to get orientation: %d\n",
+ dsi->dev.of_node, ret);
+ return ret;
+ }
+
ret = drm_panel_of_backlight(&ctx->panel);
if (ret)
return ret;