All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Zapolskiy <vz@kernel.org>
To: Linus Walleij <linusw@kernel.org>, Bartosz Golaszewski <brgl@kernel.org>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
	Jessica Zhang <jesszhan0024@gmail.com>,
	Ritesh Kumar <quic_riteshk@quicinc.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org,
	Conor Dooley <conor+dt@kernel.org>,
	devicetree@vger.kernel.org, Abel Vesa <abelvesa@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH v2 03/10] drm/panel: novatek-nt36672e: Fix the reset GPIO polarity
Date: Thu, 3 Dec 2026 21:49:43 +0200	[thread overview]
Message-ID: <0bbfa514-47d5-48ac-924f-1aa78bef815b@kernel.org> (raw)
In-Reply-To: <20261126134508.320700-4-vz@kernel.org>

Linus, Bartosz,

On 11/26/26 15:45, Vladimir Zapolskiy wrote:
> The RESET_N pin of NT36672E panels is an active low signal, however
> the driver drives the reset GPIO with inverted logical values, thus
> the reset GPIO has to be described as active high in device trees,
> which contradicts the panel hardware as well as the panel-common.yaml
> convention.
> 
> Fix the driver to assert the reset GPIO to put the panel into reset,
> and to deassert it to release the panel from reset along with adding
> a gpiolib-of quirk, which enforces the active low polarity of the
> NT36672E panel reset GPIO. With the quirk the reset signal levels
> remain unchanged for dtbs, which describe the reset GPIO as active
> high, and device trees, which describe it as active low, start to work.
> 
> To: Linus Walleij <linusw@kernel.org>
> To: Bartosz Golaszewski <brgl@kernel.org>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Vladimir Zapolskiy <vz@kernel.org>

can you please ack or better take this change to Linux GPIO tree?

Thank you in advance.

> ---
>   drivers/gpio/gpiolib-of.c                      | 9 +++++++++
>   drivers/gpu/drm/panel/panel-novatek-nt36672e.c | 8 ++++----
>   2 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
> index 8bc4562608e1..2e14173196e9 100644
> --- a/drivers/gpio/gpiolib-of.c
> +++ b/drivers/gpio/gpiolib-of.c
> @@ -248,6 +248,15 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np,
>   		 * compatible.
>   		 */
>   		{ "sdw10217201000",	"powerdown-gpios", false },
> +#endif
> +#if IS_ENABLED(CONFIG_DRM_PANEL_NOVATEK_NT36672E)
> +		/*
> +		 * The RESET_N pin of Novatek NT36672E panels is an active low
> +		 * signal, however the panel driver and the device trees used
> +		 * the inverted polarity and described the reset GPIO as
> +		 * active high.
> +		 */
> +		{ "novatek,nt36672e",	"reset-gpios",	false },
>   #endif
>   	};
>   	unsigned int i;
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36672e.c b/drivers/gpu/drm/panel/panel-novatek-nt36672e.c
> index 85902338f10d..364e0855280f 100644
> --- a/drivers/gpu/drm/panel/panel-novatek-nt36672e.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt36672e.c
> @@ -372,12 +372,12 @@ static int nt36672e_power_on(struct nt36672e_panel *ctx)
>   	 * Reset sequence of nt36672e panel requires the panel to be out of reset
>   	 * for 10ms, followed by being held in reset for 10ms and then out again.
>   	 */
> -	gpiod_set_value(ctx->reset_gpio, 1);
> -	usleep_range(10000, 20000);
>   	gpiod_set_value(ctx->reset_gpio, 0);
>   	usleep_range(10000, 20000);
>   	gpiod_set_value(ctx->reset_gpio, 1);
>   	usleep_range(10000, 20000);
> +	gpiod_set_value(ctx->reset_gpio, 0);
> +	usleep_range(10000, 20000);
>   
>   	return 0;
>   }
> @@ -387,7 +387,7 @@ static int nt36672e_power_off(struct nt36672e_panel *ctx)
>   	struct mipi_dsi_device *dsi = ctx->dsi;
>   	int ret = 0;
>   
> -	gpiod_set_value(ctx->reset_gpio, 0);
> +	gpiod_set_value(ctx->reset_gpio, 1);
>   
>   	ret = regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
>   	if (ret)
> @@ -544,7 +544,7 @@ static int nt36672e_panel_probe(struct mipi_dsi_device *dsi)
>   	if (ret < 0)
>   		return ret;
>   
> -	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
> +	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
>   	if (IS_ERR(ctx->reset_gpio))
>   		return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), "Failed to get reset-gpios\n");
>   

