arm64: dts: qcom: msm8916-samsung-fortuna: Add PWM backlight
authorSiddharth Manthan <siddharth.manthan@gmail.com>
Thu, 4 Apr 2024 12:17:57 +0000 (12:17 +0000)
committerBjorn Andersson <andersson@kernel.org>
Thu, 4 Apr 2024 21:06:33 +0000 (16:06 -0500)
Most of the Galaxy Grand Prime use backlight drivers controlled with PWM
signal.
To simplify the description, add the backlight with the necessary clk-pwm
to the common dtsi.

Signed-off-by: Siddharth Manthan <siddharth.manthan@gmail.com>
[Stephan: Move to fortuna-common and disable on rossa-common]
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
[Raymond: Add the commit message]
Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
Link: https://lore.kernel.org/r/20240404121703.17086-3-raymondhackley@protonmail.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi
arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi

index 6c66a24ef1afc19d4ffa1b3b98e504f241087783..5e933fb8b363f99688069dedd7b1f8ba8207949c 100644 (file)
                };
        };
 
+       clk_pwm_backlight: backlight {
+               compatible = "pwm-backlight";
+               pwms = <&clk_pwm 0 100000>;
+
+               enable-gpios = <&tlmm 98 GPIO_ACTIVE_HIGH>;
+
+               brightness-levels = <0 255>;
+               num-interpolated-steps = <255>;
+               default-brightness-level = <128>;
+
+               pinctrl-0 = <&backlight_en_default>;
+               pinctrl-names = "default";
+       };
+
+       clk_pwm: pwm {
+               compatible = "clk-pwm";
+               #pwm-cells = <2>;
+
+               clocks = <&gcc GCC_GP2_CLK>;
+
+               pinctrl-0 = <&backlight_pwm_default>;
+               pinctrl-names = "default";
+       };
+
        gpio-keys {
                compatible = "gpio-keys";
 
 };
 
 &tlmm {
+       backlight_en_default: backlight-en-default-state {
+               pins = "gpio98";
+               function = "gpio";
+               drive-strength = <2>;
+               bias-disable;
+       };
+
+       backlight_pwm_default: backlight-pwm-default-state {
+               pins = "gpio50";
+               function = "gcc_gp2_clk_a";
+       };
+
        fg_alert_default: fg-alert-default-state {
                pins = "gpio121";
                function = "gpio";
index 4048b72efcdc118b423e7401b94d6d0046429d24..b438fa81886c5a31117a27bb6d35aae6db1e1aaf 100644 (file)
                pinctrl-names = "default";
        };
 };
+
+/* On rossa backlight is controlled with MIPI DCS commands */
+&clk_pwm {
+       status = "disabled";
+};
+
+&clk_pwm_backlight {
+       status = "disabled";
+};