From 5808018b05f9ffd055e70e8a0b615857d413ee67 Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Thu, 25 Jan 2024 15:55:14 -0600 Subject: [PATCH] drivers: i2s: i2s_mcux_flexcomm: Guard use of I2S_EnableSecondaryChannel Guard use of I2S_EnableSecondaryChannel behind the SDK feature macro that determines if this support is available, since when this macro is not defined the SDK function is not implemented. Fixes #68136 Signed-off-by: Daniel DeGrasse --- drivers/i2s/i2s_mcux_flexcomm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/i2s/i2s_mcux_flexcomm.c b/drivers/i2s/i2s_mcux_flexcomm.c index ab61097c02..6e966edd4a 100644 --- a/drivers/i2s/i2s_mcux_flexcomm.c +++ b/drivers/i2s/i2s_mcux_flexcomm.c @@ -264,6 +264,8 @@ static int i2s_mcux_configure(const struct device *dev, enum i2s_dir dir, * More than 2 channels are enabled, so we need to enable * secondary channel pairs. */ +#if (defined(FSL_FEATURE_I2S_SUPPORT_SECONDARY_CHANNEL) && \ + FSL_FEATURE_I2S_SUPPORT_SECONDARY_CHANNEL) for (uint32_t slot = 1; slot < i2s_cfg->channels / 2; slot++) { /* Position must be set so that data does not overlap * with previous channel pair. Each channel pair @@ -272,6 +274,10 @@ static int i2s_mcux_configure(const struct device *dev, enum i2s_dir dir, I2S_EnableSecondaryChannel(cfg->base, slot - 1, false, i2s_cfg->word_size * 2 * slot); } +#else + /* No support */ + return -ENOTSUP; +#endif } /*