zephyr/drivers/i3c/i3c_test.c
Armando Visconti 0d9654670f drivers: i3c: add dummy driver for vnd,i3c
It is just used to be able to DEVICE_DT_GET() bus devices from
tests/drivers/build_all in an upcoming commit.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2023-11-13 16:08:46 +00:00

48 lines
1.1 KiB
C

/*
* Copyright (c) 2023 STMicroelectronics
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* This is not a real I3C driver. It is used to instantiate struct
* devices for the "vnd,i3c" devicetree compatible used in test code.
*/
#define DT_DRV_COMPAT vnd_i3c
#include <zephyr/drivers/i3c.h>
#include <zephyr/device.h>
#include <zephyr/kernel.h>
static int vnd_i3c_configure(const struct device *dev,
enum i3c_config_type type, void *config)
{
return -ENOTSUP;
}
static int vnd_i3c_config_get(const struct device *dev,
enum i3c_config_type type, void *config)
{
return -ENOTSUP;
}
static int vnd_i3c_recover_bus(const struct device *dev)
{
return -ENOTSUP;
}
static const struct i3c_driver_api vnd_i3c_api = {
.configure = vnd_i3c_configure,
.config_get = vnd_i3c_config_get,
.recover_bus = vnd_i3c_recover_bus,
};
#define VND_I3C_INIT(n) \
DEVICE_DT_INST_DEFINE(n, NULL, NULL, NULL, NULL, \
POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \
&vnd_i3c_api);
DT_INST_FOREACH_STATUS_OKAY(VND_I3C_INIT)