From: Tejas Vipin <tejasvipin76@gmail.com>
To: Doug Anderson <dianders@chromium.org>
Cc: neil.armstrong@linaro.org, maarten.lankhorst@linux.intel.com,
mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
simona@ffwll.ch, quic_jesszhan@quicinc.com,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/panel: leadtek-ltk050h3146w: transition to mipi_dsi wrapped functions
Date: Wed, 30 Oct 2024 12:54:13 +0530 [thread overview]
Message-ID: <c389ea3e-70cb-46c5-8cf1-878a99f771ec@gmail.com> (raw)
In-Reply-To: <CAD=FV=Vps5vWD72O_kYhuKudduYed41+tZrVRB6x+FiaZrm-EA@mail.gmail.com>
On 10/29/24 12:24 AM, Doug Anderson wrote:
> Hi,
>
> On Fri, Oct 25, 2024 at 9:00 PM Tejas Vipin <tejasvipin76@gmail.com> wrote:
>>
>> @@ -418,79 +398,42 @@ static const struct ltk050h3146w_desc ltk050h3146w_data = {
>> MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET,
>> };
>>
>> -static int ltk050h3146w_a2_select_page(struct ltk050h3146w *ctx, int page)
>> +static void ltk050h3146w_a2_select_page(struct mipi_dsi_multi_context *dsi_ctx, int page)
>> {
>> - struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
>> - u8 d[3] = { 0x98, 0x81, page };
>> + u8 d[4] = { 0xff, 0x98, 0x81, page };
>>
>> - return mipi_dsi_dcs_write(dsi, 0xff, d, ARRAY_SIZE(d));
>> + mipi_dsi_dcs_write_buffer_multi(dsi_ctx, d, ARRAY_SIZE(d));
>
> FWIW: the above might be slightly better as:
>
> mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x98, 0x81, page);
>
> That would make it more documenting that the 0xff is the "cmd", has
> fewer lines of code, and also gets the array marked as "static const"
> which might make the compiler slightly more efficient. ;-)
>
> Not really a huge deal, though.
>
I did try this initially, but got an error because of page not being a
compile time constant. Not sure how I should handle this.
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
--
Tejas Vipin
next prev parent reply other threads:[~2024-10-30 7:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-26 3:59 [PATCH] drm/panel: leadtek-ltk050h3146w: transition to mipi_dsi wrapped functions Tejas Vipin
2024-10-28 18:54 ` Doug Anderson
2024-10-30 7:24 ` Tejas Vipin [this message]
2024-10-30 16:26 ` neil.armstrong
2024-10-30 17:50 ` Doug Anderson
2024-10-31 9:34 ` neil.armstrong
2024-10-31 10:18 ` Neil Armstrong
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=c389ea3e-70cb-46c5-8cf1-878a99f771ec@gmail.com \
--to=tejasvipin76@gmail.com \
--cc=airlied@gmail.com \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=quic_jesszhan@quicinc.com \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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