* [PATCH] drm/panel: samsung-s6e3fa7: transition to mipi_dsi wrapped functions
@ 2024-09-02 7:10 Tejas Vipin
2024-09-03 23:01 ` Doug Anderson
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Tejas Vipin @ 2024-09-02 7:10 UTC (permalink / raw)
To: neil.armstrong, maarten.lankhorst, mripard, tzimmermann, airlied, daniel
Cc: quic_jesszhan, dianders, dri-devel, linux-kernel, Tejas Vipin
Changes the samsung-s6e3fa7 panel to use multi style functions for
improved error handling.
Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com>
---
drivers/gpu/drm/panel/panel-samsung-s6e3fa7.c | 71 ++++++-------------
1 file changed, 21 insertions(+), 50 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3fa7.c b/drivers/gpu/drm/panel/panel-samsung-s6e3fa7.c
index 10bc8fb5f1f9..27a059b55ae5 100644
--- a/drivers/gpu/drm/panel/panel-samsung-s6e3fa7.c
+++ b/drivers/gpu/drm/panel/panel-samsung-s6e3fa7.c
@@ -38,57 +38,38 @@ static void s6e3fa7_panel_reset(struct s6e3fa7_panel *ctx)
usleep_range(10000, 11000);
}
-static int s6e3fa7_panel_on(struct s6e3fa7_panel *ctx)
+static int s6e3fa7_panel_on(struct mipi_dsi_device *dsi)
{
- struct mipi_dsi_device *dsi = ctx->dsi;
- struct device *dev = &dsi->dev;
- int ret;
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
- ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
- if (ret < 0) {
- dev_err(dev, "Failed to exit sleep mode: %d\n", ret);
- return ret;
- }
- msleep(120);
+ mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
+ mipi_dsi_msleep(&dsi_ctx, 120);
+ mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
- ret = mipi_dsi_dcs_set_tear_on(dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
- if (ret < 0) {
- dev_err(dev, "Failed to set tear on: %d\n", ret);
- return ret;
- }
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf4,
+ 0xbb, 0x23, 0x19, 0x3a, 0x9f, 0x0f, 0x09, 0xc0,
+ 0x00, 0xb4, 0x37, 0x70, 0x79, 0x69);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+ mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x20);
- mipi_dsi_dcs_write_seq(dsi, 0xf0, 0x5a, 0x5a);
- mipi_dsi_dcs_write_seq(dsi, 0xf4,
- 0xbb, 0x23, 0x19, 0x3a, 0x9f, 0x0f, 0x09, 0xc0,
- 0x00, 0xb4, 0x37, 0x70, 0x79, 0x69);
- mipi_dsi_dcs_write_seq(dsi, 0xf0, 0xa5, 0xa5);
- mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x20);
+ mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
- ret = mipi_dsi_dcs_set_display_on(dsi);
- if (ret < 0) {
- dev_err(dev, "Failed to set display on: %d\n", ret);
- return ret;
- }
-
- return 0;
+ return dsi_ctx.accum_err;
}
static int s6e3fa7_panel_prepare(struct drm_panel *panel)
{
struct s6e3fa7_panel *ctx = to_s6e3fa7_panel(panel);
- struct device *dev = &ctx->dsi->dev;
int ret;
s6e3fa7_panel_reset(ctx);
- ret = s6e3fa7_panel_on(ctx);
- if (ret < 0) {
- dev_err(dev, "Failed to initialize panel: %d\n", ret);
+ ret = s6e3fa7_panel_on(ctx->dsi);
+ if (ret < 0)
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
- return ret;
- }
- return 0;
+ return ret;
}
static int s6e3fa7_panel_unprepare(struct drm_panel *panel)
@@ -104,23 +85,13 @@ static int s6e3fa7_panel_disable(struct drm_panel *panel)
{
struct s6e3fa7_panel *ctx = to_s6e3fa7_panel(panel);
struct mipi_dsi_device *dsi = ctx->dsi;
- struct device *dev = &dsi->dev;
- int ret;
-
- ret = mipi_dsi_dcs_set_display_off(dsi);
- if (ret < 0) {
- dev_err(dev, "Failed to set display off: %d\n", ret);
- return ret;
- }
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
- ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
- if (ret < 0) {
- dev_err(dev, "Failed to enter sleep mode: %d\n", ret);
- return ret;
- }
- msleep(120);
+ mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
+ mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
+ mipi_dsi_msleep(&dsi_ctx, 120);
- return 0;
+ return dsi_ctx.accum_err;
}
static const struct drm_display_mode s6e3fa7_panel_mode = {
--
2.46.0
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] drm/panel: samsung-s6e3fa7: transition to mipi_dsi wrapped functions
2024-09-02 7:10 [PATCH] drm/panel: samsung-s6e3fa7: transition to mipi_dsi wrapped functions Tejas Vipin
@ 2024-09-03 23:01 ` Doug Anderson
2024-09-06 22:28 ` Jessica Zhang
2024-09-10 21:29 ` Doug Anderson
2 siblings, 0 replies; 4+ messages in thread
From: Doug Anderson @ 2024-09-03 23:01 UTC (permalink / raw)
To: Tejas Vipin
Cc: neil.armstrong, maarten.lankhorst, mripard, tzimmermann, airlied,
daniel, quic_jesszhan, dri-devel, linux-kernel
Hi,
On Mon, Sep 2, 2024 at 12:10 AM Tejas Vipin <tejasvipin76@gmail.com> wrote:
>
> Changes the samsung-s6e3fa7 panel to use multi style functions for
> improved error handling.
>
> Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com>
> ---
> drivers/gpu/drm/panel/panel-samsung-s6e3fa7.c | 71 ++++++-------------
> 1 file changed, 21 insertions(+), 50 deletions(-)
Reviewed-by: Douglas Anderson <dianders@chromium.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/panel: samsung-s6e3fa7: transition to mipi_dsi wrapped functions
2024-09-02 7:10 [PATCH] drm/panel: samsung-s6e3fa7: transition to mipi_dsi wrapped functions Tejas Vipin
2024-09-03 23:01 ` Doug Anderson
@ 2024-09-06 22:28 ` Jessica Zhang
2024-09-10 21:29 ` Doug Anderson
2 siblings, 0 replies; 4+ messages in thread
From: Jessica Zhang @ 2024-09-06 22:28 UTC (permalink / raw)
To: Tejas Vipin, neil.armstrong, maarten.lankhorst, mripard,
tzimmermann, airlied, daniel
Cc: dianders, dri-devel, linux-kernel
On 9/2/2024 12:10 AM, Tejas Vipin wrote:
> Changes the samsung-s6e3fa7 panel to use multi style functions for
> improved error handling.
>
> Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com>
Reviewed-by: Jessica Zhang <quic_jesszhan@quicinc.com>
> ---
> drivers/gpu/drm/panel/panel-samsung-s6e3fa7.c | 71 ++++++-------------
> 1 file changed, 21 insertions(+), 50 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3fa7.c b/drivers/gpu/drm/panel/panel-samsung-s6e3fa7.c
> index 10bc8fb5f1f9..27a059b55ae5 100644
> --- a/drivers/gpu/drm/panel/panel-samsung-s6e3fa7.c
> +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3fa7.c
> @@ -38,57 +38,38 @@ static void s6e3fa7_panel_reset(struct s6e3fa7_panel *ctx)
> usleep_range(10000, 11000);
> }
>
> -static int s6e3fa7_panel_on(struct s6e3fa7_panel *ctx)
> +static int s6e3fa7_panel_on(struct mipi_dsi_device *dsi)
> {
> - struct mipi_dsi_device *dsi = ctx->dsi;
> - struct device *dev = &dsi->dev;
> - int ret;
> + struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
>
> - ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
> - if (ret < 0) {
> - dev_err(dev, "Failed to exit sleep mode: %d\n", ret);
> - return ret;
> - }
> - msleep(120);
> + mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
> + mipi_dsi_msleep(&dsi_ctx, 120);
> + mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
>
> - ret = mipi_dsi_dcs_set_tear_on(dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
> - if (ret < 0) {
> - dev_err(dev, "Failed to set tear on: %d\n", ret);
> - return ret;
> - }
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf4,
> + 0xbb, 0x23, 0x19, 0x3a, 0x9f, 0x0f, 0x09, 0xc0,
> + 0x00, 0xb4, 0x37, 0x70, 0x79, 0x69);
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x20);
>
> - mipi_dsi_dcs_write_seq(dsi, 0xf0, 0x5a, 0x5a);
> - mipi_dsi_dcs_write_seq(dsi, 0xf4,
> - 0xbb, 0x23, 0x19, 0x3a, 0x9f, 0x0f, 0x09, 0xc0,
> - 0x00, 0xb4, 0x37, 0x70, 0x79, 0x69);
> - mipi_dsi_dcs_write_seq(dsi, 0xf0, 0xa5, 0xa5);
> - mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x20);
> + mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
>
> - ret = mipi_dsi_dcs_set_display_on(dsi);
> - if (ret < 0) {
> - dev_err(dev, "Failed to set display on: %d\n", ret);
> - return ret;
> - }
> -
> - return 0;
> + return dsi_ctx.accum_err;
> }
>
> static int s6e3fa7_panel_prepare(struct drm_panel *panel)
> {
> struct s6e3fa7_panel *ctx = to_s6e3fa7_panel(panel);
> - struct device *dev = &ctx->dsi->dev;
> int ret;
>
> s6e3fa7_panel_reset(ctx);
>
> - ret = s6e3fa7_panel_on(ctx);
> - if (ret < 0) {
> - dev_err(dev, "Failed to initialize panel: %d\n", ret);
> + ret = s6e3fa7_panel_on(ctx->dsi);
> + if (ret < 0)
> gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> - return ret;
> - }
>
> - return 0;
> + return ret;
> }
>
> static int s6e3fa7_panel_unprepare(struct drm_panel *panel)
> @@ -104,23 +85,13 @@ static int s6e3fa7_panel_disable(struct drm_panel *panel)
> {
> struct s6e3fa7_panel *ctx = to_s6e3fa7_panel(panel);
> struct mipi_dsi_device *dsi = ctx->dsi;
> - struct device *dev = &dsi->dev;
> - int ret;
> -
> - ret = mipi_dsi_dcs_set_display_off(dsi);
> - if (ret < 0) {
> - dev_err(dev, "Failed to set display off: %d\n", ret);
> - return ret;
> - }
> + struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
>
> - ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
> - if (ret < 0) {
> - dev_err(dev, "Failed to enter sleep mode: %d\n", ret);
> - return ret;
> - }
> - msleep(120);
> + mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
> + mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
> + mipi_dsi_msleep(&dsi_ctx, 120);
>
> - return 0;
> + return dsi_ctx.accum_err;
> }
>
> static const struct drm_display_mode s6e3fa7_panel_mode = {
> --
> 2.46.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] drm/panel: samsung-s6e3fa7: transition to mipi_dsi wrapped functions
2024-09-02 7:10 [PATCH] drm/panel: samsung-s6e3fa7: transition to mipi_dsi wrapped functions Tejas Vipin
2024-09-03 23:01 ` Doug Anderson
2024-09-06 22:28 ` Jessica Zhang
@ 2024-09-10 21:29 ` Doug Anderson
2 siblings, 0 replies; 4+ messages in thread
From: Doug Anderson @ 2024-09-10 21:29 UTC (permalink / raw)
To: Tejas Vipin
Cc: neil.armstrong, maarten.lankhorst, mripard, tzimmermann, airlied,
daniel, quic_jesszhan, dri-devel, linux-kernel
Hi,
On Mon, Sep 2, 2024 at 12:10 AM Tejas Vipin <tejasvipin76@gmail.com> wrote:
>
> Changes the samsung-s6e3fa7 panel to use multi style functions for
> improved error handling.
>
> Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com>
> ---
> drivers/gpu/drm/panel/panel-samsung-s6e3fa7.c | 71 ++++++-------------
> 1 file changed, 21 insertions(+), 50 deletions(-)
Pushed to drm-misc-next:
[1/1] drm/panel: samsung-s6e3fa7: transition to mipi_dsi wrapped functions
commit: f327bfdbf6c6d7d8e5402795c7c97fb97c2dcf79
-Doug
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-09-10 21:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-02 7:10 [PATCH] drm/panel: samsung-s6e3fa7: transition to mipi_dsi wrapped functions Tejas Vipin
2024-09-03 23:01 ` Doug Anderson
2024-09-06 22:28 ` Jessica Zhang
2024-09-10 21:29 ` Doug Anderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®