diff options
author | Chris Morgan <macromorgan@hotmail.com> | 2021-04-02 22:48:47 +0200 |
---|---|---|
committer | Heiko Stuebner <heiko@sntech.de> | 2021-06-03 15:05:39 +0200 |
commit | 610d9c311b1387f8c4ac602fee1f2a1cb0508707 (patch) | |
tree | 4641fec4618103127743e1931b87385ad7f90a05 /drivers/gpu/drm | |
parent | drm/vboxvideo/modesetting: Provide function names for prototype headers (diff) | |
download | linux-610d9c311b1387f8c4ac602fee1f2a1cb0508707.tar.xz linux-610d9c311b1387f8c4ac602fee1f2a1cb0508707.zip |
drm/panel: add rotation support for Elida KD35T133 panels
Update the panel to allow setting the rotation value in device tree.
Tested on an Odroid Go Advance, where the panel is by default rotated 270
degrees.
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/SN6PR06MB534253E1CFDEA6917230F57BA57A9@SN6PR06MB5342.namprd06.prod.outlook.com
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/panel/panel-elida-kd35t133.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/panel/panel-elida-kd35t133.c b/drivers/gpu/drm/panel/panel-elida-kd35t133.c index fe5ac3ef9018..4787f0833264 100644 --- a/drivers/gpu/drm/panel/panel-elida-kd35t133.c +++ b/drivers/gpu/drm/panel/panel-elida-kd35t133.c @@ -42,6 +42,7 @@ struct kd35t133 { struct gpio_desc *reset_gpio; struct regulator *vdd; struct regulator *iovcc; + enum drm_panel_orientation orientation; bool prepared; }; @@ -216,6 +217,7 @@ static int kd35t133_get_modes(struct drm_panel *panel, connector->display_info.width_mm = mode->width_mm; connector->display_info.height_mm = mode->height_mm; drm_mode_probed_add(connector, mode); + drm_connector_set_panel_orientation(connector, ctx->orientation); return 1; } @@ -258,6 +260,12 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi) return ret; } + ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation); + if (ret < 0) { + dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret); + return ret; + } + mipi_dsi_set_drvdata(dsi, ctx); ctx->dev = dev; |