From 7a54aed0159573812d52394ddb3bd50501bb03d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Fri, 5 May 2023 09:44:25 +0200 Subject: [PATCH] modules: hal_nordic: nrfx: Handle properly I2S0 instance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Although existing nRF SoCs have only one I2S instance, the nrfx_i2s driver has now multi-instance API and the related nrfx configuration symbols need to be used appropriately. Signed-off-by: Andrzej Głąbek --- drivers/i2s/Kconfig.nrfx | 2 +- modules/hal_nordic/nrfx/Kconfig | 8 ++++++-- modules/hal_nordic/nrfx/nrfx_config.h | 3 +++ soc/arm/nordic_nrf/Kconfig.peripherals | 4 ++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/i2s/Kconfig.nrfx b/drivers/i2s/Kconfig.nrfx index 00747b84108..404f78a15bf 100644 --- a/drivers/i2s/Kconfig.nrfx +++ b/drivers/i2s/Kconfig.nrfx @@ -5,7 +5,7 @@ menuconfig I2S_NRFX bool "nRF I2S nrfx driver" default y depends on DT_HAS_NORDIC_NRF_I2S_ENABLED - select NRFX_I2S + select NRFX_I2S0 if HAS_HW_NRF_I2S0 help Enable support for nrfx I2S driver for nRF MCU series. diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 0372aeb1045..e8f39cd3db3 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -73,8 +73,12 @@ config NRFX_GPIOTE_NUM_OF_EVT_HANDLERS by the user. config NRFX_I2S - bool "I2S driver" - depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_I2S)) + bool + +config NRFX_I2S0 + bool "I2S0 driver instance" + depends on $(dt_nodelabel_has_compat,i2s0,$(DT_COMPAT_NORDIC_NRF_I2S)) + select NRFX_I2S config NRFX_IPC bool "IPC driver" diff --git a/modules/hal_nordic/nrfx/nrfx_config.h b/modules/hal_nordic/nrfx/nrfx_config.h index 7c9d39cd8d0..daf73e9fdd0 100644 --- a/modules/hal_nordic/nrfx/nrfx_config.h +++ b/modules/hal_nordic/nrfx/nrfx_config.h @@ -111,6 +111,9 @@ #ifdef CONFIG_NRFX_I2S #define NRFX_I2S_ENABLED 1 #endif +#ifdef CONFIG_NRFX_I2S0 +#define NRFX_I2S0_ENABLED 1 +#endif #ifdef CONFIG_NRFX_IPC #define NRFX_IPC_ENABLED 1 diff --git a/soc/arm/nordic_nrf/Kconfig.peripherals b/soc/arm/nordic_nrf/Kconfig.peripherals index de3da1f9b7d..e81d195b2a0 100644 --- a/soc/arm/nordic_nrf/Kconfig.peripherals +++ b/soc/arm/nordic_nrf/Kconfig.peripherals @@ -69,8 +69,8 @@ config HAS_HW_NRF_GPIO1 config HAS_HW_NRF_GPIOTE def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIOTE)) -config HAS_HW_NRF_I2S - def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_I2S)) +config HAS_HW_NRF_I2S0 + def_bool $(dt_nodelabel_enabled_with_compat,i2s0,$(DT_COMPAT_NORDIC_NRF_I2S)) config HAS_HW_NRF_IPC def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_IPC))