Skip to content

Commit 6237d09

Browse files
6by9pelwell
authored andcommitted
dtoverlays: Add overlay for ST7735R (160x128) TinyDRM driver
Adds an overlay to configure the TinyDRM driver for ST7735R based 160x128 and 128x128 (untested) displays such as the Adafruit 1.8" display. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent 1faafd9 commit 6237d09

3 files changed

Lines changed: 98 additions & 0 deletions

File tree

‎arch/arm/boot/dts/overlays/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += overlay_map.dtb
44

55
dtbo-$(CONFIG_ARCH_BCM2835) += \
66
act-led.dtbo \
7+
adafruit-st7735r.dtbo \
78
adafruit18.dtbo \
89
adau1977-adc.dtbo \
910
adau7002-simple.dtbo \

‎arch/arm/boot/dts/overlays/README‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,23 @@ Params: activelow Set to "on" to invert the sense of the LED
299299
REQUIRED
300300

301301

302+
Name: adafruit-st7735r
303+
Info: Overlay for the SPI-connected Adafruit 1.8" 160x128 or 128x128 displays,
304+
based on the ST7735R chip.
305+
This overlay uses the newer DRM/KMS "Tiny" driver.
306+
Load: dtoverlay=adafruit-st7735r,<param>=<val>
307+
Params: 128x128 Select the 128x128 driver (default 160x128)
308+
rotate Display rotation {0,90,180,270} (default 90)
309+
speed SPI bus speed in Hz (default 4000000)
310+
dc_pin GPIO pin for D/C (default 24)
311+
reset_pin GPIO pin for RESET (default 25)
312+
led_pin GPIO used to control backlight (default 18)
313+
314+
302315
Name: adafruit18
303316
Info: Overlay for the SPI-connected Adafruit 1.8" display (based on the
304317
ST7735R chip). It includes support for the "green tab" version.
318+
This overlay uses the older fbtft driver.
305319
Load: dtoverlay=adafruit18,<param>=<val>
306320
Params: green Use the adafruit18_green variant.
307321
rotate Display rotation {0,90,180,270}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
* adafruit-st7735r-overlay.dts
3+
*
4+
* ST7735R based SPI LCD displays. Either
5+
* Adafruit 1.8" 160x128
6+
* or
7+
* Okaya 1.44" 128x128
8+
*/
9+
10+
/dts-v1/;
11+
/plugin/;
12+
13+
#include <dt-bindings/gpio/gpio.h>
14+
15+
/ {
16+
compatible = "brcm,bcm2835";
17+
18+
fragment@0 {
19+
target = <&spidev0>;
20+
__overlay__ {
21+
status = "disabled";
22+
};
23+
};
24+
25+
fragment@1 {
26+
target = <&gpio>;
27+
__overlay__ {
28+
adafruit_pins: adafruit_pins {
29+
brcm,pins = <25 24>;
30+
brcm,function = <1>; /* out */
31+
};
32+
backlight_pins: backlight_pins {
33+
brcm,pins = <18>;
34+
brcm,function = <1>; /* out */
35+
};
36+
};
37+
};
38+
39+
fragment@2 {
40+
target-path = "/";
41+
__overlay__ {
42+
af18_backlight: backlight {
43+
compatible = "gpio-backlight";
44+
gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
45+
pinctrl-names = "default";
46+
pinctrl-0 = <&backlight_pins>;
47+
};
48+
};
49+
};
50+
51+
fragment@3 {
52+
target = <&spi0>;
53+
__overlay__ {
54+
/* needed to avoid dtc warning */
55+
#address-cells = <1>;
56+
#size-cells = <0>;
57+
status = "okay";
58+
59+
af18: adafruit18@0 {
60+
compatible = "jianda,jd-t18003-t01";
61+
reg = <0>;
62+
spi-max-frequency = <32000000>;
63+
dc-gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
64+
reset-gpios = <&gpio 25 GPIO_ACTIVE_HIGH>;
65+
rotate = <90>;
66+
pinctrl-names = "default";
67+
pinctrl-0 = <&adafruit_pins>;
68+
backlight = <&af18_backlight>;
69+
};
70+
};
71+
};
72+
73+
__overrides__ {
74+
128x128 = <&af18>, "compatible=okaya,rh128128t";
75+
speed = <&af18>,"spi-max-frequency:0";
76+
rotate = <&af18>,"rotate:0";
77+
dc_pin = <&af18>,"dc-gpios:4", <&adafruit_pins>,"brcm,pins:4";
78+
reset_pin = <&af18>,"reset-gpios:4",
79+
<&adafruit_pins>,"brcm,pins:0";
80+
led_pin = <&af18_backlight>,"gpios:4",
81+
<&backlight_pins>,"brcm,pins:0";
82+
};
83+
};

0 commit comments

Comments
 (0)