diff options
author | Sebastian Reichel <sre@kernel.org> | 2023-07-14 03:37:48 +0200 |
---|---|---|
committer | Neil Armstrong <neil.armstrong@linaro.org> | 2023-08-01 10:29:56 +0200 |
commit | 7a6288726cf6bc0fa1bca0f24922a06425b84bf1 (patch) | |
tree | 5f8bf83328fed68f23615812bfb9853c7f89ef5c | |
parent | drm/panel: sitronix-st7789v: add media bus format (diff) | |
download | linux-7a6288726cf6bc0fa1bca0f24922a06425b84bf1.tar.xz linux-7a6288726cf6bc0fa1bca0f24922a06425b84bf1.zip |
drm/panel: sitronix-st7789v: avoid hardcoding invert mode
While the default panel uses invert mode, some panels
require non-invert mode instead.
Reviewed-by: Michael Riesch <michael.riesch@wolfvision.net>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230714013756.1546769-12-sre@kernel.org
-rw-r--r-- | drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index d05d7a9caefc..ee84d7a9019e 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c @@ -112,6 +112,7 @@ struct st7789_panel_info { const struct drm_display_mode *mode; u32 bus_format; + bool invert_mode; }; struct st7789v { @@ -171,6 +172,7 @@ static const struct drm_display_mode default_mode = { static const struct st7789_panel_info default_panel = { .mode = &default_mode, + .invert_mode = true, .bus_format = MEDIA_BUS_FMT_RGB666_1X18, }; @@ -321,7 +323,13 @@ static int st7789v_prepare(struct drm_panel *panel) ST7789V_TEST(ret, st7789v_write_data(ctx, ST7789V_NVGAMCTRL_VN61(0x1b))); ST7789V_TEST(ret, st7789v_write_data(ctx, ST7789V_NVGAMCTRL_VN62(0x28))); - ST7789V_TEST(ret, st7789v_write_command(ctx, MIPI_DCS_ENTER_INVERT_MODE)); + if (ctx->info->invert_mode) { + ST7789V_TEST(ret, st7789v_write_command(ctx, + MIPI_DCS_ENTER_INVERT_MODE)); + } else { + ST7789V_TEST(ret, st7789v_write_command(ctx, + MIPI_DCS_EXIT_INVERT_MODE)); + } ST7789V_TEST(ret, st7789v_write_command(ctx, ST7789V_RAMCTRL_CMD)); ST7789V_TEST(ret, st7789v_write_data(ctx, ST7789V_RAMCTRL_DM_RGB | |