mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ettore Chimenti" <ettore.chimenti@linaro.org>
To: <ferreira@se-rg.io>, "Bjorn Andersson" <andersson@kernel.org>,
	"Konrad Dybcio" <konradybcio@kernel.org>,
	"Abel Vesa" <abelvesa@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>
Cc: <linux-arm-msm@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	"Georg Gottleuber" <ggo@tuxedocomputers.com>,
	"Ettore Chimenti" <ek5.chimenti@gmail.com>,
	"Jens Glathe" <jens.glathe@oldschoolsolutions.biz>,
	"Srinivas Kandagatla" <srini@kernel.org>
Subject: Re: [PATCH v2] arm64: dts: qcom: x1e80100-medion-sprchrgd-14-s1: Add PWM backlight
Date: Mon, 26 Oct 2026 18:08:38 +0100	[thread overview]
Message-ID: <DMEXOUF2X7O6.3W5B9URS8YOEF@linaro.org> (raw)
In-Reply-To: <20261025-medion-sprchrgd-14-backlight-v2-1-bf2979485ec2@se-rg.io>

Hi Sérgio,

On Sun Oct 25, 2026 at 8:51 AM CET, Sérgio Ferreira via B4 Relay wrote:
> From: Sérgio Ferreira <ferreira@se-rg.io>
>
> The eDP panel (CSOT MNE007ZA3-2, IPS LCD) cannot have its brightness
> set over eDP AUX. With no backlight phandle on the panel, panel-edp
> falls back to the DP AUX backlight, which registers dp_aux_backlight
> with a maximum brightness of 0, so brightness control has no effect.
>
> Brightness is driven by PWM instead. UEFI leaves PM8550 LPG channel 3
> running and the PWM output configured on PM8550 GPIO 8, and drives
> PMC8380_3 GPIO 4 high as the backlight enable:
>
>   pm8550 gpio8 : out low func1 vin-0 no pull push-pull medium
>   pmc8380_3 gpio4 : out  high normal  vin-1 pull-down push-pull medium
>
> The panel configuration in the Windows ACPI tables confirmed this.
> (PMIC-controlled PWM, PMIC 1, bank 3, 9-bit, 2 kHz).
>
> Describe this with a pwm-backlight node: enable pm8550_pwm, add pinctrl
> states for the enable GPIO and for gpio8 func1, and attach the
> backlight to the panel.
>
> Tested on a Medion SPRCHRGD 14 S1 (X1E78100): brightness control over
> the full range, brightness keys, suspend/resume and restore after
> reboot.
>
> Assisted-by: LLM
> Signed-off-by: Sérgio Ferreira <ferreira@se-rg.io>
> ---

I tested this on a Medion SPRCHRGD 14 S1, but the controls are inverted.
When increasing the backlight lightness it actually decreases it, and
vice versa.

```
% cat /sys/class/backlight/backlight/max_brightness
4095

% echo 1 | sudo tee /sys/class/backlight/backlight/brightness
1 # BRIGHT

% echo 2000 | sudo tee /sys/class/backlight/backlight/brightness
2000 # LESS BRIGHT

% echo 4095 | sudo tee /sys/class/backlight/backlight/brightness
4095 # OFF

% echo 0 | sudo tee /sys/class/backlight/backlight/brightness
0 # OFF
```

Moreover, I see that from `/sys/kernel/debug/pwm` the period
request differs from the actual:

```
 pwm-3   (backlight           ): requested
    requested configuration:  enabled, 498418/500000 ns, normal polarity
    # with brightness set at 4090:
    actual configuration:     enabled, 425834/425834 ns, normal polarity
    # with brightness set at 2:
                                            0/425834 ns, normal polarity
```

This probably causes the top 250 values to be all at the same
brightness. Not a big deal probably.

Do you have the same behavior? Can you send the EDID of your panel? 

Thanks,
Ettore

  parent reply	other threads:[~2026-10-26 17:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-25  7:51 Sérgio Ferreira via B4 Relay
2026-10-26 10:00 ` Konrad Dybcio
2026-10-26 17:08 ` Ettore Chimenti [this message]
2026-10-26 18:26   ` Sérgio Ferreira
2026-10-27 16:25     ` Ettore Chimenti
2026-10-28 15:40 ` Abel Vesa

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=DMEXOUF2X7O6.3W5B9URS8YOEF@linaro.org \
    --to=ettore.chimenti@linaro.org \
    --cc=abelvesa@kernel.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ek5.chimenti@gmail.com \
    --cc=ferreira@se-rg.io \
    --cc=ggo@tuxedocomputers.com \
    --cc=jens.glathe@oldschoolsolutions.biz \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=srini@kernel.org \
    /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®