Lines Matching +full:no +full:- +full:ghostkey +full:- +full:check

1 .. _gpio-kbd:
6 The :dtcompatible:`gpio-kbd-matrix` driver supports a large variety of keyboard
14 Base use case, no isolation diodes, interrupt capable GPIOs
18 switches and flexible circuit boards, no isolation diodes, requires ghosting
21 .. figure:: no-diodes.svg
25 A 3x3 matrix, no diodes
30 .. code-block:: devicetree
32 kbd-matrix {
33 compatible = "gpio-kbd-matrix";
34 row-gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>,
37 col-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>,
49 time can be tweaked by changing the ``settle-time-us`` property.
56 - disable ghosting detection, allowing any key combination to be detected
57 - configuring the driver to drive unselected columns GPIO to inactive state
62 Matrixes with diodes going from rows to columns must use pull-ups on rows and
65 .. figure:: diodes-rc.svg
71 .. code-block:: devicetree
73 kbd-matrix {
74 compatible = "gpio-kbd-matrix";
75 row-gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>,
78 col-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>,
81 col-drive-inactive;
82 settle-time-us = <0>;
83 no-ghostkey-check;
86 Matrixes with diodes going from columns to rows must use pull-downs on rows and
89 .. figure:: diodes-cr.svg
95 .. code-block:: devicetree
97 kbd-matrix {
98 compatible = "gpio-kbd-matrix";
99 row-gpios = <&gpio0 0 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>,
102 col-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>,
105 col-drive-inactive;
106 settle-time-us = <0>;
107 no-ghostkey-check;
110 GPIO with no interrupt support
120 This configuration can be enabled by setting the ``idle-mode`` property to
123 .. code-block:: devicetree
125 kbd-matrix {
126 compatible = "gpio-kbd-matrix";
128 idle-mode = "poll";
138 This can be done by setting ``idle-mode`` to ``scan`` and ``poll-timeout-ms``
141 .. code-block:: devicetree
143 kbd-matrix {
144 compatible = "gpio-kbd-matrix";
146 poll-timeout-ms = <0>;
147 idle-mode = "scan";
160 ``col-drive-inactive``, so that is only usable for matrixes with isolation
163 16-bit row support
166 The driver uses an 8-bit datatype to store the row state by default, which
174 populated can be specified using the ``actual-key-mask`` property. This allows
181 .. figure:: no-sw4.svg
187 .. code-block:: devicetree
189 kbd-matrix {
190 compatible = "gpio-kbd-matrix";
192 actual-key-mask = <0x07 0x05 0x07>;
206 mapped to normal key events using the :dtcompatible:`input-keymap` driver.
212 .. code-block:: devicetree
217 compatible = "input-keymap";
229 row-size = <3>;
230 col-size = <3>;
240 changes, and once disabled it prints an or-mask of any key that has been
241 detected, which can be used to set the ``actual-key-mask`` property.
248 .. code-block:: console
252 - kbd-matrix (READY)
253 uart:~$ input kbd_matrix_state_dump kbd-matrix
254 Keyboard state logging enabled for kbd-matrix
255 [00:01:41.678,466] <inf> input: kbd-matrix state [01 -- -- --] (1)
256 [00:01:41.784,912] <inf> input: kbd-matrix state [-- -- -- --] (0)
262 [00:01:47.967,651] <inf> input: kbd-matrix key-mask [07 05 07 --] (8)