Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: kscan: add support for cst816s touch panel driver #41325

Merged
merged 1 commit into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions boards/arm/pinetime_devkit0/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ config ST7789V

endif # DISPLAY

config I2C
default y if KSCAN

endif # BOARD_PINETIME_DEVKIT0
3 changes: 2 additions & 1 deletion boards/arm/pinetime_devkit0/pinetime_devkit0.dts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
led2 = &blled2; /* backlight high */
led3 = &statusled; /* status led, may be not populated */
sw0 = &key_in; /* key in */
kscan0 = &cst816s;
};

leds {
Expand Down Expand Up @@ -108,7 +109,7 @@

/* Hynitron CST816S Capacitive Touch Controller (400KHz) */
cst816s: cst816s@15 {
compatible = "hynitron-cst816s";
compatible = "hynitron,cst816s";
reg = <0x15>;
label = "CST816S";
irq-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
Expand Down
2 changes: 2 additions & 0 deletions boards/arm/pinetime_devkit0/pinetime_devkit0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ toolchain:
- xtools
ram: 64
flash: 512
supported:
- kscan:touch
1 change: 1 addition & 0 deletions drivers/kscan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ zephyr_library_sources_ifdef(CONFIG_KSCAN_ITE_IT8XXX2 kscan_ite_it8xxx2.c)
zephyr_library_sources_ifdef(CONFIG_KSCAN_XEC kscan_mchp_xec.c)
zephyr_library_sources_ifdef(CONFIG_KSCAN_SDL kscan_sdl.c)
zephyr_library_sources_ifdef(CONFIG_KSCAN_HT16K33 kscan_ht16k33.c)
zephyr_library_sources_ifdef(CONFIG_KSCAN_CST816S kscan_cst816s.c)

zephyr_library_sources_ifdef(CONFIG_USERSPACE kscan_handlers.c)
1 change: 1 addition & 0 deletions drivers/kscan/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ source "drivers/kscan/Kconfig.it8xxx2"
source "drivers/kscan/Kconfig.xec"
source "drivers/kscan/Kconfig.sdl"
source "drivers/kscan/Kconfig.ht16k33"
source "drivers/kscan/Kconfig.cst816s"

module = KSCAN
module-str = kscan
Expand Down
29 changes: 29 additions & 0 deletions drivers/kscan/Kconfig.cst816s
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (c) 2020 Qingsong Gou <gouqs@hotmail.com>
# SPDX-License-Identifier: Apache-2.0

DT_COMPAT_HYNITRON_CST816S := hynitron,cst816s

menuconfig KSCAN_CST816S
bool "CST816S capacitive touch panel driver"
default $(dt_compat_enabled,$(DT_COMPAT_HYNITRON_CST816S))
depends on I2C
ck-telecom marked this conversation as resolved.
Show resolved Hide resolved
help
Enable driver for hynitron cst816s touch panel.

if KSCAN_CST816S

config KSCAN_CST816S_PERIOD
int "Sample period"
depends on !KSCAN_CST816S_INTERRUPT
default 20
help
Sample period in milliseconds when in polling mode.

config KSCAN_CST816S_INTERRUPT
bool "Enable interrupt support"
default y
depends on GPIO
help
Enable interrupt support (requires GPIO).

endif # KSCAN_CST816S
Loading