1 /*
2  * Copyright (c) 2024 TOKITA Hiroshi
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #define DT_DRV_COMPAT vnd_i2s
8 
9 #include <zephyr/kernel.h>
10 #include <zephyr/drivers/i2s.h>
11 
vnd_i2s_configure(const struct device * dev,enum i2s_dir dir,const struct i2s_config * i2s_cfg)12 static int vnd_i2s_configure(const struct device *dev, enum i2s_dir dir,
13 			     const struct i2s_config *i2s_cfg)
14 {
15 	return -ENOTSUP;
16 }
17 
vnd_i2s_config_get(const struct device * dev,enum i2s_dir dir)18 static const struct i2s_config *vnd_i2s_config_get(const struct device *dev, enum i2s_dir dir)
19 {
20 	return NULL;
21 }
22 
vnd_i2s_trigger(const struct device * dev,enum i2s_dir dir,enum i2s_trigger_cmd cmd)23 static int vnd_i2s_trigger(const struct device *dev, enum i2s_dir dir, enum i2s_trigger_cmd cmd)
24 {
25 	return -ENOTSUP;
26 }
27 
vnd_i2s_read(const struct device * dev,void ** mem_block,size_t * size)28 static int vnd_i2s_read(const struct device *dev, void **mem_block, size_t *size)
29 {
30 	return -ENOTSUP;
31 }
32 
vnd_i2s_write(const struct device * dev,void * mem_block,size_t size)33 static int vnd_i2s_write(const struct device *dev, void *mem_block, size_t size)
34 {
35 	return -ENOTSUP;
36 }
37 
38 static DEVICE_API(i2s, vnd_i2s_driver_api) = {
39 	.configure = vnd_i2s_configure,
40 	.config_get = vnd_i2s_config_get,
41 	.trigger = vnd_i2s_trigger,
42 	.read = vnd_i2s_read,
43 	.write = vnd_i2s_write,
44 };
45 
vnd_i2s_init(const struct device * dev)46 static int vnd_i2s_init(const struct device *dev)
47 {
48 	return 0;
49 }
50 
51 #define VND_I2S_INIT(index)                                                                        \
52 	DEVICE_DT_INST_DEFINE(index, &vnd_i2s_init, NULL, NULL, NULL, POST_KERNEL,                 \
53 			      CONFIG_I2S_INIT_PRIORITY, &vnd_i2s_driver_api);
54 
55 DT_INST_FOREACH_STATUS_OKAY(VND_I2S_INIT)
56