From f5d413d7c5a758aa223a38b20d2e142357254f72 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Thu, 30 Mar 2023 13:45:08 +0200
Subject: [PATCH 405/480] arm64: dts: rk3399-pinephone-pro: Switch LED
 backlight PWM from 1kHz to 20kHz

This gets rid of measurable backlight flicker, because LED driver's feedback
voltage reference lowpass filter is now driven above the cutoff frequency
of 5 kHz.

Also adapt the brightness levels curve, to make sure the lowest setting
satisfies requirement to have duty cycle at least 250ns. Backlight LED
driver doesn't react to smaller pulses on the EN/PWM pin.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
 arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
index bedf5bbda152..98042139dd89 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
@@ -207,6 +207,14 @@
 	backlight: backlight {
 		compatible = "pwm-backlight";
 		pwms = <&pwm0 0 50000 0>;
+		brightness-levels =
+			<0 250 360 470 580 690 810 949 1110 1294 1502
+			1737 1998 2289 2610 2964 3351 3774 4233 4731
+			5268 5847 6467 7133 7845 8604 9412 10271 11182
+			12146 13164 14239 15374 16568 17822 19140 20521
+			21969 23483 25068 26722 28447 30247 32121 34071
+			36099 38210 40400 42669 45026 47468 50000>;
+		default-brightness-level = <17>;
 	};
 
 	gpio-keys {
-- 
2.49.0

