Devicetree
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: qcom: x1e80100-medion-sprchrgd-14-s1: Enable PWM backlight
@ 2026-11-30 17:40 Fernando Monticelli via B4 Relay
  2026-12-04 23:05 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Fernando Monticelli via B4 Relay @ 2026-11-30 17:40 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Abel Vesa, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel, ggo, Fernando Monticelli

From: Fernando Monticelli <Fernando.Monticelli@cern.ch>

The CSOT MNE007ZA3-2 eDP panel used in this laptop only supports
brightness control through its PWM input pin (DPCD 0x702 = 0x81:
BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP set, BRIGHTNESS_AUX_SET_CAP clear), so
the DP AUX backlight that panel-edp registers ends up with
max_brightness = 0 and brightness cannot be changed.

The Windows ACPI panel configuration (\_SB.GPU0._ROM) describes the
backlight as PMIC PWM on PMIC index 1 (pm8550), bank 3, 9 bit, 2 kHz.
The PWM input of the panel is connected to pm8550 gpio9. Routing LPG
channel 4 to that pin through function "func1" does not work on this
board (the panel stays dark at any duty cycle), but routing it through
the DTEST1 line does. The backlight enable is pmc8380_3 gpio4, which
the Windows display power sequence drives high and the firmware already
leaves high.

Describe the pwm-backlight and wire it up to the panel.

Tested on a Medion SPRCHRGD 14 S1 (X1E78100, BIOS 1.04): brightness
keys and the GNOME slider work across the whole range, and the
backlight survives suspend/resume.

Signed-off-by: Fernando Monticelli <Fernando.Monticelli@cern.ch>
---
 .../dts/qcom/x1e80100-medion-sprchrgd-14-s1.dts    | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/x1e80100-medion-sprchrgd-14-s1.dts b/arch/arm64/boot/dts/qcom/x1e80100-medion-sprchrgd-14-s1.dts
index 9b599917c15a..b161c98ba219 100644
--- a/arch/arm64/boot/dts/qcom/x1e80100-medion-sprchrgd-14-s1.dts
+++ b/arch/arm64/boot/dts/qcom/x1e80100-medion-sprchrgd-14-s1.dts
@@ -52,6 +52,20 @@ wcd938x: audio-codec {
 		#sound-dai-cells = <1>;
 	};
 
+	backlight: backlight {
+		compatible = "pwm-backlight";
+		pwms = <&pm8550_pwm 3 500000>;
+
+		brightness-levels = <0 2048 4096 8192 16384 65535>;
+		num-interpolated-steps = <20>;
+		default-brightness-level = <80>;
+
+		enable-gpios = <&pmc8380_3_gpios 4 GPIO_ACTIVE_HIGH>;
+
+		pinctrl-0 = <&edp_bl_en>, <&edp_bl_pwm>;
+		pinctrl-names = "default";
+	};
+
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
@@ -997,6 +1011,7 @@ &mdss_dp3 {
 	aux-bus {
 		panel {
 			compatible = "edp-panel";
+			backlight = <&backlight>;
 			power-supply = <&vreg_edp_3p3>;
 
 			port {
@@ -1084,6 +1099,11 @@ &pcie6a_port0 {
 };
 
 &pm8550_gpios {
+	edp_bl_pwm: edp-bl-pwm-state {
+		pins = "gpio9";
+		function = "dtest1";
+	};
+
 	rtmr0_default: rtmr0-reset-n-active-state {
 		pins = "gpio10";
 		function = "normal";
@@ -1103,6 +1123,16 @@ usb0_3p3_reg_en: usb0-3p3-reg-en-state {
 	};
 };
 
+&pm8550_pwm {
+	/*
+	 * The panel PWM input is on pm8550 gpio9, which LPG channel 4 only
+	 * reaches through the DTEST1 line (the func1 path does not work).
+	 */
+	qcom,dtest = <0 0>, <0 0>, <0 0>, <1 1>;
+
+	status = "okay";
+};
+
 &pm8550ve_9_gpios {
 	usb0_1p8_reg_en: usb0-1p8-reg-en-state {
 		pins = "gpio8";
@@ -1114,6 +1144,16 @@ usb0_1p8_reg_en: usb0-1p8-reg-en-state {
 	};
 };
 
+&pmc8380_3_gpios {
+	edp_bl_en: edp-bl-en-state {
+		pins = "gpio4";
+		function = "normal";
+		power-source = <1>; /* 1.8V */
+		input-disable;
+		output-enable;
+	};
+};
+
 &pmc8380_5_gpios {
 	usb0_pwr_1p15_reg_en: usb0-pwr-1p15-reg-en-state {
 		pins = "gpio8";

---
base-commit: dde0308a2f8867806a444df1fdd7e685b1c56d5b
change-id: 20261130-arm64-for-7-5-caecf7bd4bed

Best regards,
--  
Fernando Monticelli <Fernando.Monticelli@cern.ch>



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-04 23:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 17:40 [PATCH] arm64: dts: qcom: x1e80100-medion-sprchrgd-14-s1: Enable PWM backlight Fernando Monticelli via B4 Relay
2026-12-04 23:05 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox