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:
Kumar Gala 2022-08-11 14:55:20 -05:00 committed by Kumar Gala
commit 5ac8fca9cb
14 changed files with 15 additions and 6 deletions

View file

@ -18,6 +18,7 @@
zephyr,sram = &sram0;
zephyr,console = &uart1;
zephyr,flash = &flash0;
zephyr,keyboard-scan = &kscan0;
};
aliases {

View file

@ -17,6 +17,7 @@
zephyr,sram = &sram0;
zephyr,console = &uart2;
zephyr,flash = &flash0;
zephyr,keyboard-scan = &kscan0;
};
aliases {

View file

@ -33,6 +33,7 @@
zephyr,flash = &s26ks512s0;
zephyr,code-partition = &slot0_partition;
zephyr,display = &lcdif;
zephyr,keyboard-scan = &touch_controller;
};
sdram0: memory@80000000 {

View file

@ -32,6 +32,7 @@
zephyr,shell-uart = &lpuart1;
zephyr,canbus = &flexcan2;
zephyr,display = &lcdif;
zephyr,keyboard-scan = &touch_controller;
};
sdram0: memory@80000000 {

View file

@ -33,6 +33,7 @@
zephyr,shell-uart = &lpuart1;
zephyr,canbus = &flexcan2;
zephyr,display = &lcdif;
zephyr,keyboard-scan = &touch_controller;
};
sdram0: memory@80000000 {

View file

@ -25,6 +25,7 @@
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,display = &st7789v;
zephyr,keyboard-scan = &cst816s;
};
aliases {

View file

@ -21,6 +21,7 @@
zephyr,dtcm = &dtcm;
zephyr,flash-controller = &n25q128a1;
zephyr,display = &ltdc;
zephyr,keyboard-scan = &touch_controller;
};
leds {

View file

@ -22,6 +22,7 @@
zephyr,dtcm = &dtcm;
zephyr,flash-controller = &n25q128a1;
zephyr,display = &ltdc;
zephyr,keyboard-scan = &touch_controller;
};
leds {

View file

@ -20,6 +20,7 @@
zephyr,flash = &flash0;
zephyr,dtcm = &dtcm;
zephyr,flash-controller = &mx25l51245g;
zephyr,keyboard-scan = &touch_controller;
};
sdram1: sdram@c0000000 {

View file

@ -21,6 +21,7 @@
zephyr,flash = &flash0;
zephyr,display = &ltdc;
zephyr,canbus = &can1;
zephyr,keyboard-scan = &touch_controller;
};
leds {

View file

@ -23,6 +23,7 @@
zephyr,ec-host-interface = &hcp;
zephyr,display = &sdl_dc;
zephyr,canbus = &can_loopback0;
zephyr,keyboard-scan = &sdl_kscan;
};
aliases {

View file

@ -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

View file

@ -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;

View file

@ -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)