linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Caleb Connolly <caleb@connolly.tech>
Cc: Andy Gross <agross@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Sam Ravnborg <sam@ravnborg.org>, David Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel@ffwll.ch>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/5] drm/panel/samsung-sofef00: make gpio optional
Date: Tue, 20 Jul 2021 11:03:03 -0500	[thread overview]
Message-ID: <YPbztxBh4cCJF8p3@yoga> (raw)
In-Reply-To: <20210720153125.43389-4-caleb@connolly.tech>

On Tue 20 Jul 10:33 CDT 2021, Caleb Connolly wrote:

> The OnePlus 6T panel fails to initialise if it has been reset,
> workaround this by allowing panels to not specify a reset GPIO.
> 
> Signed-off-by: Caleb Connolly <caleb@connolly.tech>
> ---
>  drivers/gpu/drm/panel/panel-samsung-sofef00.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef00.c b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
> index 8cb1853574bb..a20a5af14653 100644
> --- a/drivers/gpu/drm/panel/panel-samsung-sofef00.c
> +++ b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
> @@ -44,6 +44,8 @@ struct sofef00_panel *to_sofef00_panel(struct drm_panel *panel)
> 
>  static void sofef00_panel_reset(struct sofef00_panel *ctx)
>  {
> +	if (!ctx->reset_gpio)

gpiod_set_value_cansleep(NULL, 1) is a perfectly valid nop, so I don't
think you need to make this conditional.

That said, don't you need this to get the panel out of reset once you
apply power after it being powered off?

> +		return;
>  	gpiod_set_value_cansleep(ctx->reset_gpio, 0);
>  	usleep_range(5000, 6000);
>  	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> @@ -137,7 +139,8 @@ static int sofef00_panel_prepare(struct drm_panel *panel)
>  	ret = sofef00_panel_on(ctx);
>  	if (ret < 0) {
>  		dev_err(dev, "Failed to initialize panel: %d\n", ret);
> -		gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> +		if (ctx->reset_gpio)

Ditto.


Regards,
Bjorn

> +			gpiod_set_value_cansleep(ctx->reset_gpio, 1);
>  		return ret;
>  	}
> 
> @@ -276,7 +279,7 @@ static int sofef00_panel_probe(struct mipi_dsi_device *dsi)
>  		return ret;
>  	}
> 
> -	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
> +	ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
>  	if (IS_ERR(ctx->reset_gpio)) {
>  		ret = PTR_ERR(ctx->reset_gpio);
>  		dev_warn(dev, "Failed to get reset-gpios: %d\n", ret);
> --
> 2.32.0
> 
> 

  reply	other threads:[~2021-07-20 16:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 15:33 [PATCH 0/5] OnePlus 6 fixes Caleb Connolly
2021-07-20 15:33 ` [PATCH 1/5] arm64: dts: qcom: sdm845-oneplus: fix reserved-mem Caleb Connolly
2021-07-20 15:33 ` [PATCH 2/5] dts: arm64: sdm845-oneplus-common: enable debug UART Caleb Connolly
2021-07-20 15:33 ` [PATCH 3/5] drm/panel/samsung-sofef00: make gpio optional Caleb Connolly
2021-07-20 16:03   ` Bjorn Andersson [this message]
2021-07-20 16:24     ` Caleb Connolly
2021-07-20 15:33 ` [PATCH 4/5] arm64: dts: qcom: sdm845-oneplus-fajita: remove panel reset gpio Caleb Connolly
2021-07-20 15:33 ` [PATCH 5/5] arm64: dts: qcom: sdm845-oneplus: add ipa firmware names Caleb Connolly

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=YPbztxBh4cCJF8p3@yoga \
    --to=bjorn.andersson@linaro.org \
    --cc=agross@kernel.org \
    --cc=airlied@linux.ie \
    --cc=caleb@connolly.tech \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sam@ravnborg.org \
    --cc=thierry.reding@gmail.com \
    /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 NNTP newsgroup(s).