diff --git a/drivers/input/CMakeLists.txt b/drivers/input/CMakeLists.txt index 8e7ea022b54..9215060d8ad 100644 --- a/drivers/input/CMakeLists.txt +++ b/drivers/input/CMakeLists.txt @@ -7,7 +7,7 @@ zephyr_library_property(ALLOW_EMPTY TRUE) zephyr_library_sources_ifdef(CONFIG_INPUT_ADC_KEYS input_adc_keys.c) zephyr_library_sources_ifdef(CONFIG_INPUT_ANALOG_AXIS input_analog_axis.c) zephyr_library_sources_ifdef(CONFIG_INPUT_ANALOG_AXIS_SETTINGS input_analog_axis_settings.c) -zephyr_library_sources_ifdef(CONFIG_INPUT_CAP1203 input_cap1203.c) +zephyr_library_sources_ifdef(CONFIG_INPUT_CAP12XX input_cap12xx.c) zephyr_library_sources_ifdef(CONFIG_INPUT_CF1133 input_cf1133.c) zephyr_library_sources_ifdef(CONFIG_INPUT_CHSC6X input_chsc6x.c) zephyr_library_sources_ifdef(CONFIG_INPUT_CST816S input_cst816s.c) diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig index 8935bf5e4d7..85a316ac12e 100644 --- a/drivers/input/Kconfig +++ b/drivers/input/Kconfig @@ -8,7 +8,7 @@ menu "Input drivers" # zephyr-keep-sorted-start source "drivers/input/Kconfig.adc_keys" source "drivers/input/Kconfig.analog_axis" -source "drivers/input/Kconfig.cap1203" +source "drivers/input/Kconfig.cap12xx" source "drivers/input/Kconfig.cf1133" source "drivers/input/Kconfig.chsc6x" source "drivers/input/Kconfig.cst816s" diff --git a/drivers/input/Kconfig.cap1203 b/drivers/input/Kconfig.cap1203 deleted file mode 100644 index 28a87b6c704..00000000000 --- a/drivers/input/Kconfig.cap1203 +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2022 Keiya Nobuta -# SPDX-License-Identifier: Apache-2.0 - -menuconfig INPUT_CAP1203 - bool "CAP1203 3-cannel capacitive touch sensor driver" - default y - depends on DT_HAS_MICROCHIP_CAP1203_ENABLED - select I2C - help - Enable driver for microchip CAP1203 3-cannel capacitive - touch sensor. - -if INPUT_CAP1203 - -config INPUT_CAP1203_POLL - bool "Polling" - help - Enable polling mode when interrupt GPIO is not specified. - -config INPUT_CAP1203_PERIOD - int "Sample period" - depends on INPUT_CAP1203_POLL - default 10 - help - Sample period in milliseconds when in polling mode. - -endif # INPUT_CAP1203 diff --git a/drivers/input/Kconfig.cap12xx b/drivers/input/Kconfig.cap12xx new file mode 100644 index 00000000000..eb716435b73 --- /dev/null +++ b/drivers/input/Kconfig.cap12xx @@ -0,0 +1,27 @@ +# Copyright (c) 2022 Keiya Nobuta +# SPDX-License-Identifier: Apache-2.0 + +menuconfig INPUT_CAP12XX + bool "cap12xx 3-cannel capacitive touch sensor driver" + default y + depends on DT_HAS_MICROCHIP_CAP12XX_ENABLED + select I2C + help + Enable driver for microchip cap12xx 3-cannel capacitive + touch sensor. + +if INPUT_CAP12XX + +config INPUT_CAP12XX_POLL + bool "Polling" + help + Enable polling mode when interrupt GPIO is not specified. + +config INPUT_CAP1XX3_PERIOD + int "Sample period" + depends on INPUT_CAP12XX_POLL + default 10 + help + Sample period in milliseconds when in polling mode. + +endif # INPUT_CAP12XX diff --git a/drivers/input/input_cap1203.c b/drivers/input/input_cap12xx.c similarity index 100% rename from drivers/input/input_cap1203.c rename to drivers/input/input_cap12xx.c diff --git a/dts/bindings/input/microchip,cap1203.yaml b/dts/bindings/input/microchip,cap12xx.yaml similarity index 59% rename from dts/bindings/input/microchip,cap1203.yaml rename to dts/bindings/input/microchip,cap12xx.yaml index e6c9ed1fc3e..b40fd6cff20 100644 --- a/dts/bindings/input/microchip,cap1203.yaml +++ b/dts/bindings/input/microchip,cap12xx.yaml @@ -1,9 +1,9 @@ # Copyright (c) 2022 Keiya Nobuta # SPDX-License-Identifier: Apache-2.0 -description: CAP1203 3-channel capacitive touch sensor +description: cap12xx 3-channel capacitive touch sensor -compatible: "microchip,cap1203" +compatible: "microchip,cap12xx" include: i2c-device.yaml @@ -15,4 +15,4 @@ properties: type: array required: true description: | - Array of input event key codes (INPUT_KEY_* or INPUT_BTN_*). + array of input event key codes (INPUT_KEY_* or INPUT_BTN_*). diff --git a/tests/drivers/build_all/input/app.overlay b/tests/drivers/build_all/input/app.overlay index b2ea75929a3..aee8c7db368 100644 --- a/tests/drivers/build_all/input/app.overlay +++ b/tests/drivers/build_all/input/app.overlay @@ -210,8 +210,8 @@ rst-gpios = <&test_gpio 1 0>; }; - cap1203@3 { - compatible = "microchip,cap1203"; + cap12xx@3 { + compatible = "microchip,cap12xx"; reg = <0x3>; int-gpios = <&test_gpio 0 0>; input-codes = <0 1 2>;