Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/panel: himax-hx8394: Add Panel Rotation Support

Add support for setting the rotation property for the Himax HX8394
panel.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231204185719.569021-5-macroalpha82@gmail.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20231204185719.569021-5-macroalpha82@gmail.com

authored by

Chris Morgan and committed by
Neil Armstrong
a695a500 be478bc7

+15
+15
drivers/gpu/drm/panel/panel-himax-hx8394.c
··· 68 68 struct gpio_desc *reset_gpio; 69 69 struct regulator *vcc; 70 70 struct regulator *iovcc; 71 + enum drm_panel_orientation orientation; 71 72 72 73 const struct hx8394_panel_desc *desc; 73 74 }; ··· 325 324 return 1; 326 325 } 327 326 327 + static enum drm_panel_orientation hx8394_get_orientation(struct drm_panel *panel) 328 + { 329 + struct hx8394 *ctx = panel_to_hx8394(panel); 330 + 331 + return ctx->orientation; 332 + } 333 + 328 334 static const struct drm_panel_funcs hx8394_drm_funcs = { 329 335 .disable = hx8394_disable, 330 336 .unprepare = hx8394_unprepare, 331 337 .prepare = hx8394_prepare, 332 338 .enable = hx8394_enable, 333 339 .get_modes = hx8394_get_modes, 340 + .get_orientation = hx8394_get_orientation, 334 341 }; 335 342 336 343 static int hx8394_probe(struct mipi_dsi_device *dsi) ··· 355 346 if (IS_ERR(ctx->reset_gpio)) 356 347 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), 357 348 "Failed to get reset gpio\n"); 349 + 350 + ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation); 351 + if (ret < 0) { 352 + dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret); 353 + return ret; 354 + } 358 355 359 356 mipi_dsi_set_drvdata(dsi, ctx); 360 357