1 /*
2  * Copyright (c) 2020 Libre Solar Technologies GmbH
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/drivers/dac.h>
8 #include <zephyr/syscall_handler.h>
9 #include <zephyr/kernel.h>
10 
z_vrfy_dac_channel_setup(const struct device * dev,const struct dac_channel_cfg * user_channel_cfg)11 static inline int z_vrfy_dac_channel_setup(const struct device *dev,
12 					   const struct dac_channel_cfg *user_channel_cfg)
13 {
14 	struct dac_channel_cfg channel_cfg;
15 
16 	Z_OOPS(Z_SYSCALL_DRIVER_DAC(dev, channel_setup));
17 	Z_OOPS(z_user_from_copy(&channel_cfg,
18 				(struct dac_channel_cfg *)user_channel_cfg,
19 				sizeof(struct dac_channel_cfg)));
20 
21 	return z_impl_dac_channel_setup((const struct device *)dev,
22 					&channel_cfg);
23 }
24 #include <syscalls/dac_channel_setup_mrsh.c>
25 
z_vrfy_dac_write_value(const struct device * dev,uint8_t channel,uint32_t value)26 static inline int z_vrfy_dac_write_value(const struct device *dev,
27 					 uint8_t channel, uint32_t value)
28 {
29 	Z_OOPS(Z_SYSCALL_DRIVER_DAC(dev, write_value));
30 
31 	return z_impl_dac_write_value((const struct device *)dev, channel,
32 				      value);
33 }
34 #include <syscalls/dac_write_value_mrsh.c>
35