-
Notifications
You must be signed in to change notification settings - Fork 5
/
sj201-buttons-overlay.dts
75 lines (66 loc) · 2.59 KB
/
sj201-buttons-overlay.dts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
* Device Tree Overlay for SJ-201 Rev6&10 - XMOS VocalFusion 3510-INT
*
* This DTO is specifically designed to configure the GPIO pins for button inputs
* on the SJ-201 board, facilitating user interactions through physical buttons.
* These configurations include setting up GPIO pins for volume control,
* wake-up, and microphone mute functionalities.
*
* Instructions:
* Compile this DTO with the following command:
* dtc -@ -H epapr -O dtb -o sj201-buttons-overlay.dtbo -Wno-unit_address_vs_reg sj201-buttons-overlay.dts
*/
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835";
/* Configure GPIO pins for SJ201 keys */
fragment@0 {
target = <&gpio>;
__overlay__ {
sj201_key_pins: sj201_key_pins {
/* GPIOs 22-24 are configured as momentary switches;
GPIO 25 is configured for the Microphone Mute switch. */
brcm,pins = <22 23 24 25>; // Specify the GPIO pins to configure
brcm,function = <0>; // Set pins to input mode
brcm,pull = <0>; // Disable pull-up/down for these pins
};
};
};
/* Define GPIO keys for volume control, wake-up, and microphone mute */
fragment@1 {
target-path = "/soc";
__overlay__ {
sj201_buttons: sj201_buttons {
compatible = "gpio-keys";
// #address-cells = <1>;
// #size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&sj201_key_pins>;
status = "okay";
debounce-interval = <50>;
button_volume_up: button@22 {
gpios = <&gpio 22 1>;
linux,code = <115>; // KEY_VOLUMEUP
label = "Volume Up";
};
button_volume_down: button@23 {
gpios = <&gpio 23 1>;
linux,code = <114>; // KEY_VOLUMEDOWN
label = "Volume Down";
};
button_wake_up: button@24 {
gpios = <&gpio 24 1>;
linux,code = <582>; // KEY_VOICECOMMAND
label = "Wake Up";
gpio-key,wakeup;
};
switch_mic_mute: button@25 {
gpios = <&gpio 25 0>;
linux,code = <248>; // KEY_MICMUTE
label = "Microphone Mute";
};
};
};
};
};