1 From 2cc810fd22f30acabbf5e6726e003c5da56d3212 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Mon, 31 Jan 2022 17:25:19 +0000
4 Subject: [PATCH] dtoverlays: Rework vc4-kms-dpi overlays to remove
7 Removes all the common panel, dpi, and backlight configuration
8 from the individual vc4-kms-dpi-* files into vc4-kms-dpi.dtsi.
10 Creates a new vc4-kms-dpi-panel-overlay.dts for preconfigured
11 panels, with overrides to enable the different panel configurations.
13 Deprecates vc4-kms-dpi-at056tn53v1 as superceded by vc4-kms-dpi-panel.
14 vc4-kms-kippah-7inch not deprecated for now as it is likely to be
15 in wider use than at056tn53v1.
17 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
19 arch/arm/boot/dts/overlays/Makefile | 2 +-
20 arch/arm/boot/dts/overlays/README | 33 ++++-
21 arch/arm/boot/dts/overlays/overlay_map.dts | 4 +
22 .../vc4-kms-dpi-at056tn53v1-overlay.dts | 44 ------
23 .../overlays/vc4-kms-dpi-generic-overlay.dts | 138 ++++--------------
24 .../overlays/vc4-kms-dpi-panel-overlay.dts | 62 ++++++++
25 arch/arm/boot/dts/overlays/vc4-kms-dpi.dtsi | 109 ++++++++++++++
26 .../overlays/vc4-kms-kippah-7inch-overlay.dts | 27 +---
27 8 files changed, 235 insertions(+), 184 deletions(-)
28 delete mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dpi-at056tn53v1-overlay.dts
29 create mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dpi-panel-overlay.dts
30 create mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dpi.dtsi
32 --- a/arch/arm/boot/dts/overlays/Makefile
33 +++ b/arch/arm/boot/dts/overlays/Makefile
34 @@ -234,8 +234,8 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
37 vc4-fkms-v3d-pi4.dtbo \
38 - vc4-kms-dpi-at056tn53v1.dtbo \
39 vc4-kms-dpi-generic.dtbo \
40 + vc4-kms-dpi-panel.dtbo \
41 vc4-kms-dsi-7inch.dtbo \
42 vc4-kms-dsi-lt070me05000.dtbo \
43 vc4-kms-dsi-lt070me05000-v2.dtbo \
44 --- a/arch/arm/boot/dts/overlays/README
45 +++ b/arch/arm/boot/dts/overlays/README
46 @@ -3624,10 +3624,8 @@ Params: cma-512 CMA is 5
49 Name: vc4-kms-dpi-at056tn53v1
50 -Info: Enable an Innolux 5.6in VGA TFT connected to DPI interface under KMS.
51 - Requires vc4-kms-v3d to be loaded.
52 -Load: dtoverlay=vc4-kms-dpi-at056tn53v1
54 +Info: This overlay is now deprecated - see vc4-kms-dpi-panel,at056tn53v1
58 Name: vc4-kms-dpi-generic
59 @@ -3659,6 +3657,33 @@ Params: clock-frequency Display
60 backlight-gpio Defines a GPIO to be used for backlight control
62 backlight-pwm Defines a PWM channel to be used for backlight
63 + control (default of none). NB Disables audio
64 + headphone output as that also uses PWM.
65 + backlight-pwm-chan Choose channel on &pwm node for backlight
68 + backlight-pwm-gpio GPIO pin to be used for the PWM backlight. See
69 + pwm-2chan for valid options.
70 + (default 18 - note this can only work with
72 + backlight-pwm-func Pin function of GPIO used for the PWM
74 + See pwm-2chan for valid options.
76 + backlight-def-brightness
77 + Set the default brightness. Normal range 1-16.
81 +Name: vc4-kms-dpi-panel
82 +Info: Enable a preconfigured KMS DPI panel.
83 + Requires vc4-kms-v3d to be loaded.
84 +Load: dtoverlay=vc4-kms-dpi-panel,<param>=<val>
85 +Params: at056tn53v1 Enable an Innolux 5.6in VGA TFT
86 + kippah-7inch Enable an Adafruit Kippah with 7inch panel.
87 + backlight-gpio Defines a GPIO to be used for backlight control
89 + backlight-pwm Defines a PWM channel to be used for backlight
90 control (default of none). NB Disables audio
91 headphone output as that also uses PWM.
92 backlight-pwm-chan Choose channel on &pwm node for backlight
93 --- a/arch/arm/boot/dts/overlays/overlay_map.dts
94 +++ b/arch/arm/boot/dts/overlays/overlay_map.dts
99 + vc4-kms-dpi-at056tn53v1 {
100 + deprecated = "use vc4-kms-dpi-panel,at056tn53v1";
105 bcm2711 = "vc4-kms-v3d-pi4";
106 --- a/arch/arm/boot/dts/overlays/vc4-kms-dpi-at056tn53v1-overlay.dts
110 - * vc4-kms-dpi-at056tn53v1-overlay.dts
116 -#include <dt-bindings/gpio/gpio.h>
117 -#include <dt-bindings/pinctrl/bcm2835.h>
120 - compatible = "brcm,bcm2835";
126 - compatible = "innolux,at056tn53v1", "simple-panel";
129 - panel_in: endpoint {
130 - remote-endpoint = <&dpi_out>;
142 - pinctrl-names = "default";
143 - pinctrl-0 = <&dpi_18bit_cpadhi_gpio0>;
146 - dpi_out: endpoint {
147 - remote-endpoint = <&panel_in>;
153 --- a/arch/arm/boot/dts/overlays/vc4-kms-dpi-generic-overlay.dts
154 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-generic-overlay.dts
159 -#include <dt-bindings/gpio/gpio.h>
160 -#include <dt-bindings/pinctrl/bcm2835.h>
161 +#include "vc4-kms-dpi.dtsi"
164 compatible = "brcm,bcm2835";
170 - compatible = "panel-dpi";
174 - bus-format = <0x1009>;
176 - timing: panel-timing {
177 - clock-frequency = <29500000>;
179 - hfront-porch = <24>;
181 - hback-porch = <96>;
182 - hsync-active = <1>;
184 - vfront-porch = <3>;
187 - vsync-active = <1>;
190 - pixelclk-active = <1>;
194 - panel_in: endpoint {
195 - remote-endpoint = <&dpi_out>;
204 - dpi_node: __overlay__ {
207 - pinctrl-names = "default";
208 - pinctrl-0 = <&dpi_18bit_gpio0>;
211 - dpi_out: endpoint {
212 - remote-endpoint = <&panel_in>;
221 - backlight = <&backlight>;
228 - backlight: backlight {
229 - compatible = "gpio-backlight";
230 - gpios = <&gpio 255 GPIO_ACTIVE_HIGH>;
238 - backlight = <&backlight_pwm>;
245 - backlight_pwm: backlight_pwm {
246 - compatible = "pwm-backlight";
247 - brightness-levels = <0 6 8 12 16 24 32 40 48 64 96 128 160 192 224 255>;
248 - default-brightness-level = <16>;
249 - pwms = <&pwm 0 200000>;
254 + compatible = "panel-dpi";
259 - pinctrl-names = "default";
260 - pinctrl-0 = <&pwm_pins>;
261 - assigned-clock-rates = <1000000>;
267 + bus-format = <0x1009>;
269 + timing: panel-timing {
270 + clock-frequency = <29500000>;
272 + hfront-porch = <24>;
274 + hback-porch = <96>;
275 + hsync-active = <1>;
277 + vfront-porch = <3>;
280 + vsync-active = <1>;
285 - pwm_pins: pwm_pins {
287 - brcm,function = <2>; /* Alt5 */
289 + pixelclk-active = <1>;
297 - brcm,disable-headphones;
301 + pinctrl-0 = <&dpi_18bit_gpio0>;
306 rgb888 = <&panel>, "bus-format:0=0x100a",
307 <&dpi_node>, "pinctrl-0:0=",<&dpi_gpio0>;
308 bus-format = <&panel>, "bus-format:0";
309 - backlight-gpio = <0>, "+2+3",
310 - <&backlight>, "gpios:4";
311 - backlight-pwm = <0>, "+4+5+6+7+8";
312 - backlight-pwm-chan = <&backlight_pwm>, "pwms:4";
313 - backlight-pwm-gpio = <&pwm_pins>, "brcm,pins:0";
314 - backlight-pwm-func = <&pwm_pins>, "brcm,function:0";
315 - backlight-def-brightness = <&backlight_pwm>, "default-brightness-level:0";
319 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-panel-overlay.dts
322 + * vc4-kms-dpi-panel-overlay.dts
323 + * Support for any predefined DPI panel.
329 +#include "vc4-kms-dpi.dtsi"
332 + compatible = "brcm,bcm2835";
337 + compatible = "innolux,at056tn53v1", "simple-panel";
343 + compatible = "ontat,yx700wv03", "simple-panel";
350 + pinctrl-0 = <&dpi_18bit_cpadhi_gpio0>;
356 + pinctrl-0 = <&dpi_18bit_gpio0>;
362 + pinctrl-0 = <&dpi_gpio0>;
368 + pinctrl-0 = <&dpi_16bit_cpadhi_gpio0>;
374 + pinctrl-0 = <&dpi_16bit_gpio0>;
379 + at056tn53v1 = <0>, "+0+90";
380 + kippah-7inch = <0>, "+1+91";
384 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi.dtsi
390 +#include <dt-bindings/gpio/gpio.h>
391 +#include <dt-bindings/pinctrl/bcm2835.h>
399 + panel_in: endpoint {
400 + remote-endpoint = <&dpi_out>;
409 + dpi_node: __overlay__ {
412 + pinctrl-names = "default";
415 + dpi_out: endpoint {
416 + remote-endpoint = <&panel_in>;
425 + backlight = <&backlight>;
432 + backlight: backlight {
433 + compatible = "gpio-backlight";
434 + gpios = <&gpio 255 GPIO_ACTIVE_HIGH>;
442 + backlight = <&backlight_pwm>;
449 + backlight_pwm: backlight_pwm {
450 + compatible = "pwm-backlight";
451 + brightness-levels = <0 6 8 12 16 24 32 40 48 64 96 128 160 192 224 255>;
452 + default-brightness-level = <16>;
453 + pwms = <&pwm 0 200000>;
461 + pinctrl-names = "default";
462 + pinctrl-0 = <&pwm_pins>;
463 + assigned-clock-rates = <1000000>;
471 + pwm_pins: pwm_pins {
473 + brcm,function = <2>; /* Alt5 */
481 + brcm,disable-headphones;
486 + backlight-gpio = <0>, "+102+103",
487 + <&backlight>, "gpios:4";
488 + backlight-pwm = <0>, "+104+105+106+107+108";
489 + backlight-pwm-chan = <&backlight_pwm>, "pwms:4";
490 + backlight-pwm-gpio = <&pwm_pins>, "brcm,pins:0";
491 + backlight-pwm-func = <&pwm_pins>, "brcm,function:0";
492 + backlight-def-brightness = <&backlight_pwm>, "default-brightness-level:0";
495 --- a/arch/arm/boot/dts/overlays/vc4-kms-kippah-7inch-overlay.dts
496 +++ b/arch/arm/boot/dts/overlays/vc4-kms-kippah-7inch-overlay.dts
499 - * vc4-kms-v3d-overlay.dts
500 + * vc4-kms-kippah-7inch-overlay.dts
506 -#include <dt-bindings/pinctrl/bcm2835.h>
507 +#include "vc4-kms-dpi.dtsi"
510 compatible = "brcm,bcm2835";
516 - compatible = "ontat,yx700wv03", "simple-panel";
519 - panel_in: endpoint {
520 - remote-endpoint = <&dpi_out>;
526 + compatible = "ontat,yx700wv03", "simple-panel";
535 - pinctrl-names = "default";
536 pinctrl-0 = <&dpi_18bit_gpio0>;
539 - dpi_out: endpoint@0 {
540 - remote-endpoint = <&panel_in>;