/* 1. Declare an empty configuration structure */
struct tfa9882_config {
};
/* 2. Generate a configuration instance for each active node in DTS */
#define TFA9882_CONFIG_GEN(n) \
static const struct tfa9882_config tfa9882_config_##n = {};
DT_INST_FOREACH_STATUS_OKAY(TFA9882_CONFIG_GEN)
#define TFA9882_DEFINE(n) \
DEVICE_DT_INST_DEFINE(n, \
tfa9882_init, \
NULL, \
NULL, \
&tfa9882_config_##n, \
POST_KERNEL, \
CONFIG_AUDIO_CODEC_INIT_PRIORITY, \
&tfa9882_api);
DT_INST_FOREACH_STATUS_OKAY(TFA9882_DEFINE)
overlay-dts:
/ {
tx_audio_codec: tfa9882_codec {
compatible = "nxp,tfa9882";
status = "okay";
i2s-controller = <&sai2>;
};
};
/home/vovan/ZEPHYR_RTOS/zephyrsdk/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: app/libapp.a(main.c.obj): in function `main':
/home/vovan/ZEPHYR_RTOS/zephyrproject/zephyr/samples/drivers/i2s/echo_sgtl5000_tfa9882_resample/src/main.c:290: undefined reference to `__device_dts_ord_6'
collect2: error: ld returned 1 exit status