From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Douglas Anderson <dianders@chromium.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
Daniel Vetter <daniel@ffwll.ch>,
Neil Armstrong <neil.armstrong@linaro.org>,
Jessica Zhang <quic_jesszhan@quicinc.com>,
Sam Ravnborg <sam@ravnborg.org>,
Sumit Semwal <sumit.semwal@linaro.org>,
Caleb Connolly <caleb.connolly@linaro.org>,
Marijn Suijten <marijn.suijten@somainline.org>,
Vinod Koul <vkoul@kernel.org>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Subject: [PATCH RFC 3/7] drm/panel: ilitek-ili9882t: use wrapped MIPI DCS functions
Date: Fri, 10 May 2024 01:37:36 +0300 [thread overview]
Message-ID: <20240510-dsi-panels-upd-api-v1-3-317c78a0dcc8@linaro.org> (raw)
In-Reply-To: <20240510-dsi-panels-upd-api-v1-0-317c78a0dcc8@linaro.org>
Remove conditional code and always use mipi_dsi_dcs_*multi() wrappers to
simplify driver's init/exit code.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/panel/panel-ilitek-ili9882t.c | 30 +++++++++------------------
1 file changed, 10 insertions(+), 20 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9882t.c b/drivers/gpu/drm/panel/panel-ilitek-ili9882t.c
index 58fc1d799371..e7a74d5443b0 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9882t.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9882t.c
@@ -402,19 +402,15 @@ static int starry_ili9882t_init(struct ili9882t *ili)
mipi_dsi_dcs_write_seq_multi(&ctx, 0x92, 0x22);
ili9882t_switch_page(&ctx, 0x00);
- mipi_dsi_dcs_write_seq_multi(&ctx, MIPI_DCS_EXIT_SLEEP_MODE);
- if (ctx.accum_err)
- return ctx.accum_err;
+ mipi_dsi_dcs_exit_sleep_mode_multi(&ctx);
- msleep(120);
+ mipi_dsi_msleep(&ctx, 120);
- mipi_dsi_dcs_write_seq_multi(&ctx, MIPI_DCS_SET_DISPLAY_ON);
- if (ctx.accum_err)
- return ctx.accum_err;
+ mipi_dsi_dcs_set_display_on_multi(&ctx);
- msleep(20);
+ mipi_dsi_msleep(&ctx, 20);
- return 0;
+ return ctx.accum_err;
};
static inline struct ili9882t *to_ili9882t(struct drm_panel *panel)
@@ -424,20 +420,14 @@ static inline struct ili9882t *to_ili9882t(struct drm_panel *panel)
static int ili9882t_enter_sleep_mode(struct ili9882t *ili)
{
- struct mipi_dsi_device *dsi = ili->dsi;
- int ret;
-
- dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
+ struct mipi_dsi_multi_context ctx = { .dsi = ili->dsi };
- ret = mipi_dsi_dcs_set_display_off(dsi);
- if (ret < 0)
- return ret;
+ ili->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
- ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
- if (ret < 0)
- return ret;
+ mipi_dsi_dcs_set_display_off_multi(&ctx);
+ mipi_dsi_dcs_enter_sleep_mode_multi(&ctx);
- return 0;
+ return ctx.accum_err;
}
static int ili9882t_disable(struct drm_panel *panel)
--
2.39.2
next prev parent reply other threads:[~2024-05-09 22:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-09 22:37 [PATCH RFC 0/7] drm/mipi-dsi: simplify MIPI DSI init/cleanup even more Dmitry Baryshkov
2024-05-09 22:37 ` [PATCH RFC 1/7] drm/mipi-dsi: wrap more functions for streamline handling Dmitry Baryshkov
2024-05-10 21:45 ` Doug Anderson
2024-05-10 22:22 ` Dmitry Baryshkov
2024-05-09 22:37 ` [PATCH RFC 2/7] drm/panel: boe-tv101wum-nl6: use wrapped MIPI DCS functions Dmitry Baryshkov
2024-05-10 21:46 ` Doug Anderson
2024-05-09 22:37 ` Dmitry Baryshkov [this message]
2024-05-10 21:46 ` [PATCH RFC 3/7] drm/panel: ilitek-ili9882t: " Doug Anderson
2024-05-09 22:37 ` [PATCH RFC 4/7] drm/panel: innolux-p079zca: use mipi_dsi_dcs_nop_multi() Dmitry Baryshkov
2024-05-10 21:46 ` Doug Anderson
2024-05-09 22:37 ` [PATCH RFC 5/7] drm/panel: novatek-nt36672e: use wrapped MIPI DCS functions Dmitry Baryshkov
2024-05-10 21:46 ` Doug Anderson
2024-05-09 22:37 ` [PATCH RFC 6/7] drm/panel: lg-sw43408: add missing error handling Dmitry Baryshkov
2024-05-10 21:47 ` Doug Anderson
2024-05-10 22:25 ` Dmitry Baryshkov
2024-05-10 22:28 ` Doug Anderson
2024-05-09 22:37 ` [PATCH RFC 7/7] drm/panel: lg-sw43408: use new streamlined MIPI DSI API Dmitry Baryshkov
2024-05-10 21:47 ` Doug Anderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240510-dsi-panels-upd-api-v1-3-317c78a0dcc8@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=airlied@gmail.com \
--cc=caleb.connolly@linaro.org \
--cc=daniel@ffwll.ch \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marijn.suijten@somainline.org \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=quic_jesszhan@quicinc.com \
--cc=sam@ravnborg.org \
--cc=sumit.semwal@linaro.org \
--cc=tzimmermann@suse.de \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).