Skip to content

Commit edf2499

Browse files
franciscomunozandrewboie
authored andcommitted
drivers: kscan: Add syscall handler for Keyboard Matrix API
Introduction of syscall handlers for the Keyboard Scan Matrix API Signed-off-by: Francisco Munoz <[email protected]>
1 parent 8a12d40 commit edf2499

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

drivers/kscan/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Kconfig - Keyboard scan configuration options
1+
# Kconfig - Keyboard scan configuration options
22

33
#
44
# Copyright (c) 2019 Intel Corporation
@@ -7,7 +7,7 @@
77
#
88

99
menuconfig KSCAN
10-
bool "Keyboard scan Drivers"
10+
bool "Keyboard Scan Drivers"
1111
help
1212
Include Keyboard scan drivers in system config.
1313

drivers/kscan/kscan_handlers.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2019 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <drivers/kscan.h>
8+
#include <syscall_handler.h>
9+
10+
static inline int z_vrfy_kscan_config(struct device *dev,
11+
kscan_callback_t callback_isr)
12+
{
13+
Z_OOPS(Z_SYSCALL_DRIVER_KSCAN(dev, config));
14+
Z_OOPS(Z_SYSCALL_VERIFY_MSG(callback == 0,
15+
"callback cannot be set from user mode"));
16+
return z_impl_kscan_config((struct device *)dev, callback);
17+
}
18+
#include <syscalls/kscan_config_mrsh.c>
19+
20+
static inline int z_vrfy_kscan_disable_callback(struct device *dev);
21+
{
22+
return z_impl_kscan_disable_callback((struct device *)dev);
23+
}
24+
#include <syscalls/kscan_disable_callback_mrsh.c>
25+
26+
static int z_vrfy_kscan_enable_callback(struct device *dev);
27+
{
28+
return z_impl_kscan_enable_callback((struct device *)dev);
29+
}
30+
#include <syscalls/kscan_enable_callback_mrsh.c>

0 commit comments

Comments
 (0)