kscan: Introduce zephyr,keyboard-scan chosen prop
Introduce zephyr,keyboard-scan chosen node property to point to the node that implements the default KSCAN device. This is similar to the zephyr,display property. We switch over the samples to utilize the new property instead of kscan0 alias. Signed-off-by: Kumar Gala <galak@kernel.org>
This commit is contained in:
parent
01c4e02240
commit
5ac8fca9cb
14 changed files with 15 additions and 6 deletions
|
@ -18,6 +18,7 @@
|
|||
zephyr,sram = &sram0;
|
||||
zephyr,console = &uart1;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,keyboard-scan = &kscan0;
|
||||
};
|
||||
|
||||
aliases {
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
zephyr,sram = &sram0;
|
||||
zephyr,console = &uart2;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,keyboard-scan = &kscan0;
|
||||
};
|
||||
|
||||
aliases {
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
zephyr,flash = &s26ks512s0;
|
||||
zephyr,code-partition = &slot0_partition;
|
||||
zephyr,display = &lcdif;
|
||||
zephyr,keyboard-scan = &touch_controller;
|
||||
};
|
||||
|
||||
sdram0: memory@80000000 {
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
zephyr,shell-uart = &lpuart1;
|
||||
zephyr,canbus = &flexcan2;
|
||||
zephyr,display = &lcdif;
|
||||
zephyr,keyboard-scan = &touch_controller;
|
||||
};
|
||||
|
||||
sdram0: memory@80000000 {
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
zephyr,shell-uart = &lpuart1;
|
||||
zephyr,canbus = &flexcan2;
|
||||
zephyr,display = &lcdif;
|
||||
zephyr,keyboard-scan = &touch_controller;
|
||||
};
|
||||
|
||||
sdram0: memory@80000000 {
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
zephyr,flash = &flash0;
|
||||
zephyr,code-partition = &slot0_partition;
|
||||
zephyr,display = &st7789v;
|
||||
zephyr,keyboard-scan = &cst816s;
|
||||
};
|
||||
|
||||
aliases {
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
zephyr,dtcm = &dtcm;
|
||||
zephyr,flash-controller = &n25q128a1;
|
||||
zephyr,display = <dc;
|
||||
zephyr,keyboard-scan = &touch_controller;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
zephyr,dtcm = &dtcm;
|
||||
zephyr,flash-controller = &n25q128a1;
|
||||
zephyr,display = <dc;
|
||||
zephyr,keyboard-scan = &touch_controller;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
zephyr,flash = &flash0;
|
||||
zephyr,dtcm = &dtcm;
|
||||
zephyr,flash-controller = &mx25l51245g;
|
||||
zephyr,keyboard-scan = &touch_controller;
|
||||
};
|
||||
|
||||
sdram1: sdram@c0000000 {
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
zephyr,flash = &flash0;
|
||||
zephyr,display = <dc;
|
||||
zephyr,canbus = &can1;
|
||||
zephyr,keyboard-scan = &touch_controller;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
zephyr,ec-host-interface = &hcp;
|
||||
zephyr,display = &sdl_dc;
|
||||
zephyr,canbus = &can_loopback0;
|
||||
zephyr,keyboard-scan = &sdl_kscan;
|
||||
};
|
||||
|
||||
aliases {
|
||||
|
|
2
doc/build/dts/api/api.rst
vendored
2
doc/build/dts/api/api.rst
vendored
|
@ -400,6 +400,8 @@ device.
|
|||
- Sets UART device used by console driver
|
||||
* - zephyr,display
|
||||
- Sets the default display controller
|
||||
* - zephyr,keyboard-scan
|
||||
- Sets the default keyboard scan controller
|
||||
* - zephyr,dtcm
|
||||
- Data Tightly Coupled Memory node on some Arm SoCs
|
||||
* - zephyr,entropy
|
||||
|
|
|
@ -15,9 +15,7 @@
|
|||
|
||||
LOG_MODULE_REGISTER(main);
|
||||
|
||||
#define KSCAN_NODE DT_ALIAS(kscan0)
|
||||
|
||||
const struct device *kscan_dev = DEVICE_DT_GET(KSCAN_NODE);
|
||||
const struct device *kscan_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_keyboard_scan));
|
||||
static struct k_timer typematic_timer;
|
||||
static struct k_timer block_matrix_timer;
|
||||
|
||||
|
|
|
@ -15,9 +15,7 @@
|
|||
|
||||
LOG_MODULE_REGISTER(main);
|
||||
|
||||
#define TOUCH_CONTROLLER_NODE DT_ALIAS(kscan0)
|
||||
|
||||
const struct device *kscan_dev = DEVICE_DT_GET(TOUCH_CONTROLLER_NODE);
|
||||
const struct device *kscan_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_keyboard_scan));
|
||||
|
||||
static void k_callback(const struct device *dev, uint32_t row, uint32_t col,
|
||||
bool pressed)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue