2019-10-01 06:05:42 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2019 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2022-05-06 16:25:46 +08:00
|
|
|
#include <zephyr/drivers/kscan.h>
|
|
|
|
#include <zephyr/syscall_handler.h>
|
2019-10-01 06:05:42 +08:00
|
|
|
|
2020-05-01 02:33:38 +08:00
|
|
|
static inline int z_vrfy_kscan_config(const struct device *dev,
|
2019-10-01 06:05:42 +08:00
|
|
|
kscan_callback_t callback_isr)
|
|
|
|
{
|
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_KSCAN(dev, config));
|
2020-03-29 01:01:12 +08:00
|
|
|
Z_OOPS(Z_SYSCALL_VERIFY_MSG(callback_isr == 0,
|
2019-10-01 06:05:42 +08:00
|
|
|
"callback cannot be set from user mode"));
|
2020-05-01 02:33:38 +08:00
|
|
|
return z_impl_kscan_config((const struct device *)dev, callback_isr);
|
2019-10-01 06:05:42 +08:00
|
|
|
}
|
|
|
|
#include <syscalls/kscan_config_mrsh.c>
|
|
|
|
|
2020-05-01 02:33:38 +08:00
|
|
|
static inline int z_vrfy_kscan_disable_callback(const struct device *dev)
|
2019-10-01 06:05:42 +08:00
|
|
|
{
|
2020-03-06 10:08:42 +08:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_KSCAN(dev, disable_callback));
|
|
|
|
|
2020-05-01 02:33:38 +08:00
|
|
|
return z_impl_kscan_disable_callback((const struct device *)dev);
|
2019-10-01 06:05:42 +08:00
|
|
|
}
|
|
|
|
#include <syscalls/kscan_disable_callback_mrsh.c>
|
|
|
|
|
2020-05-01 02:33:38 +08:00
|
|
|
static int z_vrfy_kscan_enable_callback(const struct device *dev)
|
2019-10-01 06:05:42 +08:00
|
|
|
{
|
2020-03-06 10:08:42 +08:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_KSCAN(dev, enable_callback));
|
|
|
|
|
2020-05-01 02:33:38 +08:00
|
|
|
return z_impl_kscan_enable_callback((const struct device *)dev);
|
2019-10-01 06:05:42 +08:00
|
|
|
}
|
|
|
|
#include <syscalls/kscan_enable_callback_mrsh.c>
|