8f33dcd5e604913b40bbf3607a2d072d5252c997
[openwrt/staging/robimarko.git] /
1 From 62ae8907efb221f232126726bf4df5c9da23a8b4 Mon Sep 17 00:00:00 2001
2 From: Jesse Taube <Mr.Bossman075@gmail.com>
3 Date: Thu, 8 Jul 2021 16:32:16 -0400
4 Subject: [PATCH] overlays: Add overlay for cap1106 capacitive touch
5 sensor
6
7 Signed-off-by: Jesse Taube <mr.bossman075@gmail.com>
8 ---
9 arch/arm/boot/dts/overlays/Makefile | 1 +
10 arch/arm/boot/dts/overlays/README | 6 +++
11 .../arm/boot/dts/overlays/cap1106-overlay.dts | 52 +++++++++++++++++++
12 3 files changed, 59 insertions(+)
13 create mode 100644 arch/arm/boot/dts/overlays/cap1106-overlay.dts
14
15 --- a/arch/arm/boot/dts/overlays/Makefile
16 +++ b/arch/arm/boot/dts/overlays/Makefile
17 @@ -30,6 +30,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
18 audiosense-pi.dtbo \
19 audremap.dtbo \
20 balena-fin.dtbo \
21 + cap1106.dtbo \
22 chipdip-i2s-master-dac.dtbo \
23 cma.dtbo \
24 dht11.dtbo \
25 --- a/arch/arm/boot/dts/overlays/README
26 +++ b/arch/arm/boot/dts/overlays/README
27 @@ -622,6 +622,12 @@ Info: This overlay is now deprecated -
28 Load: <Deprecated>
29
30
31 +Name: cap1106
32 +Info: Enables the ability to use the cap1106 touch sensor as a keyboard
33 +Load: dtoverlay=cap1106,<param>=<val>
34 +Params: int_pin GPIO pin for interrupt signal (default 23)
35 +
36 +
37 Name: chipdip-i2s-master-dac
38 Info: Configures Raspberry PI to work as I2S slave with BCLK=64Fs.
39 Load: dtoverlay=chipdip-i2s-master-dac
40 --- /dev/null
41 +++ b/arch/arm/boot/dts/overlays/cap1106-overlay.dts
42 @@ -0,0 +1,52 @@
43 +// Overlay for cap1106 from Microchip Semiconductor
44 +// add CONFIG_KEYBOARD_CAP11XX=y
45 +
46 +/dts-v1/;
47 +/plugin/;
48 +
49 +/ {
50 + compatible = "brcm,bcm2835";
51 + fragment@0 {
52 + target = <&i2c1>;
53 + __overlay__{
54 + status = "okay";
55 + cap1106: cap1106@28 {
56 + compatible = "microchip,cap1106";
57 + pinctrl-0 = <&cap1106_pins>;
58 + pinctrl-names = "default";
59 + interrupt-parent = <&gpio>;
60 + interrupts = <4 2>;
61 + reg = <0x28>;
62 + autorepeat;
63 + microchip,sensor-gain = <2>;
64 +
65 + linux,keycodes = <2>, /* KEY_1 */
66 + <3>, /* KEY_2 */
67 + <4>, /* KEY_3 */
68 + <5>, /* KEY_4 */
69 + <6>, /* KEY_5 */
70 + <7>; /* KEY_6 */
71 +
72 + #address-cells = <1>;
73 + #size-cells = <0>;
74 + status = "okay";
75 +
76 + };
77 + };
78 + };
79 + fragment@1 {
80 + target = <&gpio>;
81 + __overlay__ {
82 + cap1106_pins: cap1106_pins {
83 + brcm,pins = <4>;
84 + brcm,function = <0>; /* in */
85 + brcm,pull = <0>; /* none */
86 + };
87 + };
88 + };
89 +
90 + __overrides__ {
91 + int_pin = <&cap1106>, "interrupts:0",
92 + <&cap1106_pins>, "brcm,pins:0";
93 + };
94 +};