Documentation/devicetree/bindings/input/gpio-charlieplex-keypad.yaml

Source file repositories/reference/linux-study-clean/Documentation/devicetree/bindings/input/gpio-charlieplex-keypad.yaml

File Facts

System
Linux kernel
Corpus path
Documentation/devicetree/bindings/input/gpio-charlieplex-keypad.yaml
Extension
.yaml
Size
3463 bytes
Lines
109
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: configuration, schema, or hardware description
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---

$id: http://devicetree.org/schemas/input/gpio-charlieplex-keypad.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: GPIO charlieplex keypad

maintainers:
  - Hugo Villeneuve <hvilleneuve@dimonoff.com>

description: |
  The charlieplex keypad supports N^2)-N different key combinations (where N is
  the number of I/O lines). Key presses and releases are detected by configuring
  only one line as output at a time, and reading other line states. This process
  is repeated for each line. Diodes are required to ensure current flows in only
  one direction between any pair of pins, as well as pull-up or pull-down
  resistors on all I/O lines.
  This mechanism doesn't allow to detect simultaneous key presses.

  Wiring example for 3 lines keyboard with 6 switches and 3 diodes (pull-up/down
  resistors not shown but needed on L0, L1 and L2):

  L0  --+---------------------+----------------------+
        |                     |                      |
  L1  -------+-----------+---------------------+     |
        |    |           |    |                |     |
  L2  -------------+----------------+-----+    |     |
        |    |     |     |    |     |     |    |     |
        |    |     |     |    |     |     |    |     |
        |  S1 \  S2 \    |  S3 \  S4 \    |  S5 \  S6 \
        |    |     |     |    |     |     |    |     |
        |    +--+--+     |    +--+--+     |    +--+--+
        |       |        |       |        |       |
        |    D1 v        |    D2 v        |    D3 v
        |       - (k)    |       - (k)    |       - (k)
        |       |        |       |        |       |
        +-------+        +-------+        +-------+

  L: GPIO line
  S: switch
  D: diode (k indicates cathode)

allOf:
  - $ref: input.yaml#
  - $ref: /schemas/input/matrix-keymap.yaml#

properties:
  compatible:
    const: gpio-charlieplex-keypad

  autorepeat: true

  debounce-delay-ms:
    default: 5

  line-gpios:
    description:
      List of GPIOs used as lines. The gpio specifier for this property
      depends on the gpio controller to which these lines are connected.

  linux,keymap: true

  poll-interval: true

  settling-time-us: true

  wakeup-source: true

Annotation

Implementation Notes