Skip to content

Commit 9adaa4b

Browse files
Scott Ellispopcornmix
Scott Ellis
authored andcommitted
Add Adafruit pitft35 touchscreen support (#1657)
The dts comes from the Adafruit repository https://github.com/adafruit/Adafruit-Pi-Kernel-o-Matic/blob/pitft/pitft35r-overlay.dts Reformatted slightly to match conventions in the pitft28-resistive-overlay. Signed-off-by: Scott Ellis <[email protected]>
1 parent 612f860 commit 9adaa4b

File tree

5 files changed

+136
-0
lines changed

5 files changed

+136
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ dtbo-$(RPI_DT_OVERLAYS) += piscreen2r.dtbo
6464
dtbo-$(RPI_DT_OVERLAYS) += pitft22.dtbo
6565
dtbo-$(RPI_DT_OVERLAYS) += pitft28-capacitive.dtbo
6666
dtbo-$(RPI_DT_OVERLAYS) += pitft28-resistive.dtbo
67+
dtbo-$(RPI_DT_OVERLAYS) += pitft35-resistive.dtbo
6768
dtbo-$(RPI_DT_OVERLAYS) += pps-gpio.dtbo
6869
dtbo-$(RPI_DT_OVERLAYS) += pwm.dtbo
6970
dtbo-$(RPI_DT_OVERLAYS) += pwm-2chan.dtbo

arch/arm/boot/dts/overlays/README

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,18 @@ Params: speed Display SPI bus speed
848848
debug Debug output level {0-7}
849849

850850

851+
Name: pitft35-resistive
852+
Info: Adafruit PiTFT 3.5" resistive touch screen
853+
Load: dtoverlay=pitft35-resistive,<param>=<val>
854+
Params: speed Display SPI bus speed
855+
856+
rotate Display rotation {0,90,180,270}
857+
858+
fps Delay between frame updates
859+
860+
debug Debug output level {0-7}
861+
862+
851863
Name: pps-gpio
852864
Info: Configures the pps-gpio (pulse-per-second time signal via GPIO).
853865
Load: dtoverlay=pps-gpio,<param>=<val>
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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", "brcm,bcm2708", "brcm,bcm2709";
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";
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+
#address-cells = <1>;
68+
#size-cells = <0>;
69+
compatible = "st,stmpe610";
70+
reg = <1>;
71+
72+
spi-max-frequency = <500000>;
73+
irq-gpio = <&gpio 24 0x2>; /* IRQF_TRIGGER_FALLING */
74+
interrupts = <24 2>; /* high-to-low edge triggered */
75+
interrupt-parent = <&gpio>;
76+
interrupt-controller;
77+
78+
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";
118+
fps = <&pitft>,"fps:0";
119+
debug = <&pitft>,"debug:0";
120+
};
121+
};

arch/arm/configs/bcm2709_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,7 @@ CONFIG_FB_TFT_BD663474=m
11111111
CONFIG_FB_TFT_HX8340BN=m
11121112
CONFIG_FB_TFT_HX8347D=m
11131113
CONFIG_FB_TFT_HX8353D=m
1114+
CONFIG_FB_TFT_HX8357D=m
11141115
CONFIG_FB_TFT_ILI9163=m
11151116
CONFIG_FB_TFT_ILI9320=m
11161117
CONFIG_FB_TFT_ILI9325=m

arch/arm/configs/bcmrpi_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,7 @@ CONFIG_FB_TFT_BD663474=m
11171117
CONFIG_FB_TFT_HX8340BN=m
11181118
CONFIG_FB_TFT_HX8347D=m
11191119
CONFIG_FB_TFT_HX8353D=m
1120+
CONFIG_FB_TFT_HX8357D=m
11201121
CONFIG_FB_TFT_ILI9163=m
11211122
CONFIG_FB_TFT_ILI9320=m
11221123
CONFIG_FB_TFT_ILI9325=m

0 commit comments

Comments
 (0)