bcm27xx: import latest patches from the RPi foundation
[openwrt/staging/ynezz.git] / target / linux / bcm27xx / patches-5.4 / 950-0961-overlays-Add-adafruit18-and-sainsmart18-overlays.patch
1 From dde4afa87452e8499c611c9a889f4c5f35d9e2bb Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Thu, 3 Sep 2020 17:36:00 +0100
4 Subject: [PATCH] overlays: Add adafruit18 and sainsmart18 overlays
5
6 Add support for three ST7735R-based displays - adafruit18,
7 adafruit18_green and sainsmart18.
8
9 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
10 ---
11 arch/arm/boot/dts/overlays/Makefile | 2 +
12 arch/arm/boot/dts/overlays/README | 15 ++++++
13 .../boot/dts/overlays/adafruit18-overlay.dts | 49 +++++++++++++++++++
14 .../boot/dts/overlays/sainsmart18-overlay.dts | 47 ++++++++++++++++++
15 4 files changed, 113 insertions(+)
16 create mode 100644 arch/arm/boot/dts/overlays/adafruit18-overlay.dts
17 create mode 100644 arch/arm/boot/dts/overlays/sainsmart18-overlay.dts
18
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
22
23 dtbo-$(CONFIG_ARCH_BCM2835) += \
24 act-led.dtbo \
25 + adafruit18.dtbo \
26 adau1977-adc.dtbo \
27 adau7002-simple.dtbo \
28 ads1015.dtbo \
29 @@ -147,6 +148,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
30 rpi-tv.dtbo \
31 rpivid-v4l2.dtbo \
32 rra-digidac1-wm8741-audio.dtbo \
33 + sainsmart18.dtbo \
34 sc16is750-i2c.dtbo \
35 sc16is752-i2c.dtbo \
36 sc16is752-spi0.dtbo \
37 --- a/arch/arm/boot/dts/overlays/README
38 +++ b/arch/arm/boot/dts/overlays/README
39 @@ -261,6 +261,14 @@ Params: activelow Set to "
40 REQUIRED
41
42
43 +Name: adafruit18
44 +Info: Overlay for the SPI-connected Adafruit 1.8" display (based on the
45 + ST7735R chip). It includes support for the "green tab" version.
46 +Load: dtoverlay=adafruit18,<param>=<val>
47 +Params: green Use the adafruit18_green variant.
48 + rotate Display rotation {0,90,180,270}
49 +
50 +
51 Name: adau1977-adc
52 Info: Overlay for activation of ADAU1977 ADC codec over I2C for control
53 and I2S for data.
54 @@ -2251,6 +2259,13 @@ Load: dtoverlay=rra-digidac1-wm8741-au
55 Params: <None>
56
57
58 +Name: sainsmart18
59 +Info: Overlay for the SPI-connected Sainsmart 1.8" display (based on the
60 + ST7735R chip).
61 +Load: dtoverlay=sainsmart18,<param>=<val>
62 +Params: rotate Display rotation {0,90,180,270}
63 +
64 +
65 Name: sc16is750-i2c
66 Info: Overlay for the NXP SC16IS750 UART with I2C Interface
67 Enables the chip on I2C1 at 0x48 (or the "addr" parameter value). To
68 --- /dev/null
69 +++ b/arch/arm/boot/dts/overlays/adafruit18-overlay.dts
70 @@ -0,0 +1,49 @@
71 +/*
72 + * Device Tree overlay for Adafruit 1.8" TFT LCD with ST7735R chip 160x128
73 + */
74 +
75 +/dts-v1/;
76 +/plugin/;
77 +
78 +/ {
79 + compatible = "brcm,bcm2835";
80 +
81 + fragment@0 {
82 + target = <&spidev0>;
83 + __overlay__ {
84 + status = "disabled";
85 + };
86 + };
87 +
88 + fragment@1 {
89 + target = <&spi0>;
90 + __overlay__ {
91 + /* needed to avoid dtc warning */
92 + #address-cells = <1>;
93 + #size-cells = <0>;
94 + status = "okay";
95 +
96 + af18: adafruit18@0 {
97 + compatible = "fbtft,adafruit18";
98 + reg = <0>;
99 + pinctrl-names = "default";
100 + spi-max-frequency = <40000000>;
101 + rotate = <90>;
102 + buswidth = <8>;
103 + fps = <50>;
104 + height = <160>;
105 + width = <128>;
106 + reset-gpios = <&gpio 25 0>;
107 + dc-gpios = <&gpio 24 0>;
108 + led-gpios = <&gpio 18 0>;
109 + bgr;
110 + debug = <0>;
111 + };
112 + };
113 + };
114 +
115 + __overrides__ {
116 + green = <&af18>, "compatible=fbtft,adafruit18_green";
117 + rotate = <&af18>, "rotate:0";
118 + };
119 +};
120 --- /dev/null
121 +++ b/arch/arm/boot/dts/overlays/sainsmart18-overlay.dts
122 @@ -0,0 +1,47 @@
123 +/*
124 + * Device Tree overlay for the Sainsmart 1.8" TFT LCD with ST7735R chip 160x128
125 + */
126 +
127 +/dts-v1/;
128 +/plugin/;
129 +
130 +/ {
131 + compatible = "brcm,bcm2835";
132 +
133 + fragment@0 {
134 + target = <&spidev0>;
135 + __overlay__ {
136 + status = "disabled";
137 + };
138 + };
139 +
140 + fragment@1 {
141 + target = <&spi0>;
142 + __overlay__ {
143 + /* needed to avoid dtc warning */
144 + #address-cells = <1>;
145 + #size-cells = <0>;
146 + status = "okay";
147 +
148 + ss18: sainsmart18@0 {
149 + compatible = "fbtft,sainsmart18";
150 + reg = <0>;
151 + pinctrl-names = "default";
152 + spi-max-frequency = <40000000>;
153 + rotate = <90>;
154 + buswidth = <8>;
155 + fps = <50>;
156 + height = <160>;
157 + width = <128>;
158 + reset-gpios = <&gpio 25 0>;
159 + dc-gpios = <&gpio 24 0>;
160 + bgr;
161 + debug = <0>;
162 + };
163 + };
164 + };
165 +
166 + __overrides__ {
167 + rotate = <&ss18>, "rotate:0";
168 + };
169 +};