4aab3201470979ba29e5506ff6fb80a0b9d1f0b3
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0108-dts-Added-overlay-for-Adafruit-PiTFT-2.8-capacitive-.patch
1 From 708f013bf40633883113c3fbaca5555b7d115906 Mon Sep 17 00:00:00 2001
2 From: Ondrej Wisniewski <ondrej.wisniewski@gmail.com>
3 Date: Fri, 6 Nov 2015 15:01:28 +0100
4 Subject: [PATCH 108/232] dts: Added overlay for Adafruit PiTFT 2.8" capacitive
5 touch screen
6
7 ---
8 arch/arm/boot/dts/overlays/Makefile | 1 +
9 arch/arm/boot/dts/overlays/README | 22 ++++++
10 .../dts/overlays/pitft28-capacitive-overlay.dts | 88 ++++++++++++++++++++++
11 3 files changed, 111 insertions(+)
12 create mode 100644 arch/arm/boot/dts/overlays/pitft28-capacitive-overlay.dts
13
14 --- a/arch/arm/boot/dts/overlays/Makefile
15 +++ b/arch/arm/boot/dts/overlays/Makefile
16 @@ -36,6 +36,7 @@ dtb-$(RPI_DT_OVERLAYS) += mmc-overlay.dt
17 dtb-$(RPI_DT_OVERLAYS) += mz61581-overlay.dtb
18 dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb
19 dtb-$(RPI_DT_OVERLAYS) += piscreen2r-overlay.dtb
20 +dtb-$(RPI_DT_OVERLAYS) += pitft28-capacitive-overlay.dtb
21 dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb
22 dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb
23 dtb-$(RPI_DT_OVERLAYS) += pwm-overlay.dtb
24 --- a/arch/arm/boot/dts/overlays/README
25 +++ b/arch/arm/boot/dts/overlays/README
26 @@ -439,6 +439,28 @@ Params: speed Display
27 xohms Touchpanel sensitivity (X-plate resistance)
28
29
30 +Name: pitft28-capacitive
31 +Info: Adafruit PiTFT 2.8" capacitive touch screen
32 +Load: dtoverlay=pitft28-capacitive,<param>=<val>
33 +Params: speed Display SPI bus speed
34 +
35 + rotate Display rotation {0,90,180,270}
36 +
37 + fps Delay between frame updates
38 +
39 + debug Debug output level {0-7}
40 +
41 + touch-sizex Touchscreen size x (default 240)
42 +
43 + touch-sizey Touchscreen size y (default 320)
44 +
45 + touch-invx Touchscreen inverted x axis
46 +
47 + touch-invy Touchscreen inverted y axis
48 +
49 + touch-swapxy Touchscreen swapped x y axis
50 +
51 +
52 Name: pitft28-resistive
53 Info: Adafruit PiTFT 2.8" resistive touch screen
54 Load: dtoverlay=pitft28-resistive,<param>=<val>
55 --- /dev/null
56 +++ b/arch/arm/boot/dts/overlays/pitft28-capacitive-overlay.dts
57 @@ -0,0 +1,88 @@
58 +/*
59 + * Device Tree overlay for Adafruit PiTFT 2.8" capacitive touch screen
60 + *
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 + spidev@0{
75 + status = "disabled";
76 + };
77 + };
78 + };
79 +
80 + fragment@1 {
81 + target = <&gpio>;
82 + __overlay__ {
83 + pitft_pins: pitft_pins {
84 + brcm,pins = <24 25>;
85 + brcm,function = <0 1>; /* in out */
86 + brcm,pull = <2 0>; /* pullup none */
87 + };
88 + };
89 + };
90 +
91 + fragment@2 {
92 + target = <&spi0>;
93 + __overlay__ {
94 + /* needed to avoid dtc warning */
95 + #address-cells = <1>;
96 + #size-cells = <0>;
97 +
98 + pitft: pitft@0{
99 + compatible = "ilitek,ili9340";
100 + reg = <0>;
101 + pinctrl-names = "default";
102 + pinctrl-0 = <&pitft_pins>;
103 +
104 + spi-max-frequency = <32000000>;
105 + rotate = <90>;
106 + fps = <25>;
107 + bgr;
108 + buswidth = <8>;
109 + dc-gpios = <&gpio 25 0>;
110 + debug = <0>;
111 + };
112 + };
113 + };
114 +
115 + fragment@3 {
116 + target = <&i2c1>;
117 + __overlay__ {
118 + /* needed to avoid dtc warning */
119 + #address-cells = <1>;
120 + #size-cells = <0>;
121 +
122 + ft6236: ft6236@38 {
123 + compatible = "focaltech,ft6236";
124 + reg = <0x38>;
125 +
126 + interrupt-parent = <&gpio>;
127 + interrupts = <24 2>;
128 + touchscreen-size-x = <240>;
129 + touchscreen-size-y = <320>;
130 + };
131 + };
132 + };
133 +
134 + __overrides__ {
135 + speed = <&pitft>,"spi-max-frequency:0";
136 + rotate = <&pitft>,"rotate:0";
137 + fps = <&pitft>,"fps:0";
138 + debug = <&pitft>,"debug:0";
139 + touch-sizex = <&ft6236>,"touchscreen-size-x?";
140 + touch-sizey = <&ft6236>,"touchscreen-size-y?";
141 + touch-invx = <&ft6236>,"touchscreen-inverted-x?";
142 + touch-invy = <&ft6236>,"touchscreen-inverted-y?";
143 + touch-swapxy = <&ft6236>,"touchscreen-swapped-x-y?";
144 + };
145 +};