aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.15/950-0649-dtoverlays-Add-backlight-gpio-parameter-to-vc4-kms-d.patch
blob: e10dc1f68c7d944853bbb326ad4a62c19661968e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From 97a59d460244efdb87b464b9f07c1e90e7e7129a Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Fri, 7 Jan 2022 11:12:08 +0000
Subject: [PATCH] dtoverlays: Add backlight-gpio parameter to
 vc4-kms-dpi-generic

To allow for the cases where a simple panel does have a GPIO
controlled backlight. Defaults to having no backlight defined.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
 arch/arm/boot/dts/overlays/README             |  2 ++
 .../overlays/vc4-kms-dpi-generic-overlay.dts  | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+)

--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -3638,6 +3638,8 @@ Params: clock-frequency         Display
         rgb888                  Change to RGB888 output on GPIOs 0-27
         bus-format              Override the bus format for a MEDIA_BUS_FMT_*
                                 value. NB also overridden by rgbXXX overrides.
+        backlight-gpio          Defines a GPIO to be used for backlight control
+                                (default of none).
 
 
 Name:   vc4-kms-dsi-7inch
--- a/arch/arm/boot/dts/overlays/vc4-kms-dpi-generic-overlay.dts
+++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-generic-overlay.dts
@@ -63,6 +63,23 @@
 		};
 	};
 
+	fragment@2 {
+		target = <&panel>;
+		__dormant__  {
+			backlight = <&backlight>;
+		};
+	};
+
+	fragment@3 {
+		target-path = "/";
+		__dormant__  {
+			backlight: backlight {
+				compatible = "gpio-backlight";
+				gpios = <&gpio 255 GPIO_ACTIVE_HIGH>;
+			};
+		};
+	};
+
 	__overrides__ {
 		clock-frequency = <&timing>, "clock-frequency:0";
 		hactive = <&timing>, "hactive:0";
@@ -88,5 +105,7 @@
 		rgb888 = <&panel>, "bus-format:0=0x100a",
 			<&dpi_node>, "pinctrl-0:0=",<&dpi_gpio0>;
 		bus-format = <&panel>, "bus-format:0";
+		backlight-gpio = <0>, "+2+3",
+			<&backlight>, "gpios:4";
 	};
 };