1 /*
2  * Copyright (c) 2024 TOKITA Hiroshi
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #define DT_DRV_COMPAT vnd_dac
8 
9 #include <zephyr/kernel.h>
10 #include <zephyr/drivers/dac.h>
11 
vnd_dac_channel_setup(const struct device * dev,const struct dac_channel_cfg * channel_cfg)12 int vnd_dac_channel_setup(const struct device *dev, const struct dac_channel_cfg *channel_cfg)
13 {
14 	ARG_UNUSED(dev);
15 	ARG_UNUSED(channel_cfg);
16 
17 	return -ENOTSUP;
18 }
19 
vnd_dac_write_value(const struct device * dev,uint8_t channel,uint32_t value)20 int vnd_dac_write_value(const struct device *dev, uint8_t channel, uint32_t value)
21 {
22 	ARG_UNUSED(dev);
23 	ARG_UNUSED(channel);
24 	ARG_UNUSED(value);
25 
26 	return -ENOTSUP;
27 }
28 
29 static DEVICE_API(dac, vnd_dac_driver_api) = {
30 	.channel_setup = vnd_dac_channel_setup,
31 	.write_value = vnd_dac_write_value,
32 };
33 
vnd_dac_init(const struct device * dev)34 static int vnd_dac_init(const struct device *dev)
35 {
36 	ARG_UNUSED(dev);
37 
38 	return 0;
39 }
40 
41 #define VND_DAC_INIT(index)                                                                        \
42 	DEVICE_DT_INST_DEFINE(index, &vnd_dac_init, NULL, NULL, NULL, POST_KERNEL,                 \
43 			      CONFIG_DAC_INIT_PRIORITY, &vnd_dac_driver_api);
44 
45 DT_INST_FOREACH_STATUS_OKAY(VND_DAC_INIT)
46