Misc zephyr native drivers fixes
Here's a more runtime version of dai_get_zephyr_driver:
#define GET_DEVICE_LIST(node) DEVICE_DT_GET(node),
const struct device * z_dev[] = {
DT_FOREACH_STATUS_OKAY(intel_ssp_dai, GET_DEVICE_LIST)
DT_FOREACH_STATUS_OKAY(intel_dmic, GET_DEVICE_LIST)
DT_FOREACH_STATUS_OKAY(intel_alh_dai, GET_DEVICE_LIST)
};
const struct device *dai_get_zephyr_driver(uint32_t type, uint32_t index)
{
int i;
for (i = 0; i < ARRAY_SIZE(z_dev); i++) {
const struct dai_config *cfg = dai_config_get(z_dev[i], DAI_DIR_BOTH);
if ((cfg->type == type) && (cfg->dai_index == index))
return z_dev[i];
}
return NULL;
}
Here's a more runtime version of
dai_get_zephyr_driver:#define GET_DEVICE_LIST(node) DEVICE_DT_GET(node), const struct device * z_dev[] = { DT_FOREACH_STATUS_OKAY(intel_ssp_dai, GET_DEVICE_LIST) DT_FOREACH_STATUS_OKAY(intel_dmic, GET_DEVICE_LIST) DT_FOREACH_STATUS_OKAY(intel_alh_dai, GET_DEVICE_LIST) }; const struct device *dai_get_zephyr_driver(uint32_t type, uint32_t index) { int i; for (i = 0; i < ARRAY_SIZE(z_dev); i++) { const struct dai_config *cfg = dai_config_get(z_dev[i], DAI_DIR_BOTH); if ((cfg->type == type) && (cfg->dai_index == index)) return z_dev[i]; } return NULL; }
yeah thanks looks better! probably need to combine the array initialization with kconfig ifdefs... anyway will test this.
so please hold with this one for a while, I got stuck with a regression in zephyr dai drivers: https://github.com/zephyrproject-rtos/zephyr/issues/49012, so can't post the new version without testing.
new version: depends on https://github.com/zephyrproject-rtos/zephyr/pull/49072
@juimonen pls ping when the Zephyr PR is merged and then we can merge this and update our west commit (after some validation).
SOFCI TEST
SOFCI TEST
This is apparently causing new build failure #6192