This repository has been archived by the owner on Jul 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
/
rpi-display-overlay.dts
121 lines (103 loc) · 2.13 KB
/
rpi-display-overlay.dts
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
/*
* Device Tree overlay for rpi-display by Watterott
*
*/
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2708";
fragment@0 {
target = <&spi0>;
__overlay__ {
status = "okay";
spidev@0{
status = "disabled";
};
spidev@1{
status = "disabled";
};
};
};
fragment@1 {
target = <&gpio>;
__overlay__ {
rpi_display_pins: rpi_display_pins {
brcm,pins = <18 23 24 25>;
brcm,function = <1 1 1 0>; /* out out out in */
};
};
};
fragment@2 {
target = <&spi0>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
rpidisplay: rpi-display@0{
compatible = "mi,mi0283qt";
reg = <0>;
//pinctrl-names = "default";
//pinctrl-0 = <&rpi_display_pins>;
spi-max-frequency = <32000000>;
rotation = <180>;
reset-gpios = <&gpio 23 0>;
dc-gpios = <&gpio 24 0>;
backlight = <&backlight>;
};
rpi-display-ts@1 {
compatible = "ti,ads7846";
reg = <1>;
spi-max-frequency = <2000000>;
interrupts = <25 2>; /* high-to-low edge triggered */
interrupt-parent = <&gpio>;
pendown-gpio = <&gpio 25 0>;
ti,x-plate-ohms = /bits/ 16 <60>;
ti,pressure-max = /bits/ 16 <255>;
};
};
};
fragment@3 {
target-path = "/soc";
__overlay__ {
backlight: backlight {
compatible = "gpio-backlight";
gpios = <&gpio 18 0>;
};
};
};
/*
Alternative pwm backlight section
fragment@3 {
target = <&gpio>;
__overlay__ {
// This is necessary on Pi1,2,Z not Pi3
pinctrl-0 = <&gpioout &alt0>; // Remove i2s_alt0 which claims gpio18
};
};
fragment@4 {
target = <&pwm>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&pwm0_gpio18>;
status = "okay";
};
};
fragment@5 {
target-path = "/soc";
__overlay__ {
backlight: backlight {
compatible = "pwm-backlight";
pwms = <&pwm 0 5000000>;
// These levels need calibration
brightness-levels = <0 5 10 20 40 60 80 100>;
default-brightness-level = <7>;
};
};
};
*/
__overrides__ {
speed = <&rpidisplay>,"spi-max-frequency:0";
rotation = <&rpidisplay>,"rotation:0";
format = <&rpidisplay>,"format";
};
};