Skip to content

Commit 1cb2e8d

Browse files
yc-hou-0919scorpiochang
authored andcommitted
Add Adafruit 3.5" TFT & touchscreen
Change-Id: I7993c961234aa968f81c8cd732d8cfa64a292ea8 Reviewed-on: https://tp-biosrd-v02/gerrit/81230 Reviewed-by: Scorpio Chang(張志賢) <Scorpio_Chang@asus.com> Tested-by: Scorpio Chang(張志賢) <Scorpio_Chang@asus.com>
1 parent e99e0b4 commit 1cb2e8d

3 files changed

Lines changed: 91 additions & 0 deletions

File tree

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dtbo-$(CONFIG_ARCH_ROCKCHIP) += \
99
waveshare32b-tinker.dtbo \
1010
pps-gpio.dtbo \
1111
w1-gpio.dtbo \
12+
pitft35-resistive-tinker.dtbo \
1213

1314
targets += dtbs dtbs_install
1415
targets += $(dtbo-y)
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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 = "rockchip,rk3288-miniarm", "rockchip,rk3288";
11+
12+
fragment@0 {
13+
target = <&spi2>;
14+
15+
__overlay__ {
16+
status = "okay";
17+
18+
spidev@0 {
19+
status = "disabled";
20+
};
21+
22+
spidev@1 {
23+
status = "disabled";
24+
};
25+
};
26+
};
27+
28+
fragment@1 {
29+
target = <&gpio5>;
30+
__overlay__ {
31+
pitft_pins: pitft_pins {
32+
rockchip,pins = <5 11 0 &pcfg_pull_up>,
33+
<5 19 1 &pcfg_pull_none>;
34+
};
35+
};
36+
};
37+
38+
fragment@2 {
39+
target = <&spi2>;
40+
__overlay__ {
41+
/* needed to avoid dtc warning */
42+
#address-cells = <1>;
43+
#size-cells = <0>;
44+
45+
pitft: pitft@0{
46+
compatible = "himax,hx8357d";
47+
reg = <0>;
48+
pinctrl-names = "default";
49+
pinctrl-0 = <&pitft_pins>;
50+
51+
spi-max-frequency = <16000000>;
52+
rotate = <0>;
53+
fps = <20>;
54+
bgr;
55+
buswidth = <8>;
56+
dc-gpios = <&gpio5 19 0>;
57+
debug = <0>;
58+
};
59+
60+
pitft_ts@1 {
61+
#address-cells = <1>;
62+
#size-cells = <0>;
63+
compatible = "st,stmpe610";
64+
reg = <1>;
65+
66+
spi-max-frequency = <500000>;
67+
interrupts = <11 2>; /* high-to-low edge triggered */
68+
interrupt-parent = <&gpio5>;
69+
interrupt-controller;
70+
71+
stmpe_touchscreen {
72+
compatible = "st,stmpe-ts";
73+
st,sample-time = <4>;
74+
st,mod-12b = <1>;
75+
st,ref-sel = <0>;
76+
st,adc-freq = <2>;
77+
st,ave-ctrl = <3>;
78+
st,touch-det-delay = <4>;
79+
st,settling = <2>;
80+
st,fraction-z = <7>;
81+
st,i-drive = <0>;
82+
};
83+
};
84+
};
85+
};
86+
};

arch/arm/configs/miniarm-rk3288_defconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
439439
CONFIG_TOUCHSCREEN_ADS7846=y
440440
CONFIG_TOUCHSCREEN_ATMEL_MXT=y
441441
CONFIG_TOUCHSCREEN_ELAN=y
442+
CONFIG_TOUCHSCREEN_STMPE=y
442443
CONFIG_TOUCHSCREEN_USB_COMPOSITE=y
443444
CONFIG_TOUCHSCREEN_TINKER_FT5406=y
444445
CONFIG_TINKER_MCU=y
@@ -485,6 +486,8 @@ CONFIG_DW_WATCHDOG=y
485486
CONFIG_MFD_CROS_EC=y
486487
CONFIG_MFD_CROS_EC_SPI=y
487488
CONFIG_MFD_RK808=y
489+
CONFIG_MFD_STMPE=y
490+
CONFIG_STMPE_SPI=y
488491
CONFIG_MFD_TPS6586X=y
489492
CONFIG_REGULATOR_FIXED_VOLTAGE=y
490493
CONFIG_REGULATOR_ACT8865=y
@@ -620,6 +623,7 @@ CONFIG_DMADEVICES=y
620623
CONFIG_PL330_DMA=y
621624
CONFIG_STAGING=y
622625
CONFIG_FB_TFT=y
626+
CONFIG_FB_TFT_HX8357D=y
623627
CONFIG_FB_TFT_ILI9340=y
624628
CONFIG_FB_TFT_ILI9486=y
625629
CONFIG_FB_FLEX=y

0 commit comments

Comments
 (0)