diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 16396a7e854..4966482e367 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -1777,24 +1777,6 @@ Release Notes: tests: - drivers.ipm -"Drivers: kscan": - status: maintained - maintainers: - - albertofloyd - collaborators: - - VenkatKotakonda - files: - - drivers/kscan/ - - include/zephyr/drivers/kscan.h - - samples/drivers/kscan/ - - tests/drivers/kscan/ - - dts/bindings/kscan/ - - doc/hardware/peripherals/kscan.rst - labels: - - "area: Kscan" - tests: - - drivers.kscan - "Drivers: LED": status: maintained maintainers: diff --git a/boards/ite/it82xx2_evb/Kconfig.defconfig b/boards/ite/it82xx2_evb/Kconfig.defconfig deleted file mode 100644 index a106a9d6151..00000000000 --- a/boards/ite/it82xx2_evb/Kconfig.defconfig +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2023 ITE Corporation. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_IT82XX2_EVB - -config INPUT - default y if KSCAN - -endif diff --git a/boards/ite/it82xx2_evb/it82xx2_evb.dts b/boards/ite/it82xx2_evb/it82xx2_evb.dts index 29e8ad721c8..3aa16d53df1 100644 --- a/boards/ite/it82xx2_evb/it82xx2_evb.dts +++ b/boards/ite/it82xx2_evb/it82xx2_evb.dts @@ -17,7 +17,6 @@ i2c-0 = &i2c0; peci-0 = &peci0; led0 = &led0; - kscan0 = &kscan_input; watchdog0 = &twd0; pwm-0 = &pwm0; }; @@ -30,7 +29,6 @@ zephyr,flash = &flash0; zephyr,flash-controller = &flashctrl; zephyr,code-partition = &slot0_partition; - zephyr,keyboard-scan = &kscan_input; }; leds { @@ -196,10 +194,6 @@ pinctrl-names = "default"; row-size = <8>; col-size = <16>; - - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; }; &peci0 { diff --git a/boards/ite/it82xx2_evb/it82xx2_evb.yaml b/boards/ite/it82xx2_evb/it82xx2_evb.yaml index 505c2d7d910..e4e0b974264 100644 --- a/boards/ite/it82xx2_evb/it82xx2_evb.yaml +++ b/boards/ite/it82xx2_evb/it82xx2_evb.yaml @@ -15,7 +15,6 @@ supported: - gpio - usb_device - i2c - - kscan - pm - pwm - tach diff --git a/boards/ite/it8xxx2_evb/Kconfig.defconfig b/boards/ite/it8xxx2_evb/Kconfig.defconfig index 57fc0404475..0c81c357762 100644 --- a/boards/ite/it8xxx2_evb/Kconfig.defconfig +++ b/boards/ite/it8xxx2_evb/Kconfig.defconfig @@ -14,7 +14,4 @@ endchoice endif # PM -config INPUT - default y if KSCAN - endif # BOARD_IT8XXX2_EVB diff --git a/boards/ite/it8xxx2_evb/it8xxx2_evb.dts b/boards/ite/it8xxx2_evb/it8xxx2_evb.dts index 0ee42f981f0..59b4af711c9 100644 --- a/boards/ite/it8xxx2_evb/it8xxx2_evb.dts +++ b/boards/ite/it8xxx2_evb/it8xxx2_evb.dts @@ -17,7 +17,6 @@ i2c-0 = &i2c0; peci-0 = &peci0; led0 = &led0; - kscan0 = &kscan_input; watchdog0 = &twd0; pwm-0 = &pwm0; }; @@ -30,7 +29,6 @@ zephyr,flash = &flash0; zephyr,flash-controller = &flashctrl; zephyr,code-partition = &slot0_partition; - zephyr,keyboard-scan = &kscan_input; }; leds { @@ -180,10 +178,6 @@ pinctrl-names = "default"; row-size = <8>; col-size = <16>; - - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; }; &peci0 { status = "okay"; diff --git a/boards/ite/it8xxx2_evb/it8xxx2_evb.yaml b/boards/ite/it8xxx2_evb/it8xxx2_evb.yaml index 0a57a0937f7..31ef24d2811 100644 --- a/boards/ite/it8xxx2_evb/it8xxx2_evb.yaml +++ b/boards/ite/it8xxx2_evb/it8xxx2_evb.yaml @@ -13,7 +13,6 @@ supported: - gpio - adc - i2c - - kscan - pwm - watchdog vendor: ite diff --git a/boards/microchip/mec1501modular_assy6885/Kconfig.defconfig b/boards/microchip/mec1501modular_assy6885/Kconfig.defconfig index 0ca8a90ad48..1f5c692b90f 100644 --- a/boards/microchip/mec1501modular_assy6885/Kconfig.defconfig +++ b/boards/microchip/mec1501modular_assy6885/Kconfig.defconfig @@ -3,9 +3,6 @@ if BOARD_MEC1501MODULAR_ASSY6885 -config INPUT - default y if KSCAN - #PS/2 driver is compiled in terms of this flag. config ESPI_PERIPHERAL_8042_KBC default y diff --git a/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885.dts b/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885.dts index c259a7a44cd..a076b233eaa 100644 --- a/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885.dts +++ b/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885.dts @@ -17,7 +17,6 @@ zephyr,sram = &sram0; zephyr,console = &uart1; zephyr,flash = &flash0; - zephyr,keyboard-scan = &kscan_input; }; aliases { @@ -26,7 +25,6 @@ i2c0 = &i2c_smb_0; i2c1 = &i2c_smb_1; - kscan0 = &kscan_input; watchdog0 = &wdog; }; }; @@ -120,10 +118,6 @@ pinctrl-names = "default", "sleep"; row-size = <8>; col-size = <16>; - - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; }; &peci0 { diff --git a/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885.yaml b/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885.yaml index d78477f825f..da7c46a8a54 100644 --- a/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885.yaml +++ b/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885.yaml @@ -21,6 +21,5 @@ supported: - i2c - pwm - watchdog - - kscan - tach vendor: microchip diff --git a/boards/microchip/mec15xxevb_assy6853/Kconfig.defconfig b/boards/microchip/mec15xxevb_assy6853/Kconfig.defconfig index 229ba41dff7..c4dae2ad32e 100644 --- a/boards/microchip/mec15xxevb_assy6853/Kconfig.defconfig +++ b/boards/microchip/mec15xxevb_assy6853/Kconfig.defconfig @@ -3,9 +3,6 @@ if BOARD_MEC15XXEVB_ASSY6853 -config INPUT - default y if KSCAN - config ESPI_XEC default y depends on ESPI diff --git a/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.dts b/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.dts index 161536c867d..e9bf7ff2bb7 100644 --- a/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.dts +++ b/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.dts @@ -16,7 +16,6 @@ zephyr,sram = &sram0; zephyr,console = &uart2; zephyr,flash = &flash0; - zephyr,keyboard-scan = &kscan_input; }; aliases { @@ -29,7 +28,6 @@ i2c-0 = &i2c_smb_0; i2c1 = &i2c_smb_1; i2c7 = &i2c_smb_2; - kscan0 = &kscan_input; watchdog0 = &wdog; }; @@ -177,10 +175,6 @@ pinctrl-names = "default", "sleep"; row-size = <8>; col-size = <16>; - - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; }; &peci0 { diff --git a/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.yaml b/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.yaml index 8b8190d20d8..afd985cb020 100644 --- a/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.yaml +++ b/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.yaml @@ -21,5 +21,4 @@ supported: - i2c - pwm - watchdog - - kscan vendor: microchip diff --git a/boards/microchip/mec172xevb_assy6906/Kconfig.defconfig b/boards/microchip/mec172xevb_assy6906/Kconfig.defconfig index 2c93b83e744..c31952ed766 100644 --- a/boards/microchip/mec172xevb_assy6906/Kconfig.defconfig +++ b/boards/microchip/mec172xevb_assy6906/Kconfig.defconfig @@ -3,9 +3,6 @@ if BOARD_MEC172XEVB_ASSY6906 -config INPUT - default y if KSCAN - if RTOS_TIMER # XEC RTOS timer HW frequency is fixed at 32768 Hz. diff --git a/boards/microchip/mec172xevb_assy6906/mec172xevb_assy6906.dts b/boards/microchip/mec172xevb_assy6906/mec172xevb_assy6906.dts index 076e84eda60..bc2ad391664 100644 --- a/boards/microchip/mec172xevb_assy6906/mec172xevb_assy6906.dts +++ b/boards/microchip/mec172xevb_assy6906/mec172xevb_assy6906.dts @@ -233,10 +233,6 @@ pinctrl-names = "default", "sleep"; row-size = <8>; col-size = <16>; - - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; }; &ksi0_gpio017 { diff --git a/boards/microchip/mec172xmodular_assy6930/Kconfig.defconfig b/boards/microchip/mec172xmodular_assy6930/Kconfig.defconfig index c3487f561e9..c0ad2565043 100644 --- a/boards/microchip/mec172xmodular_assy6930/Kconfig.defconfig +++ b/boards/microchip/mec172xmodular_assy6930/Kconfig.defconfig @@ -3,9 +3,6 @@ if BOARD_MEC172XMODULAR_ASSY6930 -config INPUT - default y if KSCAN - if RTOS_TIMER # XEC RTOS timer HW frequency is fixed at 32768 Hz. diff --git a/boards/microchip/mec172xmodular_assy6930/mec172xmodular_assy6930.dts b/boards/microchip/mec172xmodular_assy6930/mec172xmodular_assy6930.dts index 24d600dd040..e5d7e888baa 100644 --- a/boards/microchip/mec172xmodular_assy6930/mec172xmodular_assy6930.dts +++ b/boards/microchip/mec172xmodular_assy6930/mec172xmodular_assy6930.dts @@ -211,10 +211,6 @@ pinctrl-names = "default", "sleep"; row-size = <8>; col-size = <16>; - - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; }; &ksi0_gpio017 { diff --git a/boards/nuvoton/npcx4m8f_evb/Kconfig.defconfig b/boards/nuvoton/npcx4m8f_evb/Kconfig.defconfig index 4bd26c0d348..f7c7cc5430a 100644 --- a/boards/nuvoton/npcx4m8f_evb/Kconfig.defconfig +++ b/boards/nuvoton/npcx4m8f_evb/Kconfig.defconfig @@ -3,6 +3,3 @@ config SYS_CLOCK_TICKS_PER_SEC default 1000 - -config INPUT - default y if KSCAN diff --git a/boards/nuvoton/npcx4m8f_evb/npcx4m8f_evb.dts b/boards/nuvoton/npcx4m8f_evb/npcx4m8f_evb.dts index 1d7166310a1..6c0e8cc23b4 100644 --- a/boards/nuvoton/npcx4m8f_evb/npcx4m8f_evb.dts +++ b/boards/nuvoton/npcx4m8f_evb/npcx4m8f_evb.dts @@ -18,7 +18,6 @@ zephyr,console = &uart1; zephyr,shell-uart = &uart1; zephyr,flash = &flash0; - zephyr,keyboard-scan = &kscan_input; }; aliases { @@ -28,7 +27,6 @@ i2c-0 = &i2c0_0; watchdog0 = &twd0; peci-0 = &peci0; - kscan0 = &kscan_input; }; leds-pwm { @@ -114,10 +112,6 @@ row-size = <8>; col-size = <13>; status = "okay"; - - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; }; &i3c0 { diff --git a/boards/nuvoton/npcx7m6fb_evb/Kconfig.defconfig b/boards/nuvoton/npcx7m6fb_evb/Kconfig.defconfig index 91a81edc353..82495946194 100644 --- a/boards/nuvoton/npcx7m6fb_evb/Kconfig.defconfig +++ b/boards/nuvoton/npcx7m6fb_evb/Kconfig.defconfig @@ -3,6 +3,3 @@ config SYS_CLOCK_TICKS_PER_SEC default 1000 - -config INPUT - default y if KSCAN diff --git a/boards/nuvoton/npcx7m6fb_evb/npcx7m6fb_evb.dts b/boards/nuvoton/npcx7m6fb_evb/npcx7m6fb_evb.dts index 1f57a26f417..3857262528f 100644 --- a/boards/nuvoton/npcx7m6fb_evb/npcx7m6fb_evb.dts +++ b/boards/nuvoton/npcx7m6fb_evb/npcx7m6fb_evb.dts @@ -17,7 +17,6 @@ zephyr,console = &uart1; zephyr,shell-uart = &uart1; zephyr,flash = &flash0; - zephyr,keyboard-scan = &kscan_input; }; aliases { @@ -29,8 +28,6 @@ i2c-0 = &i2c0_0; watchdog0 = &twd0; peci-0 = &peci0; - /* For kscan test suites */ - kscan0 = &kscan_input; }; pwmleds { @@ -118,8 +115,4 @@ row-size = <8>; col-size = <6>; status = "okay"; - - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; }; diff --git a/boards/nuvoton/npcx9m6f_evb/Kconfig.defconfig b/boards/nuvoton/npcx9m6f_evb/Kconfig.defconfig index 3004ce803d4..2114a4ad349 100644 --- a/boards/nuvoton/npcx9m6f_evb/Kconfig.defconfig +++ b/boards/nuvoton/npcx9m6f_evb/Kconfig.defconfig @@ -3,6 +3,3 @@ config SYS_CLOCK_TICKS_PER_SEC default 1000 - -config INPUT - default y if KSCAN diff --git a/boards/nuvoton/npcx9m6f_evb/npcx9m6f_evb.dts b/boards/nuvoton/npcx9m6f_evb/npcx9m6f_evb.dts index 4e6513756a7..08eaf3e3ee1 100644 --- a/boards/nuvoton/npcx9m6f_evb/npcx9m6f_evb.dts +++ b/boards/nuvoton/npcx9m6f_evb/npcx9m6f_evb.dts @@ -17,7 +17,6 @@ zephyr,console = &uart1; zephyr,shell-uart = &uart1; zephyr,flash = &flash0; - zephyr,keyboard-scan = &kscan_input; }; aliases { @@ -32,8 +31,6 @@ /* For watchdog sample */ watchdog0 = &twd0; peci-0 = &peci0; - /* For kscan test suites */ - kscan0 = &kscan_input; }; leds-pwm { @@ -137,8 +134,4 @@ row-size = <8>; col-size = <13>; status = "okay"; - - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; }; diff --git a/boards/pine64/pinetime_devkit0/pinetime_devkit0.yaml b/boards/pine64/pinetime_devkit0/pinetime_devkit0.yaml index c99eb8986f3..10bee1f3d6b 100644 --- a/boards/pine64/pinetime_devkit0/pinetime_devkit0.yaml +++ b/boards/pine64/pinetime_devkit0/pinetime_devkit0.yaml @@ -7,6 +7,4 @@ toolchain: - gnuarmemb ram: 64 flash: 512 -supported: - - kscan:touch vendor: pine64 diff --git a/boards/shields/rk055hdmipi4ma0/Kconfig.defconfig b/boards/shields/rk055hdmipi4ma0/Kconfig.defconfig index 938ebb3b070..27b6d9befc4 100644 --- a/boards/shields/rk055hdmipi4ma0/Kconfig.defconfig +++ b/boards/shields/rk055hdmipi4ma0/Kconfig.defconfig @@ -14,7 +14,7 @@ endif # DISPLAY if LVGL -# Configure LVGL to use touchscreen with KSCAN API +# Configure LVGL to use touchscreen config INPUT default y diff --git a/boards/st/stm32f769i_disco/stm32f769i_disco.yaml b/boards/st/stm32f769i_disco/stm32f769i_disco.yaml index 1f3c62f4c8d..db78a18bff6 100644 --- a/boards/st/stm32f769i_disco/stm32f769i_disco.yaml +++ b/boards/st/stm32f769i_disco/stm32f769i_disco.yaml @@ -16,5 +16,4 @@ supported: - arduino_gpio - netif:eth - memc - - kscan:touch vendor: st diff --git a/doc/_scripts/redirects.py b/doc/_scripts/redirects.py index 14bc2504a49..72ae07b5d54 100644 --- a/doc/_scripts/redirects.py +++ b/doc/_scripts/redirects.py @@ -193,7 +193,6 @@ REDIRECTS = [ ('reference/peripherals/i2c', 'hardware/peripherals/i2c'), ('reference/peripherals/index', 'hardware/peripherals/index'), ('reference/peripherals/ipm', 'hardware/peripherals/ipm'), - ('reference/peripherals/kscan', 'hardware/peripherals/kscan'), ('reference/peripherals/led', 'hardware/peripherals/led'), ('reference/peripherals/mbox', 'hardware/peripherals/mbox'), ('reference/peripherals/mdio', 'hardware/peripherals/mdio'), @@ -284,7 +283,6 @@ REDIRECTS = [ ('samples/boards/stm32/sensortile_box_pro/sensors-on-board/README', 'samples/boards/st/sensortile_box_pro/sensors-on-board/README'), ('samples/boards/stm32/steval_stwinbx1/sensors/README', 'samples/boards/st/steval_stwinbx1/sensors/README'), ('samples/drivers/adc/README', 'samples/drivers/adc/adc_dt/README'), - ('samples/drivers/kscan_touch', 'samples/subsys/input/input'), ('samples/drivers/led_apa102/README', 'samples/drivers/led_strip/README'), ('samples/drivers/led_is31fl3194/README', 'samples/drivers/led/is31fl3194/README'), ('samples/drivers/led_is31fl3216a/README', 'samples/drivers/led/is31fl3216a/README'), diff --git a/doc/hardware/peripherals/index.rst b/doc/hardware/peripherals/index.rst index 2a7405aced2..acb12942c23 100644 --- a/doc/hardware/peripherals/index.rst +++ b/doc/hardware/peripherals/index.rst @@ -38,7 +38,6 @@ Peripherals i3c.rst i2c.rst ipm.rst - kscan.rst led.rst mdio.rst mipi_dbi.rst diff --git a/doc/hardware/peripherals/kscan.rst b/doc/hardware/peripherals/kscan.rst deleted file mode 100644 index 1ac9e808f99..00000000000 --- a/doc/hardware/peripherals/kscan.rst +++ /dev/null @@ -1,35 +0,0 @@ -.. _kscan_api: - - -Keyboard Scan -############# - -.. note:: Kscan APIs are deprecated, any driver and applications should be - ported over to use :ref:`input` instead. - -Overview -******** - -The kscan driver (keyboard scan matrix) is used for detecting a key press in a -connected matrix keyboard or any device with buttons such as joysticks. -Typically, matrix keyboards are implemented using a two-dimensional -configuration in order to sense several keys. This allows interfacing to -many keys through fewer physical pins. Keyboard matrix -drivers read the rows while applying power through the columns one at a time -with the purpose of detecting key events. -There is no correlation between the physical and electrical layout of keys. -For, example, the physical layout may be one array of 16 or fewer keys, which -may be electrically connected to a 4 x 4 array. In addition, key values are -defined by a keymap provided by the keyboard manufacturer. - -Configuration Options -********************* - -Related configuration options: - -* :kconfig:option:`CONFIG_KSCAN` - -API Reference -************* - -.. doxygengroup:: kscan_interface diff --git a/doc/releases/release-notes-3.4.rst b/doc/releases/release-notes-3.4.rst index a8c3b6608e9..927850d8445 100644 --- a/doc/releases/release-notes-3.4.rst +++ b/doc/releases/release-notes-3.4.rst @@ -150,12 +150,12 @@ Changes in this release * ``gpio_keys``: moved out of ``gpio``, replaced the custom API to use input events instead, the :dtcompatible:`zephyr,gpio-keys` binding is unchanged but now requires ``zephyr,code`` to be set. - * ``ft5336``: moved from :ref:`kscan_api` to :ref:`input`, renamed the Kconfig + * ``ft5336``: moved from ``kscan_api`` to :ref:`input`, renamed the Kconfig options from ``CONFIG_KSCAN_FT5336``, ``CONFIG_KSCAN_FT5336_PERIOD`` and ``KSCAN_FT5336_INTERRUPT`` to :kconfig:option:`CONFIG_INPUT_FT5336`, :kconfig:option:`CONFIG_INPUT_FT5336_PERIOD` and :kconfig:option:`CONFIG_INPUT_FT5336_INTERRUPT`. - * ``kscan_sdl``: moved from :ref:`kscan_api` to :ref:`input`, renamed the Kconfig + * ``kscan_sdl``: moved from ``kscan_api`` to :ref:`input`, renamed the Kconfig option from ``KSCAN_SDL`` to :kconfig:option:`CONFIG_INPUT_SDL_TOUCH` and the compatible from ``zephyr,sdl-kscan`` to :dtcompatible:`zephyr,input-sdl-touch`. diff --git a/doc/releases/release-notes-4.0.rst b/doc/releases/release-notes-4.0.rst index 357d6c67ff7..4f205dcaf16 100644 --- a/doc/releases/release-notes-4.0.rst +++ b/doc/releases/release-notes-4.0.rst @@ -108,7 +108,7 @@ Deprecated in this release * Deprecated the ``net_buf_put()`` and ``net_buf_get()`` API functions in favor of :c:func:`k_fifo_put` and :c:func:`k_fifo_get`. -* The :ref:`kscan_api` subsystem has been marked as deprecated. +* The ``kscan_api`` subsystem has been marked as deprecated. * Deprecated the TinyCrypt shim driver ``CONFIG_CRYPTO_TINYCRYPT_SHIM``. diff --git a/doc/services/input/index.rst b/doc/services/input/index.rst index e2e28430185..1145b64a8e8 100644 --- a/doc/services/input/index.rst +++ b/doc/services/input/index.rst @@ -63,29 +63,6 @@ this purpose, the :c:func:`input_to_hid_code` and :c:func:`input_to_hid_modifier` functions can be used to map input codes to HID codes and modifiers. -Kscan Compatibility -******************* - -Input devices generating X/Y/Touch events can be used in existing applications -based on the :ref:`kscan_api` API by enabling both -:kconfig:option:`CONFIG_INPUT` and :kconfig:option:`CONFIG_KSCAN`, defining a -:dtcompatible:`zephyr,kscan-input` node as a child node of the corresponding -input device and pointing the ``zephyr,keyboard-scan`` chosen node to the -compatibility device node, for example: - -.. code-block:: devicetree - - chosen { - zephyr,keyboard-scan = &kscan_input; - }; - - ft5336@38 { - ... - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; - }; - General Purpose Drivers *********************** diff --git a/drivers/CMakeLists.txt b/drivers/CMakeLists.txt index a4975dbe249..50f64359a39 100644 --- a/drivers/CMakeLists.txt +++ b/drivers/CMakeLists.txt @@ -55,7 +55,6 @@ add_subdirectory_ifdef(CONFIG_IEEE802154 ieee802154) add_subdirectory_ifdef(CONFIG_INPUT input) add_subdirectory_ifdef(CONFIG_INTEL_ADSP_MIC_PRIVACY audio/mic_privacy/intel) add_subdirectory_ifdef(CONFIG_IPM ipm) -add_subdirectory_ifdef(CONFIG_KSCAN kscan) add_subdirectory_ifdef(CONFIG_LED led) add_subdirectory_ifdef(CONFIG_LED_STRIP led_strip) add_subdirectory_ifdef(CONFIG_LORA lora) diff --git a/drivers/Kconfig b/drivers/Kconfig index 4819d5059df..401220c4917 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -50,7 +50,6 @@ source "drivers/input/Kconfig" source "drivers/interrupt_controller/Kconfig" source "drivers/interrupt_controller/Kconfig.shared_irq" source "drivers/ipm/Kconfig" -source "drivers/kscan/Kconfig" source "drivers/led/Kconfig" source "drivers/led_strip/Kconfig" source "drivers/lora/Kconfig" diff --git a/drivers/kscan/CMakeLists.txt b/drivers/kscan/CMakeLists.txt deleted file mode 100644 index 1108cd61629..00000000000 --- a/drivers/kscan/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -zephyr_syscall_header(${ZEPHYR_BASE}/include/zephyr/drivers/kscan.h) - -zephyr_library() - -zephyr_library_sources_ifdef(CONFIG_KSCAN_INPUT kscan_input.c) - -zephyr_library_sources_ifdef(CONFIG_USERSPACE kscan_handlers.c) diff --git a/drivers/kscan/Kconfig b/drivers/kscan/Kconfig deleted file mode 100644 index 0ed9acc7e06..00000000000 --- a/drivers/kscan/Kconfig +++ /dev/null @@ -1,26 +0,0 @@ -# Keyboard scan configuration options - -# Copyright (c) 2019 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -menuconfig KSCAN - bool "Keyboard scan drivers [DEPRECATED]" - select DEPRECATED - help - Include Keyboard scan drivers in system config. - -if KSCAN - -source "drivers/kscan/Kconfig.input" - -module = KSCAN -module-str = kscan -source "subsys/logging/Kconfig.template.log_config" - -config KSCAN_INIT_PRIORITY - int "Keyboard scan driver init priority" - default 90 - help - Keyboard scan device driver initialization priority. - -endif # KSCAN diff --git a/drivers/kscan/Kconfig.input b/drivers/kscan/Kconfig.input deleted file mode 100644 index 85168a9a129..00000000000 --- a/drivers/kscan/Kconfig.input +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2023 Google LLC -# SPDX-License-Identifier: Apache-2.0 - -config KSCAN_INPUT - bool "Input subsystem to kscan adapter driver" - default y - depends on INPUT - depends on DT_HAS_ZEPHYR_KSCAN_INPUT_ENABLED diff --git a/drivers/kscan/kscan_handlers.c b/drivers/kscan/kscan_handlers.c deleted file mode 100644 index 81c97c19d04..00000000000 --- a/drivers/kscan/kscan_handlers.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2019 Intel Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -static inline int z_vrfy_kscan_config(const struct device *dev, - kscan_callback_t callback_isr) -{ - K_OOPS(K_SYSCALL_DRIVER_KSCAN(dev, config)); - K_OOPS(K_SYSCALL_VERIFY_MSG(callback_isr == 0, - "callback cannot be set from user mode")); - return z_impl_kscan_config((const struct device *)dev, callback_isr); -} -#include - -static inline int z_vrfy_kscan_disable_callback(const struct device *dev) -{ - K_OOPS(K_SYSCALL_DRIVER_KSCAN(dev, disable_callback)); - - return z_impl_kscan_disable_callback((const struct device *)dev); -} -#include - -static int z_vrfy_kscan_enable_callback(const struct device *dev) -{ - K_OOPS(K_SYSCALL_DRIVER_KSCAN(dev, enable_callback)); - - return z_impl_kscan_enable_callback((const struct device *)dev); -} -#include diff --git a/drivers/kscan/kscan_input.c b/drivers/kscan/kscan_input.c deleted file mode 100644 index 52c23f21ca3..00000000000 --- a/drivers/kscan/kscan_input.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * SPDX-License-Identifier: Apache-2.0 - */ -#define DT_DRV_COMPAT zephyr_kscan_input - -#include -#include - -#include -LOG_MODULE_REGISTER(kscan_input, CONFIG_KSCAN_LOG_LEVEL); - -struct kscan_input_config { - const struct device *input_dev; -}; - -struct kscan_input_data { - bool enabled; - kscan_callback_t callback; - int row; - int col; - bool pressed; -}; - -static void kscan_input_cb(struct input_event *evt, void *user_data) -{ - const struct device *dev = user_data; - struct kscan_input_data *data = dev->data; - - switch (evt->code) { - case INPUT_ABS_X: - data->col = evt->value; - break; - case INPUT_ABS_Y: - data->row = evt->value; - break; - case INPUT_BTN_TOUCH: - data->pressed = evt->value; - break; - } - - if (evt->sync) { - LOG_DBG("input event: %3d %3d %d", - data->row, data->col, data->pressed); - if (data->callback) { - data->callback(dev, data->row, data->col, data->pressed); - } - } -} - -static int kscan_input_configure(const struct device *dev, - kscan_callback_t callback) -{ - struct kscan_input_data *data = dev->data; - - if (!callback) { - LOG_ERR("Invalid callback (NULL)"); - return -EINVAL; - } - - data->callback = callback; - - return 0; -} - -static int kscan_input_enable_callback(const struct device *dev) -{ - struct kscan_input_data *data = dev->data; - - data->enabled = true; - - return 0; -} - -static int kscan_input_disable_callback(const struct device *dev) -{ - struct kscan_input_data *data = dev->data; - - data->enabled = false; - - return 0; -} - -static int kscan_input_init(const struct device *dev) -{ - const struct kscan_input_config *cfg = dev->config; - - if (!device_is_ready(cfg->input_dev)) { - LOG_ERR("Input device not ready"); - return -ENODEV; - } - - return 0; -} - -static DEVICE_API(kscan, kscan_input_driver_api) = { - .config = kscan_input_configure, - .enable_callback = kscan_input_enable_callback, - .disable_callback = kscan_input_disable_callback, -}; - -#define KSCAN_INPUT_INIT(index) \ - INPUT_CALLBACK_DEFINE_NAMED(DEVICE_DT_GET(DT_INST_PARENT(index)), \ - kscan_input_cb, \ - (void *)DEVICE_DT_INST_GET(index), \ - kscan_input_cb_##index); \ - static const struct kscan_input_config kscan_input_config_##index = { \ - .input_dev = DEVICE_DT_GET(DT_INST_PARENT(index)), \ - }; \ - static struct kscan_input_data kscan_input_data_##index; \ - DEVICE_DT_INST_DEFINE(index, kscan_input_init, NULL, \ - &kscan_input_data_##index, \ - &kscan_input_config_##index, \ - POST_KERNEL, CONFIG_KSCAN_INIT_PRIORITY, \ - &kscan_input_driver_api); - -DT_INST_FOREACH_STATUS_OKAY(KSCAN_INPUT_INIT) diff --git a/dts/bindings/binding-types.txt b/dts/bindings/binding-types.txt index 243ede00d6e..ee2b0c9f5cd 100644 --- a/dts/bindings/binding-types.txt +++ b/dts/bindings/binding-types.txt @@ -66,7 +66,6 @@ input Input interrupt-controller Interrupt controller ipc IPC (Inter-Processor Communication) ipm IPM (Inter-Processor Mailbox) -kscan Keyscan led LED (Light Emitting Diode) led_strip LED (Light Emitting Diode) strip lora LoRa diff --git a/dts/bindings/kscan/kscan.yaml b/dts/bindings/kscan/kscan.yaml deleted file mode 100644 index e30042d935e..00000000000 --- a/dts/bindings/kscan/kscan.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2019, Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -# Common properties for keyboard matrix devices - -include: base.yaml - -bus: kscan diff --git a/dts/bindings/kscan/zephyr,kscan-input.yaml b/dts/bindings/kscan/zephyr,kscan-input.yaml deleted file mode 100644 index b8880df6d00..00000000000 --- a/dts/bindings/kscan/zephyr,kscan-input.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2023 Google LLC -# SPDX-License-Identifier: Apache-2.0 - -description: | - Input to kscan adapter. - - Allows using an input device with the kscan API. Define as a child node of - the input device, for example - - chosen { - zephyr,keyboard-scan = &kscan_input; - }; - - ft5336@38 { - ... - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; - }; - -compatible: "zephyr,kscan-input" - -include: kscan.yaml diff --git a/include/zephyr/drivers/kscan.h b/include/zephyr/drivers/kscan.h deleted file mode 100644 index f12e2809062..00000000000 --- a/include/zephyr/drivers/kscan.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2019 Intel Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * @brief Public API for Keyboard scan matrix devices. - * The scope of this API is simply to report which key event was triggered - * and users can later decode keys using their desired scan code tables in - * their application. In addition, typematic rate and delay can easily be - * implemented using a timer if desired. - */ - -#ifndef ZEPHYR_INCLUDE_DRIVERS_KB_SCAN_H_ -#define ZEPHYR_INCLUDE_DRIVERS_KB_SCAN_H_ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief KSCAN APIs - * @defgroup kscan_interface Keyboard Scan Driver APIs - * @since 2.1 - * @version 1.0.0 - * @deprecated - * @ingroup io_interfaces - * @{ - */ - -/** - * @deprecated - * @brief Keyboard scan callback called when user press/release - * a key on a matrix keyboard. - * - * @param dev Pointer to the device structure for the driver instance. - * @param row Describes row change. - * @param column Describes column change. - * @param pressed Describes the kind of key event. - */ -typedef void (*kscan_callback_t)(const struct device *dev, uint32_t row, - uint32_t column, - bool pressed); - -/** - * @deprecated - * @cond INTERNAL_HIDDEN - * - * Keyboard scan driver API definition and system call entry points. - * - * (Internal use only.) - */ -typedef int (*kscan_config_t)(const struct device *dev, - kscan_callback_t callback); -typedef int (*kscan_disable_callback_t)(const struct device *dev); -typedef int (*kscan_enable_callback_t)(const struct device *dev); - -__subsystem struct kscan_driver_api { - kscan_config_t config; - kscan_disable_callback_t disable_callback; - kscan_enable_callback_t enable_callback; -}; -/** - * @endcond - */ - -/** - * @deprecated - * @brief Configure a Keyboard scan instance. - * - * @param dev Pointer to the device structure for the driver instance. - * @param callback called when keyboard devices reply to a keyboard - * event such as key pressed/released. - * - * @retval 0 If successful. - * @retval Negative errno code if failure. - */ -__syscall int kscan_config(const struct device *dev, - kscan_callback_t callback); - -static inline int z_impl_kscan_config(const struct device *dev, - kscan_callback_t callback) -{ - const struct kscan_driver_api *api = - (struct kscan_driver_api *)dev->api; - - return api->config(dev, callback); -} -/** - * @deprecated - * @brief Enables callback. - * @param dev Pointer to the device structure for the driver instance. - * - * @retval 0 If successful. - * @retval Negative errno code if failure. - */ -__syscall int kscan_enable_callback(const struct device *dev); - -static inline int z_impl_kscan_enable_callback(const struct device *dev) -{ - const struct kscan_driver_api *api = - (const struct kscan_driver_api *)dev->api; - - if (api->enable_callback == NULL) { - return -ENOSYS; - } - - return api->enable_callback(dev); -} - -/** - * @deprecated - * @brief Disables callback. - * @param dev Pointer to the device structure for the driver instance. - * - * @retval 0 If successful. - * @retval Negative errno code if failure. - */ -__syscall int kscan_disable_callback(const struct device *dev); - -static inline int z_impl_kscan_disable_callback(const struct device *dev) -{ - const struct kscan_driver_api *api = - (const struct kscan_driver_api *)dev->api; - - if (api->disable_callback == NULL) { - return -ENOSYS; - } - - return api->disable_callback(dev); -} - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#include - -#endif /* ZEPHYR_INCLUDE_DRIVERS_KB_SCAN_H_ */ diff --git a/samples/boards/microchip/mec15xxevb_assy6853/power_management/prj.conf b/samples/boards/microchip/mec15xxevb_assy6853/power_management/prj.conf index 5f4d0ced0e8..1db43e4d329 100644 --- a/samples/boards/microchip/mec15xxevb_assy6853/power_management/prj.conf +++ b/samples/boards/microchip/mec15xxevb_assy6853/power_management/prj.conf @@ -9,6 +9,5 @@ CONFIG_THREAD_NAME=y # Enable additional drivers to evaluate power consumption without activity CONFIG_PECI=y -CONFIG_KSCAN=y CONFIG_IDLE_STACK_SIZE=512 diff --git a/samples/drivers/ht16k33/README.rst b/samples/drivers/ht16k33/README.rst index a7e747f2f92..13ae3c68244 100644 --- a/samples/drivers/ht16k33/README.rst +++ b/samples/drivers/ht16k33/README.rst @@ -1,6 +1,6 @@ .. zephyr:code-sample:: ht16k33 :name: HT16K33 LED driver with keyscan - :relevant-api: led_interface kscan_interface + :relevant-api: led_interface input_interface Control up to 128 LEDs connected to an HT16K33 LED driver and log keyscan events. diff --git a/samples/drivers/ht16k33/boards/nrf52840dk_nrf52840.overlay b/samples/drivers/ht16k33/boards/nrf52840dk_nrf52840.overlay index 7f859fb1615..3fc5507ad25 100644 --- a/samples/drivers/ht16k33/boards/nrf52840dk_nrf52840.overlay +++ b/samples/drivers/ht16k33/boards/nrf52840dk_nrf52840.overlay @@ -12,9 +12,5 @@ reg = <0x70>; /* Uncomment to use IRQ instead of polling: */ /* irq-gpios = <&gpio1 8 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; */ - - kscan-input { - compatible = "zephyr,kscan-input"; - }; }; }; diff --git a/samples/drivers/ht16k33/prj.conf b/samples/drivers/ht16k33/prj.conf index fb580b93002..acfe5eba3ea 100644 --- a/samples/drivers/ht16k33/prj.conf +++ b/samples/drivers/ht16k33/prj.conf @@ -1,6 +1,6 @@ CONFIG_LOG=y CONFIG_I2C=y CONFIG_LED=y -CONFIG_KSCAN=y CONFIG_INPUT=y +CONFIG_INPUT_EVENT_DUMP=y CONFIG_HT16K33_KEYSCAN=y diff --git a/samples/drivers/ht16k33/src/main.c b/samples/drivers/ht16k33/src/main.c index 7ede8c6a0d3..e30c36122f9 100644 --- a/samples/drivers/ht16k33/src/main.c +++ b/samples/drivers/ht16k33/src/main.c @@ -5,7 +5,6 @@ */ #include -#include #include #include #include @@ -13,20 +12,10 @@ LOG_MODULE_REGISTER(main, CONFIG_LOG_DEFAULT_LEVEL); #define LED_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(holtek_ht16k33) -#define KEY_NODE DT_CHILD(LED_NODE, kscan_input) - -static void keyscan_callback(const struct device *dev, uint32_t row, - uint32_t column, bool pressed) -{ - LOG_INF("Row %d, column %d %s", row, column, - pressed ? "pressed" : "released"); -} int main(void) { const struct device *const led = DEVICE_DT_GET(LED_NODE); - const struct device *const key = DEVICE_DT_GET(KEY_NODE); - int err; int i; if (!device_is_ready(led)) { @@ -34,16 +23,6 @@ int main(void) return 0; } - if (!device_is_ready(key)) { - LOG_ERR("Keyscan device not ready"); - return 0; - } - - err = kscan_config(key, keyscan_callback); - if (err) { - LOG_ERR("Failed to add keyscan callback (err %d)", err); - } - while (1) { LOG_INF("Iterating through all LEDs, turning them on " "one-by-one"); diff --git a/samples/drivers/kscan/CMakeLists.txt b/samples/drivers/kscan/CMakeLists.txt deleted file mode 100644 index 1c5812ccffb..00000000000 --- a/samples/drivers/kscan/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(kscan) - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/samples/drivers/kscan/README.rst b/samples/drivers/kscan/README.rst deleted file mode 100644 index e2d2d129b6b..00000000000 --- a/samples/drivers/kscan/README.rst +++ /dev/null @@ -1,33 +0,0 @@ -.. zephyr:code-sample:: kscan - :name: KSCAN - :relevant-api: kscan_interface timer_apis - - Use the KSCAN API to read key presses and releases on a keyboard matrix. - -Overview -******** - -This sample demonstrates how to use the :ref:`KSCAN API `. -Callbacks are registered that will write to the console indicating KSCAN events. -These events indicate key presses and releases. - -Building and Running -******************** - -The sample can be built and executed on boards supporting a Keyboard Matrix. -It requires a correct fixture setup. Please connect a Keyboard Matrix to -exercise the functionality (you need to obtain the right keymap from the vendor -because they vary across different manufactures). -For the correct execution of that sample in twister, add into boards's -map-file next fixture settings:: - - - fixture: fixture_connect_keyboard - -Sample output -============= - -.. code-block:: console - - KSCAN test with a Keyboard matrix - Note: You are expected to see several callbacks - as you press and release keys! diff --git a/samples/drivers/kscan/boards/mec15xxevb_assy6853.conf b/samples/drivers/kscan/boards/mec15xxevb_assy6853.conf deleted file mode 100644 index 1eed72b67d5..00000000000 --- a/samples/drivers/kscan/boards/mec15xxevb_assy6853.conf +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_CONSOLE=y -CONFIG_LOG=y -CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=100 diff --git a/samples/drivers/kscan/prj.conf b/samples/drivers/kscan/prj.conf deleted file mode 100644 index e55038ab558..00000000000 --- a/samples/drivers/kscan/prj.conf +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_STDOUT_CONSOLE=y -CONFIG_PRINTK=y -CONFIG_KSCAN=y -CONFIG_LOG=y diff --git a/samples/drivers/kscan/sample.yaml b/samples/drivers/kscan/sample.yaml deleted file mode 100644 index 245a287a922..00000000000 --- a/samples/drivers/kscan/sample.yaml +++ /dev/null @@ -1,18 +0,0 @@ -sample: - name: KSCAN driver sample -tests: - sample.drivers.kscan: - tags: - - drivers - - kscan - harness: console - harness_config: - type: multi_line - ordered: true - regex: - - "kb data(.*)" - fixture: fixture_connect_keyboard - depends_on: kscan - filter: dt_chosen_enabled("zephyr,keyboard-scan") - integration_platforms: - - mec1501modular_assy6885 diff --git a/samples/drivers/kscan/src/main.c b/samples/drivers/kscan/src/main.c deleted file mode 100644 index 66fdd5727bb..00000000000 --- a/samples/drivers/kscan/src/main.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) 2019 Intel Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include - -#define LOG_LEVEL LOG_LEVEL_DBG -#include - -LOG_MODULE_REGISTER(main); - -const struct device *const kscan_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_keyboard_scan)); -static struct k_timer typematic_timer; -static struct k_timer block_matrix_timer; - -#define KEY_RSVD 0U -#define MAX_MATRIX_KEY_COLS 16 -#define MAX_MATRIX_KEY_ROWS 8 - -/****************************************************************************/ -/* Fujitsu keyboard model N860-7401-TOO1 */ -/* */ -/* Sense7 Sense6 Sense5 Sense4 Sense3 Sense2 Sense1 Sense0 */ -/*+---------------------------------------------------------------+ */ -/*| | Capslk| | 1! | Tab | F1 | `~ | | Scan 0 */ -/*| | (30) | | (2) | (16) | (112) | (1) | | (KEY #) */ -/*|-------+-------+-------+-------+-------+-------+-------+-------| */ -/*| | W | Q | F7 | | Esc | F6 | F5 | Scan 1 */ -/*| | (18) | (17) | (118) | | (110) | (117) | (116) | (KEY #) */ -/*|-------+-------+-------+-------+-------+-------+-------+-------| */ -/*| | F8 | | 2@ | F4 | F3 | | F2 | Scan 2 */ -/*| | (119) | | (3) | (115) | (114) | | (113) | (KEY #) */ -/*|-------+-------+-------+-------+-------+-------+-------+-------| */ -/*| | R | E | 3# | 4$ | C | F | V | Scan 3 */ -/*| | (20) | (19) | (4) | (5) | (48) | (34) | (49) | (KEY #) */ -/*|-------+-------+-------+-------+-------+-------+-------+-------| */ -/*| N | Y | 6^ | 5% | B | T | H | G | Scan 4 */ -/*| (51) | (22) | (7) | (6) | (50) | (21) | (36) | (35) | (KEY #) */ -/*|-------+-------+-------+-------+-------+-------+-------+-------| */ -/*| SpaceB| M | A | 7& | J | D | S | U | Scan 5 */ -/*| (61) | (52) | (31) | (8) | (37) | (33) | (32) | (23) | (KEY #) */ -/*|-------+-------+-------+-------+-------+-------+-------+-------| */ -/*| F9 | I | ,< | 8* | | Z | X | K | Scan 6 */ -/*| (120) | (24) | (53) | (9) | | (46) | (47) | (38) | (KEY #) */ -/*|-------+-------+-------+-------+-------+-------+-------+-------| */ -/*| | =+ | ]} | 9( | L | | CRSL | O | Scan 7 */ -/*| | (13) | (28) | (10) | (39) | | (79) | (25) | (KEY #) */ -/*|-------+-------+-------+-------+-------+-------+-------+-------| */ -/*| -_ | 0) | /? | [{ | ;: | | | '" | Scan 8 */ -/*| (12) | (11) | (55) | (27) | (40) | | | (41) | (KEY #) */ -/*|-------+-------+-------+-------+-------+-------+-------+-------| */ -/*| F10 | Pause | NumLK | P | | | | | Scan 9 */ -/*| (121) | (126) | (90) | (26) | | | | | (KEY #) */ -/*|-------+-------+-------+-------+-------+-------+-------+-------| */ -/*| BkSpac| \| | F11 | .> | | | W-Appl| CRSD | Scan 10 */ -/*| (15) | (29) | (122) | (54) | | | (71) | (84) | (KEY #) */ -/*|-------+-------+-------+-------+-------+-------+-------+-------| */ -/*| Enter | Delete| Insert| F12 | | | CRSU | CRSR | Scan 11 */ -/*| (43) | (76) | (75) | (123) | | | (83) | (89) | (KEY #) */ -/*|-------+-------+-------+-------+-------+-------+-------+-------| */ -/*| | R-WIN | | | | | L-WIN | Fn | Scan 12 */ -/*| | (87) | | | | | (59) | (255) | (KEY #) */ -/*|-------+-------+-------+-------+-------+-------+-------+-------| */ -/*| | | | RShift| LShift| | | | Scan 13 */ -/*| | | | (57) | (44) | | | | (KEY #) */ -/*|-------+-------+-------+-------+-------+-------+-------+-------| */ -/*| | | | | | | L Alt | R Alt | Scan 14 */ -/*| | | | | | | (60) | (62) | (KEY #) */ -/*|-------+-------+-------+-------+-------+-------+-------+-------| */ -/*| R Ctrl| | | | | L Ctrl| | | Scan 15 */ -/*| (64) | | | | | (58) | | | (KEY #) */ -/*+---------------------------------------------------------------+ */ -/* */ -/****************************************************************************/ - -static const uint8_t keymap[MAX_MATRIX_KEY_COLS][MAX_MATRIX_KEY_ROWS] = { - {KEY_RSVD, 1, 112, 16, 2, KEY_RSVD, 30, KEY_RSVD}, - {116, 117, 110, KEY_RSVD, 118, 17, 18, KEY_RSVD}, - {113, KEY_RSVD, 114, 115, 3, KEY_RSVD, 119, KEY_RSVD}, - {49, 34, 48, 5, 4, 19, 20, KEY_RSVD}, - {35, 36, 21, 50, 6, 7, 22, 51}, - {23, 32, 33, 37, 8, 31, 52, 61}, - {38, 47, 46, KEY_RSVD, 9, 53, 24, 120}, - {25, 79, KEY_RSVD, 39, 10, 28, 13, KEY_RSVD}, - {41, KEY_RSVD, KEY_RSVD, 40, 27, 55, 11, 12}, - {KEY_RSVD, KEY_RSVD, KEY_RSVD, KEY_RSVD, 26, 90, 126, 121}, - {84, 71, KEY_RSVD, KEY_RSVD, 54, 122, 29, 15}, - {89, 83, KEY_RSVD, KEY_RSVD, 123, 75, 76, 43}, - {255, 59, KEY_RSVD, KEY_RSVD, KEY_RSVD, KEY_RSVD, 87, KEY_RSVD}, - {KEY_RSVD, KEY_RSVD, 44, 57, KEY_RSVD, KEY_RSVD, KEY_RSVD}, - {62, 60, KEY_RSVD, KEY_RSVD, KEY_RSVD, KEY_RSVD, KEY_RSVD, KEY_RSVD}, - {KEY_RSVD, KEY_RSVD, 58, KEY_RSVD, KEY_RSVD, KEY_RSVD, KEY_RSVD, 64}, -}; - -/* Key used for typematic */ -static uint8_t last_key; - -/* Typematic rate and delay values correspond to the data passed after - * the F3 command (See the 8042 spec online) - */ -static const uint16_t period[] = { - 33U, 37U, 42U, 46U, 50U, 54U, 58U, 63U, - 67U, 75U, 83U, 92U, 100U, 109U, 116U, 125U, - 133U, 149U, 167U, 182U, 200U, 217U, 232U, 250U, - 270U, 303U, 333U, 370U, 400U, 435U, 470U, 500U -}; - -static const uint16_t delay[] = { 250U, 500U, 750U, 1000U }; - -static bool block_kb_matrix; - -static void typematic_callback(struct k_timer *timer) -{ - LOG_INF("Typematic : %u\n", last_key); -} - -static void kb_callback(const struct device *dev, uint32_t row, uint32_t col, - bool pressed) -{ - ARG_UNUSED(dev); - last_key = keymap[col][row]; - - LOG_INF("Key code = %u Pressed = %u\n", last_key, pressed); - - if (pressed) { - k_timer_start(&typematic_timer, - K_MSEC(delay[0]), K_MSEC(period[0])); - } else { - k_timer_stop(&typematic_timer); - } -} - -static void block_matrix_callback(struct k_timer *timer) -{ - LOG_DBG("block host : %d\n", block_kb_matrix); - if (block_kb_matrix) { - kscan_disable_callback(kscan_dev); - block_kb_matrix = false; - k_timer_stop(&typematic_timer); - } else { - kscan_enable_callback(kscan_dev); - block_kb_matrix = true; - } -} - -int main(void) -{ - printk("Kscan matrix sample application\n"); - - if (!device_is_ready(kscan_dev)) { - LOG_ERR("kscan device %s not ready", kscan_dev->name); - return 0; - } - - kscan_config(kscan_dev, kb_callback); - k_timer_init(&typematic_timer, typematic_callback, NULL); - k_timer_init(&block_matrix_timer, block_matrix_callback, NULL); - k_timer_start(&block_matrix_timer, K_SECONDS(1), K_SECONDS(3)); - - return 0; -} diff --git a/soc/microchip/mec/mec172x/device_power.c b/soc/microchip/mec/mec172x/device_power.c index eab5bfb0419..d6a627efdc6 100644 --- a/soc/microchip/mec/mec172x/device_power.c +++ b/soc/microchip/mec/mec172x/device_power.c @@ -92,10 +92,10 @@ void soc_deep_sleep_non_wake_dis(void) /* When MEC172x drivers are power-aware this should be move there */ void soc_deep_sleep_wake_en(void) { -#if defined(CONFIG_KSCAN) || \ +#if defined(INPUT_XEC_KBD) || \ (!defined(CONFIG_PM_DEVICE) && DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(ps2_0))) struct ecia_named_regs *regs = ECIA_XEC_REG_BASE; -#if defined(CONFIG_KSCAN) +#if defined(INPUT_XEC_KBD) /* Enable PLL wake via KSCAN */ regs->GIRQ21.SRC = MCHP_KEYSCAN_GIRQ_BIT; regs->GIRQ21.EN_SET = MCHP_KEYSCAN_GIRQ_BIT; diff --git a/tests/drivers/build_all/input/it82xx2_evb.overlay b/tests/drivers/build_all/input/it82xx2_evb.overlay index f7e4329b310..7dee5a7df23 100644 --- a/tests/drivers/build_all/input/it82xx2_evb.overlay +++ b/tests/drivers/build_all/input/it82xx2_evb.overlay @@ -25,8 +25,4 @@ kso-mapping = <0 1 20 3 4 5 6 17 18 16 15 11 12>; row-size = <8>; col-size = <13>; - - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; }; diff --git a/tests/drivers/kscan/kscan_api/CMakeLists.txt b/tests/drivers/kscan/kscan_api/CMakeLists.txt deleted file mode 100644 index 385203698cf..00000000000 --- a/tests/drivers/kscan/kscan_api/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(kscan_api) - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/tests/drivers/kscan/kscan_api/mec15xxevb_assy6853.conf b/tests/drivers/kscan/kscan_api/mec15xxevb_assy6853.conf deleted file mode 100644 index ded66973827..00000000000 --- a/tests/drivers/kscan/kscan_api/mec15xxevb_assy6853.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_KSCAN=y -CONFIG_ZTEST=y diff --git a/tests/drivers/kscan/kscan_api/prj.conf b/tests/drivers/kscan/kscan_api/prj.conf deleted file mode 100644 index f291b8d5b75..00000000000 --- a/tests/drivers/kscan/kscan_api/prj.conf +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_KSCAN=y -CONFIG_TEST_USERSPACE=y -CONFIG_ZTEST=y diff --git a/tests/drivers/kscan/kscan_api/src/main.c b/tests/drivers/kscan/kscan_api/src/main.c deleted file mode 100644 index 5dc79c6f05b..00000000000 --- a/tests/drivers/kscan/kscan_api/src/main.c +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright (c) 2019 Intel Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - - -#include - -ZTEST_SUITE(kscan_basic, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/drivers/kscan/kscan_api/src/test_kscan.c b/tests/drivers/kscan/kscan_api/src/test_kscan.c deleted file mode 100644 index 624255789e7..00000000000 --- a/tests/drivers/kscan/kscan_api/src/test_kscan.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2019 Intel Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include - -static void kb_callback(const struct device *dev, uint32_t row, uint32_t col, - bool pressed) -{ - ARG_UNUSED(dev); - ARG_UNUSED(row); - ARG_UNUSED(col); - ARG_UNUSED(pressed); -} - -static int test_kb_callback(void) -{ - const struct device *const kscan_dev = DEVICE_DT_GET(DT_ALIAS(kscan0)); - - if (!device_is_ready(kscan_dev)) { - TC_PRINT("KBSCAN device is not ready\n"); - return TC_FAIL; - } - - if (kscan_config(kscan_dev, kb_callback) != 0) { - TC_PRINT("Unexpected error code received\n"); - return TC_FAIL; - } - - return TC_PASS; -} - -static int test_null_callback(void) -{ - const struct device *const kscan_dev = DEVICE_DT_GET(DT_ALIAS(kscan0)); - - if (!device_is_ready(kscan_dev)) { - TC_PRINT("KBSCAN device is not ready\n"); - return TC_FAIL; - } - - if (kscan_config(kscan_dev, NULL) != -EINVAL) { - TC_PRINT("Unexpected error code received\n"); - return TC_FAIL; - } - - return TC_PASS; -} - -static int test_disable_enable_callback(void) -{ - const struct device *const kscan_dev = DEVICE_DT_GET(DT_ALIAS(kscan0)); - - if (!device_is_ready(kscan_dev)) { - TC_PRINT("KBSCAN device is not ready\n"); - return TC_FAIL; - } - - if (kscan_config(kscan_dev, kb_callback) != 0) { - TC_PRINT("Unexpected error code received\n"); - return TC_FAIL; - } - - if (kscan_disable_callback(kscan_dev) != 0) { - TC_PRINT("Error while disabling callback\n"); - return TC_FAIL; - } - - if (kscan_enable_callback(kscan_dev) != 0) { - TC_PRINT("Error while enabling callback\n"); - return TC_FAIL; - } - - return TC_PASS; -} - -ZTEST(kscan_basic, test_init_callback) -{ - /* Configure kscan matrix with an appropriate callback */ - zassert_true(test_kb_callback() == TC_PASS); - k_sleep(K_MSEC(1000)); - - /* Configure kscan with a null callback */ - zassert_true(test_null_callback() == TC_PASS); -} - -ZTEST(kscan_basic, test_control_callback) -{ - /* Disable/enable notifications to user */ - zassert_true(test_disable_enable_callback() == TC_PASS); - k_sleep(K_MSEC(1000)); -} diff --git a/tests/drivers/kscan/kscan_api/testcase.yaml b/tests/drivers/kscan/kscan_api/testcase.yaml deleted file mode 100644 index 2f37671d4c2..00000000000 --- a/tests/drivers/kscan/kscan_api/testcase.yaml +++ /dev/null @@ -1,16 +0,0 @@ -tests: - drivers.kscan: - tags: - - drivers - - kscan - - userspace - depends_on: kscan - platform_exclude: mec15xxevb_assy6853 - filter: dt_alias_exists("kscan0") - drivers.kscan.mec15xxevb_assy6853: - depends_on: kscan - tags: - - drivers - - kscan - extra_args: CONF_FILE="mec15xxevb_assy6853.conf" - platform_allow: mec15xxevb_assy6853 diff --git a/tests/drivers/kscan/kscan_input/CMakeLists.txt b/tests/drivers/kscan/kscan_input/CMakeLists.txt deleted file mode 100644 index d67acd5a2f4..00000000000 --- a/tests/drivers/kscan/kscan_input/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) - -project(kscan_input) - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/tests/drivers/kscan/kscan_input/boards/native_sim.overlay b/tests/drivers/kscan/kscan_input/boards/native_sim.overlay deleted file mode 100644 index 4e36164ab63..00000000000 --- a/tests/drivers/kscan/kscan_input/boards/native_sim.overlay +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - /delete-node/ input_sdl_touch; - - fake_input_device: fake-device { - compatible = "vnd,input-device"; - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; - }; -}; diff --git a/tests/drivers/kscan/kscan_input/boards/native_sim_native_64.overlay b/tests/drivers/kscan/kscan_input/boards/native_sim_native_64.overlay deleted file mode 100644 index 91647f82e20..00000000000 --- a/tests/drivers/kscan/kscan_input/boards/native_sim_native_64.overlay +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include "native_sim.overlay" diff --git a/tests/drivers/kscan/kscan_input/prj.conf b/tests/drivers/kscan/kscan_input/prj.conf deleted file mode 100644 index 79104173119..00000000000 --- a/tests/drivers/kscan/kscan_input/prj.conf +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_ZTEST=y -CONFIG_KSCAN=y -CONFIG_INPUT=y -CONFIG_INPUT_MODE_SYNCHRONOUS=y diff --git a/tests/drivers/kscan/kscan_input/src/main.c b/tests/drivers/kscan/kscan_input/src/main.c deleted file mode 100644 index b7c8c404bfe..00000000000 --- a/tests/drivers/kscan/kscan_input/src/main.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include - -static const struct device *kscan_dev = DEVICE_DT_GET( - DT_NODELABEL(kscan_input)); -static const struct device *input_dev = DEVICE_DT_GET( - DT_NODELABEL(fake_input_device)); - -DEVICE_DT_DEFINE(DT_INST(0, vnd_input_device), NULL, NULL, NULL, NULL, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, NULL); - -static struct { - uint32_t row; - uint32_t col; - bool pressed; -} last_cb_val; -static int callback_calls_count; - -static void kscan_callback(const struct device *dev, uint32_t row, uint32_t col, - bool pressed) -{ - TC_PRINT("row = %u col = %u %d\n", row, col, pressed); - - callback_calls_count++; - last_cb_val.row = row; - last_cb_val.col = col; - last_cb_val.pressed = pressed; -} - -ZTEST(kscan_input, test_kscan_input) -{ - kscan_config(kscan_dev, kscan_callback); - kscan_enable_callback(kscan_dev); - - input_report_abs(input_dev, INPUT_ABS_X, 101, false, K_FOREVER); - zassert_equal(callback_calls_count, 0); - - input_report_abs(input_dev, INPUT_ABS_Y, 102, false, K_FOREVER); - zassert_equal(callback_calls_count, 0); - - input_report_key(input_dev, INPUT_BTN_TOUCH, 1, true, K_FOREVER); - zassert_equal(callback_calls_count, 1); - zassert_equal(last_cb_val.col, 101); - zassert_equal(last_cb_val.row, 102); - zassert_equal(last_cb_val.pressed, true); - - input_report_abs(input_dev, INPUT_ABS_X, 103, true, K_FOREVER); - zassert_equal(callback_calls_count, 2); - zassert_equal(last_cb_val.col, 103); - zassert_equal(last_cb_val.row, 102); - zassert_equal(last_cb_val.pressed, true); - - input_report_key(input_dev, INPUT_BTN_TOUCH, 0, true, K_FOREVER); - zassert_equal(callback_calls_count, 3); - zassert_equal(last_cb_val.col, 103); - zassert_equal(last_cb_val.row, 102); - zassert_equal(last_cb_val.pressed, false); -} - -ZTEST_SUITE(kscan_input, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/drivers/kscan/kscan_input/testcase.yaml b/tests/drivers/kscan/kscan_input/testcase.yaml deleted file mode 100644 index 82f2c1df2d9..00000000000 --- a/tests/drivers/kscan/kscan_input/testcase.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -tests: - drivers.input.kscan_input: - platform_allow: - - native_sim - - native_sim/native/64 - tags: - - drivers - - kscan - - input - integration_platforms: - - native_sim diff --git a/tests/lib/cpp/cxx/src/main.cpp b/tests/lib/cpp/cxx/src/main.cpp index d2704e0d992..71e1c1e3ab7 100644 --- a/tests/lib/cpp/cxx/src/main.cpp +++ b/tests/lib/cpp/cxx/src/main.cpp @@ -50,7 +50,6 @@ #include #include #include -#include #include #include #include