Skip to content

Commit

Permalink
input: it8xxx2: use the generic keyboard code
Browse files Browse the repository at this point in the history
Split the common keyboard scanning code out of the ITE specific driver
and use the generic code instead.

Note that this changes few timing defaults, the change is not
significant though so I suspect there's no difference in practice.

Signed-off-by: Fabio Baltieri <[email protected]>
  • Loading branch information
fabiobaltieri authored and carlescufi committed Nov 16, 2023
1 parent 24c1b42 commit e87ded3
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 398 deletions.
2 changes: 2 additions & 0 deletions boards/riscv/it82xx2_evb/it82xx2_evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@
&kso14_default
&kso15_default>;
pinctrl-names = "default";
row-size = <8>;
col-size = <16>;

kscan_input: kscan-input {
compatible = "zephyr,kscan-input";
Expand Down
2 changes: 2 additions & 0 deletions boards/riscv/it8xxx2_evb/it8xxx2_evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@
&kso14_default
&kso15_default>;
pinctrl-names = "default";
row-size = <8>;
col-size = <16>;

kscan_input: kscan-input {
compatible = "zephyr,kscan-input";
Expand Down
40 changes: 2 additions & 38 deletions drivers/input/Kconfig.it8xxx2
Original file line number Diff line number Diff line change
@@ -1,47 +1,11 @@
# Copyright (c) 2021 ITE Corporation. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

menuconfig INPUT_ITE_IT8XXX2_KBD
config INPUT_ITE_IT8XXX2_KBD
bool "ITE keyboard scanning driver"
default y
depends on DT_HAS_ITE_IT8XXX2_KBD_ENABLED
select INPUT_KBD_MATRIX
select MULTITHREADING
help
This option enables the ITE keyboard scan driver.

if INPUT_ITE_IT8XXX2_KBD

config INPUT_ITE_IT8XXX2_COLUMN_SIZE
int "INPUT_ITE_IT8XXX2_COLUMN_SIZE"
range 16 18
default 16
help
Adjust the value to your keyboard columns. The maximum
column size for the ITE family is 18.

config INPUT_ITE_IT8XXX2_ROW_SIZE
int "INPUT_ITE_IT8XXX2_ROW_SIZE"
default 8
help
Adjust the value to your keyboard rows. The maximum
row size for the ITE family is 8.

config INPUT_ITE_IT8XXX2_DEBOUNCE_DOWN
int "INPUT_ITE_IT8XXX2_DEBOUNCE_DOWN"
default 9
help
Determines the time in msecs for debouncing a key press.

config INPUT_ITE_IT8XXX2_DEBOUNCE_UP
int "INPUT_ITE_IT8XXX2_DEBOUNCE_UP"
default 30
help
Determines the time in msecs for debouncing a key release.

config INPUT_ITE_IT8XXX2_POLL_PERIOD
int "INPUT_ITE_IT8XXX2_POLL_PERIOD"
default 3
help
Defines the poll period in msecs between matrix scans.

endif
Loading

0 comments on commit e87ded3

Please sign in to comment.