[PATCH] arm64: dts: qcom: c630: Add backlight controller

From: Bjorn Andersson
Date: Mon Dec 07 2020 - 23:47:52 EST


The Lenovo Yoga C630 uses the PWM controller in the TI SN65DSI86 bridge
chip to provide a signal for the backlight control and has TLMM GPIO 11
attached to some regulator that drives the backlight.

Unfortunately the regulator attached to this gpio is also powering the
camera, so turning off backlight result in the detachment of the camera
as well.

Signed-off-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx>
---

This depends on the implementation of the pwm_chip in the TI SN65DSI86 bridge
driver [1], but posting this for reference and testing of said patch. The patch
can further be improved by the inclusion of something like [2] and by adding
"backlight = <&backlight>; to the panel node, which will result in DPMS
operations turning the panel on and off.

[1] https://lore.kernel.org/linux-arm-msm/20201208044022.972872-1-bjorn.andersson@xxxxxxxxxx/
[2] https://lore.kernel.org/lkml/20201208044446.973238-1-bjorn.andersson@xxxxxxxxxx/

arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
index bdd5d92ee6c3..851e5833cab5 100644
--- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
+++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
@@ -64,6 +64,12 @@ sn65dsi86_refclk: sn65dsi86-refclk {

clock-frequency = <19200000>;
};
+
+ backlight: backlight {
+ compatible = "pwm-backlight";
+ pwms = <&sn65dsi86 1000000>;
+ enable-gpios = <&tlmm 11 GPIO_ACTIVE_HIGH>;
+ };
};

&adsp_pas {
@@ -385,6 +391,8 @@ sn65dsi86: bridge@2c {
clocks = <&sn65dsi86_refclk>;
clock-names = "refclk";

+ #pwm-cells = <1>;
+
ports {
#address-cells = <1>;
#size-cells = <0>;
--
2.29.2