mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neil Armstrong <neil.armstrong@linaro.org>
To: Icenowy Zheng <zhengxingda@iscas.ac.cn>,
	Jessica Zhang <jesszhan0024@gmail.com>,
	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>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Pengyu Luo <mitltlatltl@gmail.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] drm/panel: himax-hx83121a: add backlight regulator support
Date: Thu, 18 Jun 2026 14:23:40 +0200	[thread overview]
Message-ID: <716f71ae-4642-4f22-8a9f-5b1c017d9ac2@linaro.org> (raw)
In-Reply-To: <20260608162622.403713-3-zhengxingda@iscas.ac.cn>

On 6/8/26 18:26, Icenowy Zheng wrote:
> The backlight, when managed by the panel controller, could be powered by
> an external regulator, and shutting down the regulator could power off
> the backlight.
> 
> Add support for such a regulator. It's powered off when the backlight is
> 0 (either by setting brightness to 0 or setting bl_power), and powered
> on when the backlight should be operating.
> 
> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
> ---
>   drivers/gpu/drm/panel/panel-himax-hx83121a.c | 26 ++++++++++++++++++++
>   1 file changed, 26 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-himax-hx83121a.c b/drivers/gpu/drm/panel/panel-himax-hx83121a.c
> index 1a7e0125bced8..e31e2fba0a787 100644
> --- a/drivers/gpu/drm/panel/panel-himax-hx83121a.c
> +++ b/drivers/gpu/drm/panel/panel-himax-hx83121a.c
> @@ -34,7 +34,9 @@ struct himax {
>   	struct drm_dsc_config dsc;
>   	struct gpio_desc *reset_gpio;
>   	struct regulator_bulk_data *supplies;
> +	struct regulator *bl_supply;
>   	struct backlight_device *backlight;
> +	bool backlight_enabled;
>   };
>   
>   struct panel_desc {
> @@ -195,7 +197,27 @@ static int himax_bl_update_status(struct backlight_device *bl)
>   {
>   	struct himax *ctx = bl_get_data(bl);
>   	u16 brightness = backlight_get_brightness(bl);
> +	int ret = 0;
> +
> +	if (!brightness) {
> +		if (ctx->backlight_enabled)
> +			ret = regulator_disable(ctx->bl_supply);
> +		if (ret)
> +			return ret;
> +
> +		ctx->backlight_enabled = false;
> +
> +		return 0;
> +	}
> +
>   	/* TODO: brightness to raw map table */
> +	if (!ctx->backlight_enabled)
> +		ret = regulator_enable(ctx->bl_supply);
> +	if (ret)
> +		return ret;
> +
> +	ctx->backlight_enabled = true;
> +
>   	return mipi_dsi_dcs_set_display_brightness_large(to_primary_dsi(ctx),
>   							 brightness);
>   }
> @@ -647,6 +669,10 @@ static int himax_probe(struct mipi_dsi_device *dsi)
>   	ctx->panel.prepare_prev_first = true;
>   
>   	if (desc->has_dcs_backlight) {
> +		ctx->bl_supply = devm_regulator_get_optional(dev, "bl");
> +		if (IS_ERR(ctx->bl_supply))
> +			return dev_err_probe(dev, PTR_ERR(ctx->bl_supply),
> +					     "Failed to get backlight supply\n");
>   		ctx->backlight = himax_create_backlight(ctx);
>   		if (IS_ERR(ctx->backlight))
>   			return dev_err_probe(dev, PTR_ERR(ctx->backlight),

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil

  parent reply	other threads:[~2026-06-18 12:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 16:26 [PATCH 1/3] dt-bindings: display: panel: himax,hx83121a: add optional bl supply Icenowy Zheng
2026-06-08 16:26 ` [PATCH 2/3] drm/panel: himax-hx83121a: pass the panel pointer when creating BL Icenowy Zheng
2026-06-18 12:23   ` Neil Armstrong
2026-06-08 16:26 ` [PATCH 3/3] drm/panel: himax-hx83121a: add backlight regulator support Icenowy Zheng
2026-06-11  5:26   ` Pengyu Luo
2026-06-11  5:43     ` Icenowy Zheng
2026-06-11  5:51       ` Pengyu Luo
2026-06-18 12:23   ` Neil Armstrong [this message]
2026-06-08 17:11 ` [PATCH 1/3] dt-bindings: display: panel: himax,hx83121a: add optional bl supply Conor Dooley
2026-06-11  5:26 ` Pengyu Luo
2026-06-11  5:36   ` Icenowy Zheng
2026-06-11  5:45     ` Pengyu Luo
2026-06-11  6:15       ` Icenowy Zheng
2026-06-18 14:01 ` 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=716f71ae-4642-4f22-8a9f-5b1c017d9ac2@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=airlied@gmail.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jesszhan0024@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mitltlatltl@gmail.com \
    --cc=mripard@kernel.org \
    --cc=robh@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    --cc=zhengxingda@iscas.ac.cn \
    /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®