Update touch PiTFT overlays
[platform/kernel/linux-rpi.git] / arch / arm / boot / dts / overlays / pitft28-resistive-overlay.dts
1 /*
2  * Device Tree overlay for Adafruit PiTFT 2.8" resistive touch screen
3  *
4  */
5
6 /dts-v1/;
7 /plugin/;
8
9 / {
10         compatible = "brcm,bcm2835";
11
12         fragment@0 {
13                 target = <&spi0>;
14                 __overlay__ {
15                         status = "okay";
16                 };
17         };
18
19         fragment@1 {
20                 target = <&spidev0>;
21                 __overlay__ {
22                         status = "disabled";
23                 };
24         };
25
26         fragment@2 {
27                 target = <&spidev1>;
28                 __overlay__ {
29                         status = "disabled";
30                 };
31         };
32
33         fragment@3 {
34                 target = <&gpio>;
35                 __overlay__ {
36                         pitft_pins: pitft_pins {
37                                 brcm,pins = <24 25>;
38                                 brcm,function = <0 1>; /* in out */
39                                 brcm,pull = <2 0>; /* pullup none */
40                         };
41                 };
42         };
43
44         fragment@4 {
45                 target = <&spi0>;
46                 __overlay__ {
47                         /* needed to avoid dtc warning */
48                         #address-cells = <1>;
49                         #size-cells = <0>;
50
51                         pitft: pitft@0{
52                                 compatible = "ilitek,ili9340";
53                                 reg = <0>;
54                                 pinctrl-names = "default";
55                                 pinctrl-0 = <&pitft_pins>;
56
57                                 spi-max-frequency = <32000000>;
58                                 rotate = <90>;
59                                 fps = <25>;
60                                 bgr;
61                                 buswidth = <8>;
62                                 dc-gpios = <&gpio 25 0>;
63                                 debug = <0>;
64                         };
65
66                         pitft_ts@1 {
67                                 /* needed to avoid dtc warning */
68                                 #address-cells = <1>;
69                                 #interrupt-cells = <1>;
70                                 compatible = "st,stmpe610";
71                                 reg = <1>;
72
73                                 spi-max-frequency = <500000>;
74                                 interrupts = <24 2>; /* high-to-low edge triggered */
75                                 interrupt-parent = <&gpio>;
76                                 interrupt-controller;
77
78                                 stmpe_touchscreen: stmpe_touchscreen {
79                                         compatible = "st,stmpe-ts";
80                                         st,sample-time = <4>;
81                                         st,mod-12b = <1>;
82                                         st,ref-sel = <0>;
83                                         st,adc-freq = <2>;
84                                         st,ave-ctrl = <3>;
85                                         st,touch-det-delay = <4>;
86                                         st,settling = <2>;
87                                         st,fraction-z = <7>;
88                                         st,i-drive = <0>;
89                                 };
90
91                                 stmpe_gpio: stmpe_gpio {
92                                         #gpio-cells = <2>;
93                                         compatible = "st,stmpe-gpio";
94                                         /*
95                                          * only GPIO2 is wired/available
96                                          * and it is wired to the backlight
97                                          */
98                                         st,norequest-mask = <0x7b>;
99                                 };
100                         };
101                 };
102         };
103
104         fragment@5 {
105                 target-path = "/soc";
106                 __overlay__ {
107                         backlight {
108                                 compatible = "gpio-backlight";
109                                 gpios = <&stmpe_gpio 2 0>;
110                                 default-on;
111                         };
112                 };
113         };
114
115         __overrides__ {
116                 speed =   <&pitft>,"spi-max-frequency:0";
117                 rotate =  <&pitft>,"rotate:0", /* fbtft */
118                           <&pitft>,"rotation:0"; /* drm */
119                 fps =     <&pitft>,"fps:0";
120                 debug =   <&pitft>,"debug:0";
121                 drm =     <&pitft>,"compatible=adafruit,yx240qv29";
122                 touch-invx  = <&stmpe_touchscreen>,"touchscreen-inverted-x?";
123                 touch-invy  = <&stmpe_touchscreen>,"touchscreen-inverted-y?";
124                 touch-swapxy = <&stmpe_touchscreen>,"touchscreen-swapped-x-y?";
125         };
126 };