1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
/*
* tinylcd35-overlay.dts
*
* -------------------------------------------------
* www.tinlylcd.com
* -------------------------------------------------
* Device---Driver-----BUS GPIO's
* display tinylcd35 spi0.0 25 24 18
* touch ads7846 spi0.1 5
* rtc ds1307 i2c1-0068
* rtc pcf8563 i2c1-0051
* keypad gpio-keys --------- 17 22 27 23 28
*
*
* TinyLCD.com 3.5 inch TFT
*
* Version 001
* 5/3/2015 -- Noralf Trønnes Initial Device tree framework
* 10/3/2015 -- tinylcd@gmail.com added ds1307 support.
*
*/
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835";
fragment@0 {
target = <&spi0>;
__overlay__ {
status = "okay";
};
};
fragment@1 {
target = <&spidev0>;
__overlay__ {
status = "disabled";
};
};
fragment@2 {
target = <&spidev1>;
__overlay__ {
status = "disabled";
};
};
fragment@3 {
target = <&gpio>;
__overlay__ {
tinylcd35_pins: tinylcd35_pins {
brcm,pins = <25 24 18>;
brcm,function = <1>; /* out */
};
tinylcd35_ts_pins: tinylcd35_ts_pins {
brcm,pins = <5>;
brcm,function = <0>; /* in */
};
keypad_pins: keypad_pins {
brcm,pins = <4 17 22 23 27>;
brcm,function = <0>; /* in */
brcm,pull = <1>; /* down */
};
};
};
fragment@4 {
target = <&spi0>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
tinylcd35: tinylcd35@0{
compatible = "neosec,tinylcd";
reg = <0>;
pinctrl-names = "default";
pinctrl-0 = <&tinylcd35_pins>,
<&tinylcd35_ts_pins>;
spi-max-frequency = <48000000>;
rotate = <270>;
fps = <20>;
bgr;
buswidth = <8>;
reset-gpios = <&gpio 25 0>;
dc-gpios = <&gpio 24 0>;
led-gpios = <&gpio 18 1>;
debug = <0>;
init = <0x10000B0 0x80
0x10000C0 0x0A 0x0A
0x10000C1 0x01 0x01
0x10000C2 0x33
0x10000C5 0x00 0x42 0x80
0x10000B1 0xD0 0x11
0x10000B4 0x02
0x10000B6 0x00 0x22 0x3B
0x10000B7 0x07
0x1000036 0x58
0x10000F0 0x36 0xA5 0xD3
0x10000E5 0x80
0x10000E5 0x01
0x10000B3 0x00
0x10000E5 0x00
0x10000F0 0x36 0xA5 0x53
0x10000E0 0x00 0x35 0x33 0x00 0x00 0x00 0x00 0x35 0x33 0x00 0x00 0x00
0x100003A 0x55
0x1000011
0x2000001
0x1000029>;
};
tinylcd35_ts: tinylcd35_ts@1 {
compatible = "ti,ads7846";
reg = <1>;
status = "disabled";
spi-max-frequency = <2000000>;
interrupts = <5 2>; /* high-to-low edge triggered */
interrupt-parent = <&gpio>;
pendown-gpio = <&gpio 5 0>;
ti,x-plate-ohms = /bits/ 16 <100>;
ti,pressure-max = /bits/ 16 <255>;
};
};
};
/* RTC */
fragment@5 {
target = <&i2c1>;
__dormant__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pcf8563: pcf8563@51 {
compatible = "nxp,pcf8563";
reg = <0x51>;
status = "okay";
};
};
};
fragment@6 {
target = <&i2c1>;
__dormant__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
ds1307: ds1307@68 {
compatible = "dallas,ds1307";
reg = <0x68>;
status = "okay";
};
};
};
/*
* Values for input event code is found under the
* 'Keys and buttons' heading in include/uapi/linux/input.h
*/
fragment@7 {
target-path = "/soc";
__overlay__ {
keypad: keypad {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&keypad_pins>;
status = "disabled";
autorepeat;
button@17 {
label = "GPIO KEY_UP";
linux,code = <103>;
gpios = <&gpio 17 0>;
};
button@22 {
label = "GPIO KEY_DOWN";
linux,code = <108>;
gpios = <&gpio 22 0>;
};
button@27 {
label = "GPIO KEY_LEFT";
linux,code = <105>;
gpios = <&gpio 27 0>;
};
button@23 {
label = "GPIO KEY_RIGHT";
linux,code = <106>;
gpios = <&gpio 23 0>;
};
button@4 {
label = "GPIO KEY_ENTER";
linux,code = <28>;
gpios = <&gpio 4 0>;
};
};
};
};
__overrides__ {
speed = <&tinylcd35>,"spi-max-frequency:0";
rotate = <&tinylcd35>,"rotate:0";
fps = <&tinylcd35>,"fps:0";
debug = <&tinylcd35>,"debug:0";
touch = <&tinylcd35_ts>,"status";
touchgpio = <&tinylcd35_ts_pins>,"brcm,pins:0",
<&tinylcd35_ts>,"interrupts:0",
<&tinylcd35_ts>,"pendown-gpio:4";
xohms = <&tinylcd35_ts>,"ti,x-plate-ohms;0";
rtc-pcf = <0>,"=5";
rtc-ds = <0>,"=6";
keypad = <&keypad>,"status";
};
};
|