kscan: sdl: Convert driver over to devicetree
Move kscan SDL driver to be based on devicetree. This is similar to how the display SDL driver works. Signed-off-by: Kumar Gala <galak@kernel.org>
This commit is contained in:
parent
9315aef26d
commit
01c4e02240
5 changed files with 18 additions and 11 deletions
|
@ -50,10 +50,6 @@ config UART_CONSOLE
|
||||||
|
|
||||||
endif # CONSOLE
|
endif # CONSOLE
|
||||||
|
|
||||||
config KSCAN_SDL
|
|
||||||
default y
|
|
||||||
depends on KSCAN
|
|
||||||
|
|
||||||
config FLASH_SIMULATOR
|
config FLASH_SIMULATOR
|
||||||
default y
|
default y
|
||||||
depends on FLASH
|
depends on FLASH
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
i2c-0 = &i2c0;
|
i2c-0 = &i2c0;
|
||||||
spi-0 = &spi0;
|
spi-0 = &spi0;
|
||||||
led0 = &led0;
|
led0 = &led0;
|
||||||
|
kscan0 = &sdl_kscan;
|
||||||
};
|
};
|
||||||
|
|
||||||
leds {
|
leds {
|
||||||
|
@ -181,6 +182,10 @@
|
||||||
width = <320>;
|
width = <320>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sdl_kscan: sdl_kscan {
|
||||||
|
compatible = "zephyr,sdl-kscan";
|
||||||
|
};
|
||||||
|
|
||||||
can_loopback0: can_loopback0 {
|
can_loopback0: can_loopback0 {
|
||||||
status = "disabled";
|
status = "disabled";
|
||||||
compatible = "zephyr,can-loopback";
|
compatible = "zephyr,can-loopback";
|
||||||
|
|
|
@ -3,12 +3,8 @@
|
||||||
|
|
||||||
config KSCAN_SDL
|
config KSCAN_SDL
|
||||||
bool "SDL event filter for touch panel emulation"
|
bool "SDL event filter for touch panel emulation"
|
||||||
|
default y
|
||||||
|
depends on DT_HAS_ZEPHYR_SDL_KSCAN_ENABLED
|
||||||
depends on HAS_SDL
|
depends on HAS_SDL
|
||||||
help
|
help
|
||||||
Enable driver for the SDL mouse event filter.
|
Enable driver for the SDL mouse event filter.
|
||||||
|
|
||||||
config SDL_POINTER_KSCAN_DEV_NAME
|
|
||||||
string "SDL kscan device name"
|
|
||||||
depends on KSCAN_SDL
|
|
||||||
default LV_Z_POINTER_KSCAN_DEV_NAME if LVGL
|
|
||||||
default "SDL_KSCAN"
|
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define DT_DRV_COMPAT zephyr_sdl_kscan
|
||||||
|
|
||||||
#include <zephyr/drivers/kscan.h>
|
#include <zephyr/drivers/kscan.h>
|
||||||
#include <zephyr/logging/log.h>
|
#include <zephyr/logging/log.h>
|
||||||
|
|
||||||
|
@ -106,7 +108,7 @@ static const struct kscan_driver_api sdl_driver_api = {
|
||||||
|
|
||||||
static struct sdl_data sdl_data;
|
static struct sdl_data sdl_data;
|
||||||
|
|
||||||
DEVICE_DEFINE(sdl, CONFIG_SDL_POINTER_KSCAN_DEV_NAME, sdl_init,
|
DEVICE_DT_INST_DEFINE(0, sdl_init,
|
||||||
NULL, &sdl_data, NULL,
|
NULL, &sdl_data, NULL,
|
||||||
POST_KERNEL, CONFIG_KSCAN_INIT_PRIORITY,
|
POST_KERNEL, CONFIG_KSCAN_INIT_PRIORITY,
|
||||||
&sdl_driver_api);
|
&sdl_driver_api);
|
||||||
|
|
8
dts/bindings/kscan/zephyr,sdl-kscan.yaml
Normal file
8
dts/bindings/kscan/zephyr,sdl-kscan.yaml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# Copyright (c) 2022 Kumar Gala <galak@kernel.org>
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
description: SDL based emulated keyboard matrix devices
|
||||||
|
|
||||||
|
compatible: "zephyr,sdl-kscan"
|
||||||
|
|
||||||
|
include: kscan.yaml
|
Loading…
Add table
Add a link
Reference in a new issue