kernel: bump 4.14 to 4.14.93
[openwrt/staging/chunkeey.git] / target / linux / brcm2708 / patches-4.14 / 950-0431-Add-hy28b-2017-model-device-tree-overlay-2721.patch
1 From a3d3b80d8a028e7cec393c02c1a96c5e632e7b30 Mon Sep 17 00:00:00 2001
2 From: Hans-Wilhelm Warlo <5417271+hanswilw@users.noreply.github.com>
3 Date: Tue, 16 Oct 2018 18:20:48 +0200
4 Subject: [PATCH 431/454] Add hy28b 2017 model device tree overlay (#2721)
5
6 The 2017 version of the hy28b display requires a different
7 initialisation sequence.
8
9 Signed-off-by: Hans-Wilhelm Warlo <hw@warlo.no>
10 ---
11 arch/arm/boot/dts/overlays/Makefile | 1 +
12 arch/arm/boot/dts/overlays/README | 19 +++
13 .../boot/dts/overlays/hy28b-2017-overlay.dts | 152 ++++++++++++++++++
14 3 files changed, 172 insertions(+)
15 create mode 100644 arch/arm/boot/dts/overlays/hy28b-2017-overlay.dts
16
17 --- a/arch/arm/boot/dts/overlays/Makefile
18 +++ b/arch/arm/boot/dts/overlays/Makefile
19 @@ -51,6 +51,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
20 hifiberry-digi-pro.dtbo \
21 hy28a.dtbo \
22 hy28b.dtbo \
23 + hy28b-2017.dtbo \
24 i2c-bcm2708.dtbo \
25 i2c-gpio.dtbo \
26 i2c-mux.dtbo \
27 --- a/arch/arm/boot/dts/overlays/README
28 +++ b/arch/arm/boot/dts/overlays/README
29 @@ -792,6 +792,25 @@ Params: speed Display
30 ledgpio GPIO used to control backlight
31
32
33 +Name: hy28b-2017
34 +Info: HY28B 2017 version - 2.8" TFT LCD Display Module by HAOYU Electronics
35 + Default values match Texy's display shield
36 +Load: dtoverlay=hy28b-2017,<param>=<val>
37 +Params: speed Display SPI bus speed
38 +
39 + rotate Display rotation {0,90,180,270}
40 +
41 + fps Delay between frame updates
42 +
43 + debug Debug output level {0-7}
44 +
45 + xohms Touchpanel sensitivity (X-plate resistance)
46 +
47 + resetgpio GPIO used to reset controller
48 +
49 + ledgpio GPIO used to control backlight
50 +
51 +
52 Name: i2c-bcm2708
53 Info: Fall back to the i2c_bcm2708 driver for the i2c_arm bus.
54 Load: dtoverlay=i2c-bcm2708
55 --- /dev/null
56 +++ b/arch/arm/boot/dts/overlays/hy28b-2017-overlay.dts
57 @@ -0,0 +1,152 @@
58 +/*
59 + * Device Tree overlay for HY28b display shield by Texy.
60 + * Modified for 2017 version with ILI9325 D chip
61 + */
62 +
63 +/dts-v1/;
64 +/plugin/;
65 +
66 +/ {
67 + compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
68 +
69 + fragment@0 {
70 + target = <&spi0>;
71 + __overlay__ {
72 + status = "okay";
73 + };
74 + };
75 +
76 + fragment@1 {
77 + target = <&spidev0>;
78 + __overlay__ {
79 + status = "disabled";
80 + };
81 + };
82 +
83 + fragment@2 {
84 + target = <&spidev1>;
85 + __overlay__ {
86 + status = "disabled";
87 + };
88 + };
89 +
90 + fragment@3 {
91 + target = <&gpio>;
92 + __overlay__ {
93 + hy28b_pins: hy28b_pins {
94 + brcm,pins = <17 25 18>;
95 + brcm,function = <0 1 1>; /* in out out */
96 + };
97 + };
98 + };
99 +
100 + fragment@4 {
101 + target = <&spi0>;
102 + __overlay__ {
103 + /* needed to avoid dtc warning */
104 + #address-cells = <1>;
105 + #size-cells = <0>;
106 +
107 + hy28b: hy28b@0{
108 + compatible = "ilitek,ili9325";
109 + reg = <0>;
110 + pinctrl-names = "default";
111 + pinctrl-0 = <&hy28b_pins>;
112 +
113 + spi-max-frequency = <48000000>;
114 + spi-cpol;
115 + spi-cpha;
116 + rotate = <270>;
117 + bgr;
118 + fps = <50>;
119 + buswidth = <8>;
120 + startbyte = <0x70>;
121 + reset-gpios = <&gpio 25 0>;
122 + led-gpios = <&gpio 18 1>;
123 +
124 + init = <0x10000e5 0x78F0
125 + 0x1000001 0x0100
126 + 0x1000002 0x0700
127 + 0x1000003 0x1030
128 + 0x1000004 0x0000
129 + 0x1000008 0x0207
130 + 0x1000009 0x0000
131 + 0x100000a 0x0000
132 + 0x100000c 0x0000
133 + 0x100000d 0x0000
134 + 0x100000f 0x0000
135 + 0x1000010 0x0000
136 + 0x1000011 0x0007
137 + 0x1000012 0x0000
138 + 0x1000013 0x0000
139 + 0x1000007 0x0001
140 + 0x2000032
141 + 0x2000032
142 + 0x2000032
143 + 0x2000032
144 + 0x1000010 0x1090
145 + 0x1000011 0x0227
146 + 0x2000032
147 + 0x1000012 0x001f
148 + 0x2000032
149 + 0x1000013 0x1500
150 + 0x1000029 0x0027
151 + 0x100002b 0x000d
152 + 0x2000032
153 + 0x1000020 0x0000
154 + 0x1000021 0x0000
155 + 0x2000032
156 + 0x1000030 0x0000
157 + 0x1000031 0x0707
158 + 0x1000032 0x0307
159 + 0x1000035 0x0200
160 + 0x1000036 0x0008
161 + 0x1000037 0x0004
162 + 0x1000038 0x0000
163 + 0x1000039 0x0707
164 + 0x100003c 0x0002
165 + 0x100003d 0x1d04
166 + 0x1000050 0x0000
167 + 0x1000051 0x00ef
168 + 0x1000052 0x0000
169 + 0x1000053 0x013f
170 + 0x1000060 0xa700
171 + 0x1000061 0x0001
172 + 0x100006a 0x0000
173 + 0x1000080 0x0000
174 + 0x1000081 0x0000
175 + 0x1000082 0x0000
176 + 0x1000083 0x0000
177 + 0x1000084 0x0000
178 + 0x1000085 0x0000
179 + 0x1000090 0x0010
180 + 0x1000092 0x0600
181 + 0x1000007 0x0133>;
182 + debug = <0>;
183 + };
184 +
185 + hy28b_ts: hy28b-ts@1 {
186 + compatible = "ti,ads7846";
187 + reg = <1>;
188 +
189 + spi-max-frequency = <2000000>;
190 + interrupts = <17 2>; /* high-to-low edge triggered */
191 + interrupt-parent = <&gpio>;
192 + pendown-gpio = <&gpio 17 0>;
193 + ti,x-plate-ohms = /bits/ 16 <100>;
194 + ti,pressure-max = /bits/ 16 <255>;
195 + };
196 + };
197 + };
198 + __overrides__ {
199 + speed = <&hy28b>,"spi-max-frequency:0";
200 + rotate = <&hy28b>,"rotate:0";
201 + fps = <&hy28b>,"fps:0";
202 + debug = <&hy28b>,"debug:0";
203 + xohms = <&hy28b_ts>,"ti,x-plate-ohms;0";
204 + resetgpio = <&hy28b>,"reset-gpios:4",
205 + <&hy28b_pins>, "brcm,pins:4";
206 + ledgpio = <&hy28b>,"led-gpios:4",
207 + <&hy28b_pins>, "brcm,pins:8";
208 + };
209 +};