Implement a new stable-poll-period-ms property to specify a new (slower) polling rate for when the matrix is stable. The keyboard thread can eat up a surprisingly high amount of cpu cycles in busy waiting if the specific hardware implementation happen to have a particularly slow settle time, but high frequency polling is really only needed when debouncing. The new property allow slowing down the polling rate when the matrix is stable (either key pressed but none to be debounced or idle in the case of the gpio implementation with no interrupts), this allows reducing the overall cpu time taken by the keyboard scanning thread when keys are persistently pressed. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
71 lines
1.8 KiB
YAML
71 lines
1.8 KiB
YAML
# Copyright 2023 Google LLC
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
description: Keyboard matrix device
|
|
|
|
include: base.yaml
|
|
|
|
properties:
|
|
row-size:
|
|
type: int
|
|
description: |
|
|
The number of rows in the keyboard matrix.
|
|
|
|
col-size:
|
|
type: int
|
|
description: |
|
|
The number of column in the keyboard matrix.
|
|
|
|
poll-period-ms:
|
|
type: int
|
|
default: 5
|
|
description: |
|
|
Defines the poll period in msecs between between matrix scans, set to 0
|
|
to never exit poll mode. Defaults to 5ms if unspecified.
|
|
|
|
stable-poll-period-ms:
|
|
type: int
|
|
description: |
|
|
Defines the poll period in msecs between matrix scans when the matrix is
|
|
stable, defaults to poll-period-ms value if unspecified.
|
|
|
|
poll-timeout-ms:
|
|
type: int
|
|
default: 100
|
|
description: |
|
|
How long to wait before going from polling back to idle state. Defaults
|
|
to 100ms if unspecified.
|
|
|
|
debounce-down-ms:
|
|
type: int
|
|
default: 10
|
|
description: |
|
|
Debouncing time for a key press event. Defaults to 10ms if unspecified.
|
|
|
|
debounce-up-ms:
|
|
type: int
|
|
default: 20
|
|
description: |
|
|
Debouncing time for a key release event. Defaults to 20ms if unspecified.
|
|
|
|
settle-time-us:
|
|
type: int
|
|
default: 50
|
|
description: |
|
|
Delay between setting column output and reading the row values. Defaults
|
|
to 50us if unspecified.
|
|
|
|
actual-key-mask:
|
|
type: array
|
|
description:
|
|
Keyboard scanning mask. For each keyboard column, specify which
|
|
keyboard rows actually exist. Can be used to avoid triggering the ghost
|
|
detection on non existing keys. No masking by default, any combination is
|
|
valid.
|
|
|
|
no-ghostkey-check:
|
|
type: boolean
|
|
description: |
|
|
Ignore the ghost key checking in the driver if the diodes are used
|
|
in the matrix hardware.
|