BCM2708: Add core Device Tree support
[platform/kernel/linux-rpi.git] / arch / arm / boot / dts / overlays / pitft35-resistive-overlay.dts
1 /*
2  * Device Tree overlay for Adafruit PiTFT 3.5" 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 = "himax,hx8357d", "adafruit,yx350hv15";
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                                 compatible = "st,stmpe610";
68                                 reg = <1>;
69
70                                 spi-max-frequency = <500000>;
71                                 interrupts = <24 2>; /* high-to-low edge triggered */
72                                 interrupt-parent = <&gpio>;
73                                 interrupt-controller;
74
75                                 stmpe_touchscreen {
76                                         compatible = "st,stmpe-ts";
77                                         st,sample-time = <4>;
78                                         st,mod-12b = <1>;
79                                         st,ref-sel = <0>;
80                                         st,adc-freq = <2>;
81                                         st,ave-ctrl = <3>;
82                                         st,touch-det-delay = <4>;
83                                         st,settling = <2>;
84                                         st,fraction-z = <7>;
85                                         st,i-drive = <0>;
86                                 };
87
88                                 stmpe_gpio: stmpe_gpio {
89                                         #gpio-cells = <2>;
90                                         compatible = "st,stmpe-gpio";
91                                         /*
92                                          * only GPIO2 is wired/available
93                                          * and it is wired to the backlight
94                                          */
95                                         st,norequest-mask = <0x7b>;
96                                 };
97                         };
98                 };
99         };
100
101         fragment@5 {
102                 target-path = "/soc";
103                 __overlay__ {
104                         backlight: backlight {
105                                 compatible = "gpio-backlight";
106                                 gpios = <&stmpe_gpio 2 0>;
107                                 default-on;
108                         };
109                 };
110         };
111
112         __overrides__ {
113                 speed =   <&pitft>,"spi-max-frequency:0";
114                 rotate =  <&pitft>,"rotate:0", /* fbtft */
115                           <&pitft>,"rotation:0"; /* drm */
116                 fps =     <&pitft>,"fps:0";
117                 debug =   <&pitft>,"debug:0";
118                 drm =     <&pitft>,"compatible=adafruit,yx350hv15",
119                           <&pitft>,"backlight:0=",<&backlight>;
120         };
121 };