linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Caleb Connolly <caleb@connolly.tech>
To: Caleb Connolly <caleb@connolly.tech>
Cc: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.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: [PATCH 3/5] drm/panel/samsung-sofef00: make gpio optional
Date: Tue, 20 Jul 2021 15:33:47 +0000	[thread overview]
Message-ID: <20210720153125.43389-4-caleb@connolly.tech> (raw)
In-Reply-To: <20210720153125.43389-1-caleb@connolly.tech>

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)
+		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)
+			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



  parent reply	other threads:[~2021-07-20 15:46 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 ` Caleb Connolly [this message]
2021-07-20 16:03   ` [PATCH 3/5] drm/panel/samsung-sofef00: make gpio optional Bjorn Andersson
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=20210720153125.43389-4-caleb@connolly.tech \
    --to=caleb@connolly.tech \
    --cc=agross@kernel.org \
    --cc=airlied@linux.ie \
    --cc=bjorn.andersson@linaro.org \
    --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 \
    --subject='Re: [PATCH 3/5] drm/panel/samsung-sofef00: make gpio optional' \
    /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

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).