Skip to content

Commit 3ebae00

Browse files
ananglkartben
authored andcommitted
drivers: i2s_nrfx: Add missing <hal/nrf_clock.h> inclusion
This driver uses the NRF_CLOCK_HAS_HFCLKAUDIO symbol that is defined in <hal/nrf_clock.h>, so it should explicitly include that header, not count on this inclusion being done by some other header, like <zephyr/drivers/clock_control/nrf_clock_control.h>. Extend also the build assertion that checks if the audio clock can be used so that now it ensures that the above symbol is defined (to prevent the driver from silently discarding the audio clock configured as the clock source). Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
1 parent 60d3ac5 commit 3ebae00

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/i2s/i2s_nrfx.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <zephyr/drivers/pinctrl.h>
1111
#include <soc.h>
1212
#include <nrfx_i2s.h>
13+
#include <hal/nrf_clock.h>
1314

1415
#include <zephyr/logging/log.h>
1516
#include <zephyr/irq.h>
@@ -971,7 +972,8 @@ static DEVICE_API(i2s, i2s_nrf_drv_api) = {
971972
init_clock_manager(dev); \
972973
return 0; \
973974
} \
974-
BUILD_ASSERT(I2S_CLK_SRC(idx) != ACLK || NRF_I2S_HAS_CLKCONFIG, \
975+
BUILD_ASSERT(I2S_CLK_SRC(idx) != ACLK || \
976+
(NRF_I2S_HAS_CLKCONFIG && NRF_CLOCK_HAS_HFCLKAUDIO), \
975977
"Clock source ACLK is not available."); \
976978
BUILD_ASSERT(I2S_CLK_SRC(idx) != ACLK || \
977979
DT_NODE_HAS_PROP(DT_NODELABEL(clock), \

0 commit comments

Comments
 (0)