1 /*
2 * Copyright (c) 2023 STMicroelectronics
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 /*
8 * This is not a real I3C driver. It is used to instantiate struct
9 * devices for the "vnd,i3c" devicetree compatible used in test code.
10 */
11
12 #define DT_DRV_COMPAT vnd_i3c
13
14 #include <zephyr/drivers/i3c.h>
15 #include <zephyr/device.h>
16 #include <zephyr/kernel.h>
17
vnd_i3c_configure(const struct device * dev,enum i3c_config_type type,void * config)18 static int vnd_i3c_configure(const struct device *dev,
19 enum i3c_config_type type, void *config)
20 {
21 return -ENOTSUP;
22 }
23
vnd_i3c_config_get(const struct device * dev,enum i3c_config_type type,void * config)24 static int vnd_i3c_config_get(const struct device *dev,
25 enum i3c_config_type type, void *config)
26 {
27 return -ENOTSUP;
28 }
29
vnd_i3c_recover_bus(const struct device * dev)30 static int vnd_i3c_recover_bus(const struct device *dev)
31 {
32 return -ENOTSUP;
33 }
34
35 static const struct i3c_driver_api vnd_i3c_api = {
36 .configure = vnd_i3c_configure,
37 .config_get = vnd_i3c_config_get,
38 .recover_bus = vnd_i3c_recover_bus,
39 };
40
41 #define VND_I3C_INIT(n) \
42 DEVICE_DT_INST_DEFINE(n, NULL, NULL, NULL, NULL, \
43 POST_KERNEL, \
44 CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \
45 &vnd_i3c_api);
46
47 DT_INST_FOREACH_STATUS_OKAY(VND_I3C_INIT)
48