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