1/*
2 * Copyright 2023 Google LLC
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7&gpio0 {
8	ngpios = <12>;
9};
10
11/ {
12	kbd_matrix_interrupt: kbd-matrix-interrupt {
13		compatible = "gpio-kbd-matrix";
14		row-gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>,
15			    <&gpio0 1 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
16		col-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>,
17			    <&gpio0 3 GPIO_ACTIVE_LOW>;
18		debounce-down-ms = <80>;
19		debounce-up-ms = <40>;
20		poll-timeout-ms = <500>;
21	};
22
23	kbd_matrix_poll: kbd-matrix-poll {
24		compatible = "gpio-kbd-matrix";
25		row-gpios = <&gpio0 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>,
26			    <&gpio0 5 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
27		col-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>,
28			    <&gpio0 7 GPIO_ACTIVE_LOW>;
29		debounce-down-ms = <40>;
30		debounce-up-ms = <80>;
31		poll-timeout-ms = <500>;
32		idle-mode = "poll";
33		col-drive-inactive;
34	};
35
36	kbd_matrix_scan: kbd-matrix-scan {
37		compatible = "gpio-kbd-matrix";
38		/* pins out of sequence to test non direct read */
39		row-gpios = <&gpio0 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>,
40			    <&gpio0 8 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
41		col-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>,
42			    <&gpio0 10 GPIO_ACTIVE_LOW>;
43		debounce-down-ms = <80>;
44		debounce-up-ms = <40>;
45		poll-timeout-ms = <0>;
46		col-drive-inactive;
47		idle-mode = "scan";
48	};
49};
50