1 From a0cc0a16b17996107a6dd712de9031a7bb7d0b34 Mon Sep 17 00:00:00 2001
2 From: Scott Ellis <scott@jumpnowtek.com>
3 Date: Tue, 27 Sep 2016 04:29:00 -0400
4 Subject: [PATCH] Add Adafruit pitft35 touchscreen support (#1657)
6 The dts comes from the Adafruit repository
8 https://github.com/adafruit/Adafruit-Pi-Kernel-o-Matic/blob/pitft/pitft35r-overlay.dts
10 Reformatted slightly to match conventions in the pitft28-resistive-overlay.
12 Signed-off-by: Scott Ellis <scott@jumpnowtek.com>
14 arch/arm/boot/dts/overlays/Makefile | 1 +
15 arch/arm/boot/dts/overlays/README | 12 ++
16 .../dts/overlays/pitft35-resistive-overlay.dts | 121 +++++++++++++++++++++
17 arch/arm/configs/bcm2709_defconfig | 1 +
18 arch/arm/configs/bcmrpi_defconfig | 1 +
19 5 files changed, 136 insertions(+)
20 create mode 100644 arch/arm/boot/dts/overlays/pitft35-resistive-overlay.dts
22 --- a/arch/arm/boot/dts/overlays/Makefile
23 +++ b/arch/arm/boot/dts/overlays/Makefile
24 @@ -65,6 +65,7 @@ dtbo-$(RPI_DT_OVERLAYS) += piscreen2r.dt
25 dtbo-$(RPI_DT_OVERLAYS) += pitft22.dtbo
26 dtbo-$(RPI_DT_OVERLAYS) += pitft28-capacitive.dtbo
27 dtbo-$(RPI_DT_OVERLAYS) += pitft28-resistive.dtbo
28 +dtbo-$(RPI_DT_OVERLAYS) += pitft35-resistive.dtbo
29 dtbo-$(RPI_DT_OVERLAYS) += pps-gpio.dtbo
30 dtbo-$(RPI_DT_OVERLAYS) += pwm.dtbo
31 dtbo-$(RPI_DT_OVERLAYS) += pwm-2chan.dtbo
32 --- a/arch/arm/boot/dts/overlays/README
33 +++ b/arch/arm/boot/dts/overlays/README
34 @@ -854,6 +854,18 @@ Params: speed Display
35 debug Debug output level {0-7}
38 +Name: pitft35-resistive
39 +Info: Adafruit PiTFT 3.5" resistive touch screen
40 +Load: dtoverlay=pitft35-resistive,<param>=<val>
41 +Params: speed Display SPI bus speed
43 + rotate Display rotation {0,90,180,270}
45 + fps Delay between frame updates
47 + debug Debug output level {0-7}
51 Info: Configures the pps-gpio (pulse-per-second time signal via GPIO).
52 Load: dtoverlay=pps-gpio,<param>=<val>
54 +++ b/arch/arm/boot/dts/overlays/pitft35-resistive-overlay.dts
57 + * Device Tree overlay for Adafruit PiTFT 3.5" resistive touch screen
65 + compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
75 + target = <&spidev0>;
77 + status = "disabled";
82 + target = <&spidev1>;
84 + status = "disabled";
91 + pitft_pins: pitft_pins {
92 + brcm,pins = <24 25>;
93 + brcm,function = <0 1>; /* in out */
94 + brcm,pull = <2 0>; /* pullup none */
102 + /* needed to avoid dtc warning */
103 + #address-cells = <1>;
107 + compatible = "himax,hx8357d";
109 + pinctrl-names = "default";
110 + pinctrl-0 = <&pitft_pins>;
112 + spi-max-frequency = <32000000>;
117 + dc-gpios = <&gpio 25 0>;
122 + #address-cells = <1>;
124 + compatible = "st,stmpe610";
127 + spi-max-frequency = <500000>;
128 + irq-gpio = <&gpio 24 0x2>; /* IRQF_TRIGGER_FALLING */
129 + interrupts = <24 2>; /* high-to-low edge triggered */
130 + interrupt-parent = <&gpio>;
131 + interrupt-controller;
133 + stmpe_touchscreen {
134 + compatible = "st,stmpe-ts";
135 + st,sample-time = <4>;
140 + st,touch-det-delay = <4>;
142 + st,fraction-z = <7>;
146 + stmpe_gpio: stmpe_gpio {
148 + compatible = "st,stmpe-gpio";
150 + * only GPIO2 is wired/available
151 + * and it is wired to the backlight
153 + st,norequest-mask = <0x7b>;
160 + target-path = "/soc";
163 + compatible = "gpio-backlight";
164 + gpios = <&stmpe_gpio 2 0>;
171 + speed = <&pitft>,"spi-max-frequency:0";
172 + rotate = <&pitft>,"rotate:0";
173 + fps = <&pitft>,"fps:0";
174 + debug = <&pitft>,"debug:0";
177 --- a/arch/arm/configs/bcm2709_defconfig
178 +++ b/arch/arm/configs/bcm2709_defconfig
179 @@ -1116,6 +1116,7 @@ CONFIG_FB_TFT_BD663474=m
180 CONFIG_FB_TFT_HX8340BN=m
181 CONFIG_FB_TFT_HX8347D=m
182 CONFIG_FB_TFT_HX8353D=m
183 +CONFIG_FB_TFT_HX8357D=m
184 CONFIG_FB_TFT_ILI9163=m
185 CONFIG_FB_TFT_ILI9320=m
186 CONFIG_FB_TFT_ILI9325=m
187 --- a/arch/arm/configs/bcmrpi_defconfig
188 +++ b/arch/arm/configs/bcmrpi_defconfig
189 @@ -1123,6 +1123,7 @@ CONFIG_FB_TFT_BD663474=m
190 CONFIG_FB_TFT_HX8340BN=m
191 CONFIG_FB_TFT_HX8347D=m
192 CONFIG_FB_TFT_HX8353D=m
193 +CONFIG_FB_TFT_HX8357D=m
194 CONFIG_FB_TFT_ILI9163=m
195 CONFIG_FB_TFT_ILI9320=m
196 CONFIG_FB_TFT_ILI9325=m