mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejas Vipin <tejasvipin76@gmail.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: neil.armstrong@linaro.org, quic_jesszhan@quicinc.com,
	dianders@chromium.org, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
	daniel@ffwll.ch, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] drm/panel: raydium-rm692e5: transition to mipi_dsi wrapped functions
Date: Wed, 19 Jun 2024 12:52:57 +0530	[thread overview]
Message-ID: <a9312102-44c1-4529-b3ef-a7831392c42f@gmail.com> (raw)
In-Reply-To: <mozxxkpqlboh2w7bf55bezgcy5b2jfgepmgullgd24dtmwfva2@mghwg3c5an5y>



On 6/19/24 12:06 PM, Dmitry Baryshkov wrote:
> On Wed, Jun 19, 2024 at 09:03:49AM GMT, Tejas Vipin wrote:
>> Use functions introduced in commit 966e397e4f60 ("drm/mipi-dsi: Introduce
>> mipi_dsi_*_write_seq_multi()") and commit f79d6d28d8fe
>> ("drm/mipi-dsi: wrap more functions for streamline handling") for the
>> raydium rm692e5 panel.
>>
>> Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com>
>> ---
>> Changes in v2:
>>     - Change rm692e5_on to return void and take mipi_dsi_multi_context
>>       as an argument.
>>     - Remove unnecessary warnings.
>>     - More efficient error handling in rm692e5_prepare
>>
>> v1: https://lore.kernel.org/all/20240615093758.65431-1-tejasvipin76@gmail.com/
>> ---
>>  drivers/gpu/drm/panel/panel-raydium-rm692e5.c | 237 ++++++++----------
>>  1 file changed, 99 insertions(+), 138 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/panel/panel-raydium-rm692e5.c b/drivers/gpu/drm/panel/panel-raydium-rm692e5.c
>> index 21d97f6b8a2f..9936bda61af2 100644
>> --- a/drivers/gpu/drm/panel/panel-raydium-rm692e5.c
>> +++ b/drivers/gpu/drm/panel/panel-raydium-rm692e5.c
> 
>>  static int rm692e5_prepare(struct drm_panel *panel)
>>  {
>>  	struct rm692e5_panel *ctx = to_rm692e5_panel(panel);
>>  	struct drm_dsc_picture_parameter_set pps;
>> -	struct device *dev = &ctx->dsi->dev;
>> -	int ret;
>> +	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
>>  
>> -	ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
>> -	if (ret < 0) {
>> -		dev_err(dev, "Failed to enable regulators: %d\n", ret);
>> -		return ret;
>> -	}
>> +	dsi_ctx.accum_err = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
>> +	if (dsi_ctx.accum_err)
>> +		return dsi_ctx.accum_err;
> 
> int ret, please. Let's leave dsi_ctx.accum_err for DSI errors only.
> LGTM otherwise.

Is this really necessary seeing how regulator_bulk_enable returns
0 on success anyways? It saves creating a new variable for a single
check. In case you do think its necessary, should it be changed in
himax_hx83102 too?

> 
>>  
>>  	rm692e5_reset(ctx);
>>  
>> -	ret = rm692e5_on(ctx);
>> -	if (ret < 0) {
>> -		dev_err(dev, "Failed to initialize panel: %d\n", ret);
>> -		gpiod_set_value_cansleep(ctx->reset_gpio, 1);
>> -		regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
>> -		return ret;
>> -	}
>> +	rm692e5_on(&dsi_ctx);
>>  
> 
> 

-- 
---
Tejas Vipin

  reply	other threads:[~2024-06-19  7:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19  3:33 Tejas Vipin
2024-06-19  6:36 ` Dmitry Baryshkov
2024-06-19  7:22   ` Tejas Vipin [this message]
2024-06-20 14:42     ` Doug Anderson
2024-06-20 14:54       ` Dmitry Baryshkov
2024-06-20 14:48 ` 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=a9312102-44c1-4529-b3ef-a7831392c42f@gmail.com \
    --to=tejasvipin76@gmail.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dianders@chromium.org \
    --cc=dmitry.baryshkov@linaro.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=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

all inboxes | Powered by JetHome®