Skip to content

Commit 58dc6ad

Browse files
yc-hou-0919scorpiochang
authored andcommitted
Add ads7846 touch screen for WaveShare 4"/3.5" HDMI LCD
Please note that waveshare35a-tinker/waveshare32b-tinker dts overlay use the same touch IC but different interrupt pin, so please never use them at the same time. Change-Id: I449f9d905010d65b4268011e406b827d91f258bf Reviewed-on: https://tp-biosrd-v02/gerrit/82275 Reviewed-by: Scorpio Chang(張志賢) <Scorpio_Chang@asus.com> Tested-by: Scorpio Chang(張志賢) <Scorpio_Chang@asus.com>
1 parent eed0b61 commit 58dc6ad

File tree

2 files changed

+79
-1
lines changed

2 files changed

+79
-1
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dtbo-$(CONFIG_ARCH_ROCKCHIP) += \
2121
lirc-toshiba.dtbo \
2222
mcp2515-can0.dtbo \
2323
googlevoicehat-soundcard.dtbo \
24-
24+
ads7846-tinker.dtbo \
2525

2626
targets += dtbs dtbs_install
2727
targets += $(dtbo-y)
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/*
2+
* Generic Device Tree overlay for the ADS7846 touch controller
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+
ads7846_pins: ads7846_pins {
32+
rockchip,pins = <5 19 0 &pcfg_pull_up>;
33+
};
34+
};
35+
};
36+
37+
fragment@2 {
38+
target = <&spi2>;
39+
__overlay__ {
40+
/* needed to avoid dtc warning */
41+
#address-cells = <1>;
42+
#size-cells = <0>;
43+
44+
ads7846: ads7846@1 {
45+
compatible = "ti,ads7846";
46+
reg = <1>;
47+
pinctrl-names = "default";
48+
pinctrl-0 = <&ads7846_pins>;
49+
50+
spi-max-frequency = <2000000>;
51+
interrupts = <19 2>; // high-to-low edge triggered
52+
interrupt-parent = <&gpio5>;
53+
pendown-gpio = <&gpio5 19 0>;
54+
ti,x-plate-ohms = /bits/ 16 <60>;
55+
ti,pressure-max = /bits/ 16 <255>;
56+
};
57+
};
58+
};
59+
60+
/*
61+
__overrides__ {
62+
cs = <&ads7846>,"reg:0";
63+
speed = <&ads7846>,"spi-max-frequency:0";
64+
penirq = <&ads7846_pins>,"brcm,pins:0", // REQUIRED
65+
<&ads7846>,"interrupts:0",
66+
<&ads7846>,"pendown-gpio:4";
67+
penirq_pull = <&ads7846_pins>,"brcm,pull:0";
68+
swapxy = <&ads7846>,"ti,swap-xy?";
69+
xmin = <&ads7846>,"ti,x-min;0";
70+
ymin = <&ads7846>,"ti,y-min;0";
71+
xmax = <&ads7846>,"ti,x-max;0";
72+
ymax = <&ads7846>,"ti,y-max;0";
73+
pmin = <&ads7846>,"ti,pressure-min;0";
74+
pmax = <&ads7846>,"ti,pressure-max;0";
75+
xohms = <&ads7846>,"ti,x-plate-ohms;0";
76+
};
77+
*/
78+
};

0 commit comments

Comments
 (0)