1 From 67cd4f249333f3de9b449b9e6ebadd08facc6957 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Mon, 4 Oct 2021 14:15:38 +0100
4 Subject: [PATCH] dtoverlays: Add overlay for ST7735R (160x128) TinyDRM
7 Adds an overlay to configure the TinyDRM driver for ST7735R
8 based 160x128 and 128x128 (untested) displays such as the
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
13 arch/arm/boot/dts/overlays/Makefile | 1 +
14 arch/arm/boot/dts/overlays/README | 14 ++++
15 .../dts/overlays/adafruit-st7735r-overlay.dts | 83 +++++++++++++++++++
16 3 files changed, 98 insertions(+)
17 create mode 100644 arch/arm/boot/dts/overlays/adafruit-st7735r-overlay.dts
19 --- a/arch/arm/boot/dts/overlays/Makefile
20 +++ b/arch/arm/boot/dts/overlays/Makefile
21 @@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += overlay_ma
23 dtbo-$(CONFIG_ARCH_BCM2835) += \
25 + adafruit-st7735r.dtbo \
28 adau7002-simple.dtbo \
29 --- a/arch/arm/boot/dts/overlays/README
30 +++ b/arch/arm/boot/dts/overlays/README
31 @@ -299,9 +299,23 @@ Params: activelow Set to "
35 +Name: adafruit-st7735r
36 +Info: Overlay for the SPI-connected Adafruit 1.8" 160x128 or 128x128 displays,
37 + based on the ST7735R chip.
38 + This overlay uses the newer DRM/KMS "Tiny" driver.
39 +Load: dtoverlay=adafruit-st7735r,<param>=<val>
40 +Params: 128x128 Select the 128x128 driver (default 160x128)
41 + rotate Display rotation {0,90,180,270} (default 90)
42 + speed SPI bus speed in Hz (default 4000000)
43 + dc_pin GPIO pin for D/C (default 24)
44 + reset_pin GPIO pin for RESET (default 25)
45 + led_pin GPIO used to control backlight (default 18)
49 Info: Overlay for the SPI-connected Adafruit 1.8" display (based on the
50 ST7735R chip). It includes support for the "green tab" version.
51 + This overlay uses the older fbtft driver.
52 Load: dtoverlay=adafruit18,<param>=<val>
53 Params: green Use the adafruit18_green variant.
54 rotate Display rotation {0,90,180,270}
56 +++ b/arch/arm/boot/dts/overlays/adafruit-st7735r-overlay.dts
59 + * adafruit-st7735r-overlay.dts
61 + * ST7735R based SPI LCD displays. Either
62 + * Adafruit 1.8" 160x128
64 + * Okaya 1.44" 128x128
70 +#include <dt-bindings/gpio/gpio.h>
73 + compatible = "brcm,bcm2835";
76 + target = <&spidev0>;
78 + status = "disabled";
85 + adafruit_pins: adafruit_pins {
86 + brcm,pins = <25 24>;
87 + brcm,function = <1>; /* out */
89 + backlight_pins: backlight_pins {
91 + brcm,function = <1>; /* out */
99 + af18_backlight: backlight {
100 + compatible = "gpio-backlight";
101 + gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
102 + pinctrl-names = "default";
103 + pinctrl-0 = <&backlight_pins>;
111 + /* needed to avoid dtc warning */
112 + #address-cells = <1>;
116 + af18: adafruit18@0 {
117 + compatible = "jianda,jd-t18003-t01";
119 + spi-max-frequency = <32000000>;
120 + dc-gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
121 + reset-gpios = <&gpio 25 GPIO_ACTIVE_HIGH>;
123 + pinctrl-names = "default";
124 + pinctrl-0 = <&adafruit_pins>;
125 + backlight = <&af18_backlight>;
131 + 128x128 = <&af18>, "compatible=okaya,rh128128t";
132 + speed = <&af18>,"spi-max-frequency:0";
133 + rotate = <&af18>,"rotate:0";
134 + dc_pin = <&af18>,"dc-gpios:4", <&adafruit_pins>,"brcm,pins:4";
135 + reset_pin = <&af18>,"reset-gpios:4",
136 + <&adafruit_pins>,"brcm,pins:0";
137 + led_pin = <&af18_backlight>,"gpios:4",
138 + <&backlight_pins>,"brcm,pins:0";