Message ID | 886ce1a2443dfb58496f47734d1ceffd3325fb4b.1729738189.git.jahau@rocketmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Add new panel driver Samsung S6E88A0-AMS427AP24 | expand |
Hi Jakob, thanks for your patch! On Thu, Oct 24, 2024 at 5:18 AM Jakob Hauser <jahau@rocketmail.com> wrote: > The way of implementing a flip option follows the existing > panel-samsung-s6e8aa0.c [1][2][3]. That driver is notoriously hard to read because it uses so much magic numbers so please don't copy that aspect of the driver. (...) > + if (ctx->flip_horizontal) > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xcb, 0x0e); #define S6E88A0_SET_FLIP 0xcb or something like this. Other than that it looks good! Yours, Linus Walleij
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams427ap24.c b/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams427ap24.c index 9e211be432d7..cbd51351a325 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams427ap24.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams427ap24.c @@ -32,6 +32,7 @@ struct s6e88a0_ams427ap24 { struct mipi_dsi_device *dsi; struct regulator_bulk_data *supplies; struct gpio_desc *reset_gpio; + bool flip_horizontal; }; static const struct regulator_bulk_data s6e88a0_ams427ap24_supplies[] = { @@ -538,6 +539,10 @@ static int s6e88a0_ams427ap24_on(struct s6e88a0_ams427ap24 *ctx) mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xcc, 0x4c); mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf2, 0x03, 0x0d); mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf1, 0xa5, 0xa5); + + if (ctx->flip_horizontal) + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xcb, 0x0e); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5); mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xfc, 0xa5, 0xa5); @@ -698,6 +703,8 @@ static int s6e88a0_ams427ap24_probe(struct mipi_dsi_device *dsi) DRM_MODE_CONNECTOR_DSI); ctx->panel.prepare_prev_first = true; + ctx->flip_horizontal = device_property_read_bool(dev, "flip-horizontal"); + ret = s6e88a0_ams427ap24_register_backlight(ctx); if (ret < 0) return ret;