-- 
Best wishes,
Vladimir

  parent reply	other threads:[~2026-12-03 19:49 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 13:44 [PATCH v2 00/10] drm/panel: novatek-nt36672e: Add SM8450 HDK display card Vladimir Zapolskiy
2026-11-26 13:44 ` [PATCH v2 01/10] dt-bindings: display: panel: novatek,nt36672e: Describe the reset GPIO as active low Vladimir Zapolskiy
2026-11-26 13:44   ` [PATCH v2 01/10] dt-bindings: display: panel: novatek, nt36672e: " Vladimir Zapolskiy
2026-11-26 13:45 ` [PATCH v2 02/10] dt-bindings: display: panel: novatek,nt36672e: Add bias enable GPIO Vladimir Zapolskiy
2026-11-26 13:45   ` [PATCH v2 02/10] dt-bindings: display: panel: novatek, nt36672e: " Vladimir Zapolskiy
2026-11-26 13:45 ` [PATCH v2 03/10] drm/panel: novatek-nt36672e: Fix the reset GPIO polarity Vladimir Zapolskiy
2026-11-26 13:52   ` sashiko-bot
2026-11-26 14:36     ` Vladimir Zapolskiy
2026-12-03 10:32   ` Neil Armstrong
2026-12-03 19:49   ` Vladimir Zapolskiy [this message]
2026-11-26 13:45 ` [PATCH v2 04/10] drm/panel: novatek-nt36672e: Make the AVDD and AVEE supplies optional Vladimir Zapolskiy
2026-12-03 10:33   ` Neil Armstrong
2026-11-26 13:45 ` [PATCH v2 05/10] drm/panel: novatek-nt36672e: Support the bias enable GPIO Vladimir Zapolskiy
2026-12-03 10:33   ` Neil Armstrong
2026-11-26 13:45 ` [PATCH v2 06/10] drm/panel: novatek-nt36672e: Verify the number of D-PHY data lanes Vladimir Zapolskiy
2026-12-03 10:34   ` Neil Armstrong
2026-11-26 13:45 ` [PATCH v2 07/10] drm/panel: novatek-nt36672e: Add support of the C-PHY panel module Vladimir Zapolskiy
2026-12-03 10:35   ` Neil Armstrong
2026-11-26 13:45 ` [PATCH v2 08/10] arm64: dts: qcom: sm8450-hdk: Add display card overlay Vladimir Zapolskiy
2026-11-26 13:59   ` sashiko-bot
2026-11-26 13:45 ` [PATCH v2 09/10] arm64: dts: qcom: qcm6490-idp: Fix the panel reset GPIO polarity Vladimir Zapolskiy
2026-11-26 14:13   ` Konrad Dybcio
2026-11-26 13:45 ` [PATCH v2 10/10] arm64: dts: qcom: qcm6490-idp: Describe the panel bias enable GPIO Vladimir Zapolskiy

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=0bbfa514-47d5-48ac-924f-1aa78bef815b@kernel.org \
    --to=vz@kernel.org \
    --cc=abelvesa@kernel.org \
    --cc=airlied@gmail.com \
    --cc=andersson@kernel.org \
    --cc=brgl@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jesszhan0024@gmail.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_riteshk@quicinc.com \
    --cc=robh@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.