Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions drivers/adc/adc_nrfx_saadc.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,5 +709,7 @@ static DEVICE_API(adc, adc_nrfx_driver_api) = {
/* Validate configuration of all channels. */
DT_FOREACH_CHILD(DT_DRV_INST(0), VALIDATE_CHANNEL_CONFIG)

NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(0));

DEVICE_DT_INST_DEFINE(0, init_saadc, NULL, NULL, NULL, POST_KERNEL,
CONFIG_ADC_INIT_PRIORITY, &adc_nrfx_driver_api);
1 change: 1 addition & 0 deletions drivers/audio/dmic_nrfx_pdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@
.clk_src = PDM_CLK_SRC(idx), \
.mem_reg = DMM_DEV_TO_REG(PDM(idx)), \
}; \
NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(PDM(idx)); \
BUILD_ASSERT(PDM_CLK_SRC(idx) != ACLK || \
NRF_PDM_HAS_SELECTABLE_CLOCK, \
"Clock source ACLK is not available."); \
Expand All @@ -745,7 +746,7 @@
DEVICE_DT_DEFINE(PDM(idx), pdm_nrfx_init##idx, NULL, \
&dmic_nrfx_pdm_data##idx, &dmic_nrfx_pdm_cfg##idx, \
POST_KERNEL, CONFIG_AUDIO_DMIC_INIT_PRIORITY, \
&dmic_ops);

Check notice on line 749 in drivers/audio/dmic_nrfx_pdm.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/audio/dmic_nrfx_pdm.c:749 -#define PDM_NRFX_DEVICE(idx) \ - static void *rx_msgs##idx[DT_PROP(PDM(idx), queue_size)]; \ - static void *mem_slab_msgs##idx[DT_PROP(PDM(idx), queue_size)]; \ - static struct dmic_nrfx_pdm_drv_data dmic_nrfx_pdm_data##idx; \ - static const nrfx_pdm_t dmic_nrfx_pdm##idx = NRFX_PDM_INSTANCE(idx); \ - static int pdm_nrfx_init##idx(const struct device *dev) \ - { \ - IRQ_CONNECT(DT_IRQN(PDM(idx)), DT_IRQ(PDM(idx), priority), \ - nrfx_isr, nrfx_pdm_##idx##_irq_handler, 0); \ - const struct dmic_nrfx_pdm_drv_cfg *drv_cfg = dev->config; \ - int err = pinctrl_apply_state(drv_cfg->pcfg, \ - PINCTRL_STATE_DEFAULT); \ - if (err < 0) { \ - return err; \ - } \ - dmic_nrfx_pdm_data##idx.pdm = &dmic_nrfx_pdm##idx; \ - k_msgq_init(&dmic_nrfx_pdm_data##idx.rx_queue, \ - (char *)rx_msgs##idx, sizeof(void *), \ - ARRAY_SIZE(rx_msgs##idx)); \ - k_msgq_init(&dmic_nrfx_pdm_data##idx.mem_slab_queue, \ - (char *)mem_slab_msgs##idx, sizeof(void *), \ - ARRAY_SIZE(mem_slab_msgs##idx)); \ - init_clock_manager(dev); \ - return 0; \ - } \ - static void event_handler##idx(const nrfx_pdm_evt_t *evt) \ - { \ - event_handler(DEVICE_DT_GET(PDM(idx)), evt); \ - } \ - PINCTRL_DT_DEFINE(PDM(idx)); \ - static const struct dmic_nrfx_pdm_drv_cfg dmic_nrfx_pdm_cfg##idx = { \ - .event_handler = event_handler##idx, \ - .nrfx_def_cfg = NRFX_PDM_DEFAULT_CONFIG(0, 0), \ - .nrfx_def_cfg.skip_gpio_cfg = true, \ - .nrfx_def_cfg.skip_psel_cfg = true, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(PDM(idx)), \ - .clk_src = PDM_CLK_SRC(idx), \ - .mem_reg = DMM_DEV_TO_REG(PDM(idx)), \ - }; \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(PDM(idx)); \ - BUILD_ASSERT(PDM_CLK_SRC(idx) != ACLK || \ - NRF_PDM_HAS_SELECTABLE_CLOCK, \ - "Clock source ACLK is not available."); \ - BUILD_ASSERT(PDM_CLK_SRC(idx) != ACLK || \ - DT_NODE_HAS_PROP(DT_NODELABEL(clock), \ - hfclkaudio_frequency) || \ - DT_NODE_HAS_PROP(DT_NODELABEL(aclk), \ - clock_frequency) || \ - DT_NODE_HAS_PROP(DT_NODELABEL(audiopll), \ - frequency), \ - "Clock source ACLK requires the hfclkaudio-frequency " \ - "property to be defined in the nordic,nrf-clock node " \ - "or clock-frequency property to be defined in aclk node" \ - "or frequency property to be defined in audiopll node"); \ - DEVICE_DT_DEFINE(PDM(idx), pdm_nrfx_init##idx, NULL, \ - &dmic_nrfx_pdm_data##idx, &dmic_nrfx_pdm_cfg##idx, \ - POST_KERNEL, CONFIG_AUDIO_DMIC_INIT_PRIORITY, \ +#define PDM_NRFX_DEVICE(idx) \ + static void *rx_msgs##idx[DT_PROP(PDM(idx), queue_size)]; \ + static void *mem_slab_msgs##idx[DT_PROP(PDM(idx), queue_size)]; \ + static struct dmic_nrfx_pdm_drv_data dmic_nrfx_pdm_data##idx; \ + static const nrfx_pdm_t dmic_nrfx_pdm##idx = NRFX_PDM_INSTANCE(idx); \ + static int pdm_nrfx_init##idx(const struct device *dev) \ + { \ + IRQ_CONNECT(DT_IRQN(PDM(idx)), DT_IRQ(PDM(idx), priority), nrfx_isr, \ + nrfx_pdm_##idx##_irq_handler, 0); \ + const struct dmic_nrfx_pdm_drv_cfg *drv_cfg = dev->config; \ + int err = pinctrl_apply_state(drv_cfg->pcfg, PINCTRL_STATE_DEFAULT); \ + if (err < 0) { \ + return err;

Check notice on line 749 in drivers/audio/dmic_nrfx_pdm.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/audio/dmic_nrfx_pdm.c:749 -#define PDM_NRFX_DEVICE(idx) \ - static void *rx_msgs##idx[DT_PROP(PDM(idx), queue_size)]; \ - static void *mem_slab_msgs##idx[DT_PROP(PDM(idx), queue_size)]; \ - static struct dmic_nrfx_pdm_drv_data dmic_nrfx_pdm_data##idx; \ - static const nrfx_pdm_t dmic_nrfx_pdm##idx = NRFX_PDM_INSTANCE(idx); \ - static int pdm_nrfx_init##idx(const struct device *dev) \ - { \ - IRQ_CONNECT(DT_IRQN(PDM(idx)), DT_IRQ(PDM(idx), priority), \ - nrfx_isr, nrfx_pdm_##idx##_irq_handler, 0); \ - const struct dmic_nrfx_pdm_drv_cfg *drv_cfg = dev->config; \ - int err = pinctrl_apply_state(drv_cfg->pcfg, \ - PINCTRL_STATE_DEFAULT); \ - if (err < 0) { \ - return err; \ - } \ - dmic_nrfx_pdm_data##idx.pdm = &dmic_nrfx_pdm##idx; \ - k_msgq_init(&dmic_nrfx_pdm_data##idx.rx_queue, \ - (char *)rx_msgs##idx, sizeof(void *), \ - ARRAY_SIZE(rx_msgs##idx)); \ - k_msgq_init(&dmic_nrfx_pdm_data##idx.mem_slab_queue, \ - (char *)mem_slab_msgs##idx, sizeof(void *), \ - ARRAY_SIZE(mem_slab_msgs##idx)); \ - init_clock_manager(dev); \ - return 0; \ - } \ - static void event_handler##idx(const nrfx_pdm_evt_t *evt) \ - { \ - event_handler(DEVICE_DT_GET(PDM(idx)), evt); \ - } \ - PINCTRL_DT_DEFINE(PDM(idx)); \ - static const struct dmic_nrfx_pdm_drv_cfg dmic_nrfx_pdm_cfg##idx = { \ - .event_handler = event_handler##idx, \ - .nrfx_def_cfg = NRFX_PDM_DEFAULT_CONFIG(0, 0), \ - .nrfx_def_cfg.skip_gpio_cfg = true, \ - .nrfx_def_cfg.skip_psel_cfg = true, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(PDM(idx)), \ - .clk_src = PDM_CLK_SRC(idx), \ - .mem_reg = DMM_DEV_TO_REG(PDM(idx)), \ - }; \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(PDM(idx)); \ - BUILD_ASSERT(PDM_CLK_SRC(idx) != ACLK || \ - NRF_PDM_HAS_SELECTABLE_CLOCK, \ - "Clock source ACLK is not available."); \ - BUILD_ASSERT(PDM_CLK_SRC(idx) != ACLK || \ - DT_NODE_HAS_PROP(DT_NODELABEL(clock), \ - hfclkaudio_frequency) || \ - DT_NODE_HAS_PROP(DT_NODELABEL(aclk), \ - clock_frequency) || \ - DT_NODE_HAS_PROP(DT_NODELABEL(audiopll), \ - frequency), \ - "Clock source ACLK requires the hfclkaudio-frequency " \ - "property to be defined in the nordic,nrf-clock node " \ - "or clock-frequency property to be defined in aclk node" \ - "or frequency property to be defined in audiopll node"); \ - DEVICE_DT_DEFINE(PDM(idx), pdm_nrfx_init##idx, NULL, \ - &dmic_nrfx_pdm_data##idx, &dmic_nrfx_pdm_cfg##idx, \ - POST_KERNEL, CONFIG_AUDIO_DMIC_INIT_PRIORITY, \ +#define PDM_NRFX_DEVICE(idx) \ + static void *rx_msgs##idx[DT_PROP(PDM(idx), queue_size)]; \ + static void *mem_slab_msgs##idx[DT_PROP(PDM(idx), queue_size)]; \ + static struct dmic_nrfx_pdm_drv_data dmic_nrfx_pdm_data##idx; \ + static const nrfx_pdm_t dmic_nrfx_pdm##idx = NRFX_PDM_INSTANCE(idx); \ + static int pdm_nrfx_init##idx(const struct device *dev) \ + { \ + IRQ_CONNECT(DT_IRQN(PDM(idx)), DT_IRQ(PDM(idx), priority), nrfx_isr, \ + nrfx_pdm_##idx##_irq_handler, 0); \ + const struct dmic_nrfx_pdm_drv_cfg *drv_cfg = dev->config; \ + int err = pinctrl_apply_state(drv_cfg->pcfg, PINCTRL_STATE_DEFAULT); \ + if (err < 0) { \ + return err;

#ifdef CONFIG_HAS_HW_NRF_PDM0
PDM_NRFX_DEVICE(0);
Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/i2c_nrfx_twim.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@

#define I2C_NRFX_TWIM_DEVICE(idx) \
NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \
NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(I2C(idx)); \
BUILD_ASSERT(I2C_FREQUENCY(idx) != \
I2C_NRFX_TWIM_INVALID_FREQUENCY, \
"Wrong I2C " #idx " frequency setting in dts"); \
Expand Down Expand Up @@ -294,7 +295,7 @@
POST_KERNEL, \
CONFIG_I2C_INIT_PRIORITY, \
&i2c_nrfx_twim_driver_api)

Check notice on line 298 in drivers/i2c/i2c_nrfx_twim.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/i2c/i2c_nrfx_twim.c:298 -#define I2C_NRFX_TWIM_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(I2C(idx)); \ - BUILD_ASSERT(I2C_FREQUENCY(idx) != \ - I2C_NRFX_TWIM_INVALID_FREQUENCY, \ - "Wrong I2C " #idx " frequency setting in dts"); \ - static void irq_connect##idx(void) \ - { \ - IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), \ - nrfx_isr, nrfx_twim_##idx##_irq_handler, 0); \ - } \ +#define I2C_NRFX_TWIM_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(I2C(idx)); \ + BUILD_ASSERT(I2C_FREQUENCY(idx) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ + "Wrong I2C " #idx " frequency setting in dts"); \ + static void irq_connect##idx(void) \ + { \ + IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), nrfx_isr, \ + nrfx_twim_##idx##_irq_handler, 0); \ + } \ IF_ENABLED(USES_MSG_BUF(idx), \ (static uint8_t twim_##idx##_msg_buf[MSG_BUF_SIZE(idx)] \ - I2C_MEMORY_SECTION(idx);)) \ - static struct i2c_nrfx_twim_data twim_##idx##_data; \ - PINCTRL_DT_DEFINE(I2C(idx)); \ - static const \ - struct i2c_nrfx_twim_common_config twim_##idx##z_config = { \ - .twim = NRFX_TWIM_INSTANCE(idx), \ - .twim_config = { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(idx), \ - }, \ - .event_handler = event_handler, \ - .msg_buf_size = MSG_BUF_SIZE(idx), \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ + I2C_MEMORY_SECTION(idx);)) \ + static struct i2c_nrfx_twim_data twim_##idx##_data; \ + PINCTRL_DT_DEFINE(I2C(idx)); \ + static const struct i2c_nrfx_twim_common_config twim_##idx##z_config = { \ + .twim = NRFX_TWIM_INSTANCE(idx), \ + .twim_config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(idx), \ + }, \ + .event_handler = event_handler, \ + .msg_buf_size = MSG_BUF_SIZE(idx), \ + .irq_connect = irq_connect##idx, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ IF_ENABLED(USES_MSG_BUF(idx), \ - (.msg_buf = twim_##idx##_msg_buf,)) \ - .max_transfer_size = BIT_MASK( \ - DT_PROP(I2C(idx), easydma_maxcnt_bits)), \ - }; \ - PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, \ - PM_DEVICE_ISR_SAFE); \ - I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), \ - i2c_nrfx_twim_init, \ - i2c_nrfx_twim_deinit, \ - PM_DEV

Check notice on line 298 in drivers/i2c/i2c_nrfx_twim.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/i2c/i2c_nrfx_twim.c:298 -#define I2C_NRFX_TWIM_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(I2C(idx)); \ - BUILD_ASSERT(I2C_FREQUENCY(idx) != \ - I2C_NRFX_TWIM_INVALID_FREQUENCY, \ - "Wrong I2C " #idx " frequency setting in dts"); \ - static void irq_connect##idx(void) \ - { \ - IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), \ - nrfx_isr, nrfx_twim_##idx##_irq_handler, 0); \ - } \ +#define I2C_NRFX_TWIM_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(I2C(idx)); \ + BUILD_ASSERT(I2C_FREQUENCY(idx) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ + "Wrong I2C " #idx " frequency setting in dts"); \ + static void irq_connect##idx(void) \ + { \ + IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), nrfx_isr, \ + nrfx_twim_##idx##_irq_handler, 0); \ + } \ IF_ENABLED(USES_MSG_BUF(idx), \ (static uint8_t twim_##idx##_msg_buf[MSG_BUF_SIZE(idx)] \ - I2C_MEMORY_SECTION(idx);)) \ - static struct i2c_nrfx_twim_data twim_##idx##_data; \ - PINCTRL_DT_DEFINE(I2C(idx)); \ - static const \ - struct i2c_nrfx_twim_common_config twim_##idx##z_config = { \ - .twim = NRFX_TWIM_INSTANCE(idx), \ - .twim_config = { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(idx), \ - }, \ - .event_handler = event_handler, \ - .msg_buf_size = MSG_BUF_SIZE(idx), \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ + I2C_MEMORY_SECTION(idx);)) \ + static struct i2c_nrfx_twim_data twim_##idx##_data; \ + PINCTRL_DT_DEFINE(I2C(idx)); \ + static const struct i2c_nrfx_twim_common_config twim_##idx##z_config = { \ + .twim = NRFX_TWIM_INSTANCE(idx), \ + .twim_config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(idx), \ + }, \ + .event_handler = event_handler, \ + .msg_buf_size = MSG_BUF_SIZE(idx), \ + .irq_connect = irq_connect##idx, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ IF_ENABLED(USES_MSG_BUF(idx), \ - (.msg_buf = twim_##idx##_msg_buf,)) \ - .max_transfer_size = BIT_MASK( \ - DT_PROP(I2C(idx), easydma_maxcnt_bits)), \ - }; \ - PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, \ - PM_DEVICE_ISR_SAFE); \ - I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), \ - i2c_nrfx_twim_init, \ - i2c_nrfx_twim_deinit, \ - PM_DEV
#define I2C_MEMORY_SECTION(idx) \
COND_CODE_1(I2C_HAS_PROP(idx, memory_regions), \
(__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \
Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/i2c_nrfx_twim_rtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@

#define I2C_NRFX_TWIM_RTIO_DEVICE(idx) \
NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \
NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(I2C(idx)); \
BUILD_ASSERT(I2C_FREQUENCY(idx) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \
"Wrong I2C " #idx " frequency setting in dts"); \
static void irq_connect##idx(void) \
Expand Down Expand Up @@ -291,7 +292,7 @@
PM_DEVICE_DT_GET(I2C(idx)), &twim_##idx##z_data, \
&twim_##idx##z_config, POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \
&i2c_nrfx_twim_driver_api);

Check notice on line 295 in drivers/i2c/i2c_nrfx_twim_rtio.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/i2c/i2c_nrfx_twim_rtio.c:295 - IF_ENABLED(USES_MSG_BUF(idx), (MSG_BUF_DEFINE(idx);)) \ + IF_ENABLED(USES_MSG_BUF(idx), (MSG_BUF_DEFINE(idx);)) \ I2C_RTIO_DEFINE(_i2c##idx##_twim_rtio, \ DT_INST_PROP_OR(n, sq_size, CONFIG_I2C_RTIO_SQ_SIZE), \ DT_INST_PROP_OR(n, cq_size, CONFIG_I2C_RTIO_CQ_SIZE)); \ PINCTRL_DT_DEFINE(I2C(idx)); \ static struct i2c_nrfx_twim_rtio_data twim_##idx##z_data; \ static const struct i2c_nrfx_twim_rtio_config twim_##idx##z_config = { \ - .common = \ - { \ - .twim = NRFX_TWIM_INSTANCE(idx), \ - .twim_config = \ - { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(idx), \ - }, \ - .event_handler = event_handler, \ - .msg_buf_size = MSG_BUF_SIZE(idx), \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ - IF_ENABLED(USES_MSG_BUF(idx), (.msg_buf = MSG_BUF_SYM(idx),)) \ - .max_transfer_size = MAX_TRANSFER_SIZE(idx), \ - }, \ - .ctx = &_i2c##idx##_twim_rtio, \ + .common = { \ + .twim = NRFX_TWIM_INSTANCE(idx), \ + .twim_config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(idx), \ + }, \ + .event_handler = event_handler, \ + .msg_buf_size = MSG_BUF_SIZE(idx), \ + .irq_connect = irq_connect##idx, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ + IF_ENABLED(USES_MSG_BUF(idx), (.msg_buf = MSG_BUF_SYM(idx),)) .max_transfer_size = \ + MAX_TRANSFER_SIZE(idx), \ + }, \ + .ctx = &_i2c##idx##_twim_rtio, \ }; \ PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, PM_DEVICE_ISR_SAFE); \ I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), i2c_nrfx_twim_rtio_init, i2c_nrfx_twim_rtio_deinit, \ - PM_DEVICE_DT_GET(I2C(idx)), &twim_##idx##z_data, \ - &twim_##idx##z_config, POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \ - &i2c_nrfx_twim_driver_api); + PM_DEVICE_DT_GET(I2C(idx)), &twim_##idx##z_data, \ + &twim_##idx##z_config, POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \ + &i2c_nrfx_twim_driver_api);

Check notice on line 295 in drivers/i2c/i2c_nrfx_twim_rtio.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/i2c/i2c_nrfx_twim_rtio.c:295 - IF_ENABLED(USES_MSG_BUF(idx), (MSG_BUF_DEFINE(idx);)) \ + IF_ENABLED(USES_MSG_BUF(idx), (MSG_BUF_DEFINE(idx);)) \ I2C_RTIO_DEFINE(_i2c##idx##_twim_rtio, \ DT_INST_PROP_OR(n, sq_size, CONFIG_I2C_RTIO_SQ_SIZE), \ DT_INST_PROP_OR(n, cq_size, CONFIG_I2C_RTIO_CQ_SIZE)); \ PINCTRL_DT_DEFINE(I2C(idx)); \ static struct i2c_nrfx_twim_rtio_data twim_##idx##z_data; \ static const struct i2c_nrfx_twim_rtio_config twim_##idx##z_config = { \ - .common = \ - { \ - .twim = NRFX_TWIM_INSTANCE(idx), \ - .twim_config = \ - { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(idx), \ - }, \ - .event_handler = event_handler, \ - .msg_buf_size = MSG_BUF_SIZE(idx), \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ - IF_ENABLED(USES_MSG_BUF(idx), (.msg_buf = MSG_BUF_SYM(idx),)) \ - .max_transfer_size = MAX_TRANSFER_SIZE(idx), \ - }, \ - .ctx = &_i2c##idx##_twim_rtio, \ + .common = { \ + .twim = NRFX_TWIM_INSTANCE(idx), \ + .twim_config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(idx), \ + }, \ + .event_handler = event_handler, \ + .msg_buf_size = MSG_BUF_SIZE(idx), \ + .irq_connect = irq_connect##idx, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ + IF_ENABLED(USES_MSG_BUF(idx), (.msg_buf = MSG_BUF_SYM(idx),)) .max_transfer_size = \ + MAX_TRANSFER_SIZE(idx), \ + }, \ + .ctx = &_i2c##idx##_twim_rtio, \ }; \ PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, PM_DEVICE_ISR_SAFE); \ I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), i2c_nrfx_twim_rtio_init, i2c_nrfx_twim_rtio_deinit, \ - PM_DEVICE_DT_GET(I2C(idx)), &twim_##idx##z_data, \ - &twim_##idx##z_config, POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \ - &i2c_nrfx_twim_driver_api); + PM_DEVICE_DT_GET(I2C(idx)), &twim_##idx##z_data, \ + &twim_##idx##z_config, POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \ + &i2c_nrfx_twim_driver_api);
#ifdef CONFIG_HAS_HW_NRF_TWIM0
I2C_NRFX_TWIM_RTIO_DEVICE(0);
#endif
Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/i2c_nrfx_twis.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@
_CONCAT_4(shim_nrf_twis_, name, _, id)

#define SHIM_NRF_TWIS_DEVICE_DEFINE(id) \
NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SHIM_NRF_TWIS_NODE(id)); \
static void SHIM_NRF_TWIS_NAME(id, irq_connect)(void) \
{ \
IRQ_CONNECT( \
Expand Down Expand Up @@ -372,7 +373,7 @@
CONFIG_I2C_INIT_PRIORITY, \
&shim_nrf_twis_api \
);

Check notice on line 376 in drivers/i2c/i2c_nrfx_twis.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/i2c/i2c_nrfx_twis.c:376 -#define SHIM_NRF_TWIS_DEVICE_DEFINE(id) \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SHIM_NRF_TWIS_NODE(id)); \ - static void SHIM_NRF_TWIS_NAME(id, irq_connect)(void) \ - { \ - IRQ_CONNECT( \ - SHIM_NRF_TWIS_IRQN(id), \ - SHIM_NRF_TWIS_IRQ_PRIO(id), \ - nrfx_isr, \ - SHIM_NRF_TWIS_IRQ_HANDLER(id), \ - 0 \ - ); \ - } \ - \ - static void SHIM_NRF_TWIS_NAME(id, event_handler)(nrfx_twis_evt_t const *event) \ - { \ - shim_nrf_twis_event_handler(SHIM_NRF_TWIS_DEVICE_GET(id), event); \ - } \ - \ - static struct shim_nrf_twis_data SHIM_NRF_TWIS_NAME(id, data); \ - \ - PINCTRL_DT_DEFINE(SHIM_NRF_TWIS_NODE(id)); \ - \ - static uint8_t SHIM_NRF_TWIS_NAME(id, buf) \ - [SHIM_NRF_TWIS_BUF_SIZE] SHIM_NRF_TWIS_BUF_ATTR(id); \ - \ - static const struct shim_nrf_twis_config SHIM_NRF_TWIS_NAME(id, config) = { \ - .twis = NRFX_TWIS_INSTANCE(id), \ - .irq_connect = SHIM_NRF_TWIS_NAME(id, irq_connect), \ - .event_handler = SHIM_NRF_TWIS_NAME(id, event_handler), \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SHIM_NRF_TWIS_NODE(id)), \ - .buf = SHIM_NRF_TWIS_NAME(id, buf), \ - }; \ - \ - PM_DEVICE_DT_DEFINE( \ - SHIM_NRF_TWIS_NODE(id), \ - shim_nrf_twis_pm_action_cb, \ - ); \ - \ - DEVICE_DT_DEINIT_DEFINE( \ - SHIM_NRF_TWIS_NODE(id), \ - shim_nrf_twis_init, \ - shim_nrf_twis_deinit, \ - PM_DEVICE_DT_GET(SHIM_NRF_TWIS_NODE(id)), \ - &SHIM_NRF_TWIS_NAME(id, data), \ - &SHIM_NRF_TWIS_NAME(id, config), \ - POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, \ - &shim_nrf_twis_api \ - ); +#define SHIM_NRF_TWIS_DEVICE_DEFINE(id) \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SHIM_NRF_TWIS_NODE(id)); \ + static void SHIM_NRF_TWIS_NAME(id, irq_connect)(void) \ + { \ + IRQ_CONNECT(SHIM_NRF_TWIS_IRQN(id), SHIM_NRF_TWIS_IRQ_PRIO(id), nrfx_isr, \ + SHIM_NRF_TWIS_IRQ_HANDLER(id), 0); \ + } \ + \ + static void SHIM_NRF_TWIS_NAME(id, event_handler)(nrfx_twis_evt_t const *event) \ + { \ + shim_nrf_twis_event_handler(SHIM_NRF_TWIS_DEVICE_GET(id), event); \ + } \ + \ + static struct shim_nrf_twis_data SHIM_NRF_TWIS_NAME(id, data); \ + \ + PINCTRL_DT_DEFINE(SHIM_NRF_TWIS_NODE(id)); \ + \ + static uint8_t SHIM_NRF_TWIS_NAME(id, \ + buf)[SHIM_NRF_TWIS_BUF_SIZE] SHIM_NRF_TWIS_BUF_ATTR(id); \ + \ + static const struct shim_nrf_twis_config SHIM_NRF_TWIS_NAME(id, config) = { \ + .twis = NRFX_TWIS_INSTANCE(id), \ + .irq_connect = SHIM_NRF_TWIS_NAME(id, irq_connect), \ + .event_handler = SHIM_NRF_TWIS_NAME(id, event_handler),

Check notice on line 376 in drivers/i2c/i2c_nrfx_twis.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/i2c/i2c_nrfx_twis.c:376 -#define SHIM_NRF_TWIS_DEVICE_DEFINE(id) \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SHIM_NRF_TWIS_NODE(id)); \ - static void SHIM_NRF_TWIS_NAME(id, irq_connect)(void) \ - { \ - IRQ_CONNECT( \ - SHIM_NRF_TWIS_IRQN(id), \ - SHIM_NRF_TWIS_IRQ_PRIO(id), \ - nrfx_isr, \ - SHIM_NRF_TWIS_IRQ_HANDLER(id), \ - 0 \ - ); \ - } \ - \ - static void SHIM_NRF_TWIS_NAME(id, event_handler)(nrfx_twis_evt_t const *event) \ - { \ - shim_nrf_twis_event_handler(SHIM_NRF_TWIS_DEVICE_GET(id), event); \ - } \ - \ - static struct shim_nrf_twis_data SHIM_NRF_TWIS_NAME(id, data); \ - \ - PINCTRL_DT_DEFINE(SHIM_NRF_TWIS_NODE(id)); \ - \ - static uint8_t SHIM_NRF_TWIS_NAME(id, buf) \ - [SHIM_NRF_TWIS_BUF_SIZE] SHIM_NRF_TWIS_BUF_ATTR(id); \ - \ - static const struct shim_nrf_twis_config SHIM_NRF_TWIS_NAME(id, config) = { \ - .twis = NRFX_TWIS_INSTANCE(id), \ - .irq_connect = SHIM_NRF_TWIS_NAME(id, irq_connect), \ - .event_handler = SHIM_NRF_TWIS_NAME(id, event_handler), \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SHIM_NRF_TWIS_NODE(id)), \ - .buf = SHIM_NRF_TWIS_NAME(id, buf), \ - }; \ - \ - PM_DEVICE_DT_DEFINE( \ - SHIM_NRF_TWIS_NODE(id), \ - shim_nrf_twis_pm_action_cb, \ - ); \ - \ - DEVICE_DT_DEINIT_DEFINE( \ - SHIM_NRF_TWIS_NODE(id), \ - shim_nrf_twis_init, \ - shim_nrf_twis_deinit, \ - PM_DEVICE_DT_GET(SHIM_NRF_TWIS_NODE(id)), \ - &SHIM_NRF_TWIS_NAME(id, data), \ - &SHIM_NRF_TWIS_NAME(id, config), \ - POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, \ - &shim_nrf_twis_api \ - ); +#define SHIM_NRF_TWIS_DEVICE_DEFINE(id) \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SHIM_NRF_TWIS_NODE(id)); \ + static void SHIM_NRF_TWIS_NAME(id, irq_connect)(void) \ + { \ + IRQ_CONNECT(SHIM_NRF_TWIS_IRQN(id), SHIM_NRF_TWIS_IRQ_PRIO(id), nrfx_isr, \ + SHIM_NRF_TWIS_IRQ_HANDLER(id), 0); \ + } \ + \ + static void SHIM_NRF_TWIS_NAME(id, event_handler)(nrfx_twis_evt_t const *event) \ + { \ + shim_nrf_twis_event_handler(SHIM_NRF_TWIS_DEVICE_GET(id), event); \ + } \ + \ + static struct shim_nrf_twis_data SHIM_NRF_TWIS_NAME(id, data); \ + \ + PINCTRL_DT_DEFINE(SHIM_NRF_TWIS_NODE(id)); \ + \ + static uint8_t SHIM_NRF_TWIS_NAME(id, \ + buf)[SHIM_NRF_TWIS_BUF_SIZE] SHIM_NRF_TWIS_BUF_ATTR(id); \ + \ + static const struct shim_nrf_twis_config SHIM_NRF_TWIS_NAME(id, config) = { \ + .twis = NRFX_TWIS_INSTANCE(id), \ + .irq_connect = SHIM_NRF_TWIS_NAME(id, irq_connect), \ + .event_handler = SHIM_NRF_TWIS_NAME(id, event_handler),
#ifdef CONFIG_HAS_HW_NRF_TWIS0
SHIM_NRF_TWIS_DEVICE_DEFINE(0);
#endif
Expand Down
1 change: 1 addition & 0 deletions drivers/i2s/i2s_nrf_tdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,7 @@ static DEVICE_API(i2s, tdm_nrf_drv_api) = {
BUILD_ASSERT((TDM_SCK_CLK_SRC(idx) != ACLK && TDM_MCK_CLK_SRC(idx) != ACLK) || \
DT_NODE_HAS_STATUS_OKAY(NODE_ACLK), \
"Clock source ACLK requires the audiopll node."); \
NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(TDM(idx)); \
DEVICE_DT_DEFINE(TDM(idx), tdm_nrf_init##idx, NULL, &tdm_nrf_data##idx, &tdm_nrf_cfg##idx, \
POST_KERNEL, CONFIG_I2S_INIT_PRIORITY, &tdm_nrf_drv_api);

Expand Down
1 change: 1 addition & 0 deletions drivers/pwm/pwm_nrfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@

#define PWM_NRFX_DEVICE(idx) \
NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(PWM(idx)); \
NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(PWM(idx)); \
static struct pwm_nrfx_data pwm_nrfx_##idx##_data; \
static uint16_t pwm_##idx##_seq_values[NRF_PWM_CHANNEL_COUNT] \
PWM_MEMORY_SECTION(idx); \
Expand Down Expand Up @@ -543,7 +544,7 @@
&pwm_nrfx_##idx##_config, \
POST_KERNEL, PWM_INIT_PRIORITY(idx), \
&pwm_nrfx_drv_api_funcs)

Check notice on line 547 in drivers/pwm/pwm_nrfx.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/pwm/pwm_nrfx.c:547 -#define PWM_NRFX_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(PWM(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(PWM(idx)); \ - static struct pwm_nrfx_data pwm_nrfx_##idx##_data; \ - static uint16_t pwm_##idx##_seq_values[NRF_PWM_CHANNEL_COUNT] \ - PWM_MEMORY_SECTION(idx); \ - PINCTRL_DT_DEFINE(PWM(idx)); \ - static const struct pwm_nrfx_config pwm_nrfx_##idx##_config = { \ - .pwm = NRFX_PWM_INSTANCE(idx), \ - .initial_config = { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .base_clock = NRF_PWM_CLK_1MHz, \ - .count_mode = (PWM_PROP(idx, center_aligned) \ - ? NRF_PWM_MODE_UP_AND_DOWN \ - : NRF_PWM_MODE_UP), \ - .top_value = 1000, \ - .load_mode = NRF_PWM_LOAD_INDIVIDUAL, \ - .step_mode = NRF_PWM_STEP_TRIGGERED, \ - }, \ - .seq.values.p_raw = pwm_##idx##_seq_values, \ - .seq.length = NRF_PWM_CHANNEL_COUNT, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(PWM(idx)), \ +#define PWM_NRFX_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(PWM(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(PWM(idx)); \ + static struct pwm_nrfx_data pwm_nrfx_##idx##_data; \ + static uint16_t pwm_##idx##_seq_values[NRF_PWM_CHANNEL_COUNT] PWM_MEMORY_SECTION(idx); \ + PINCTRL_DT_DEFINE(PWM(idx)); \ + static const struct pwm_nrfx_config pwm_nrfx_##idx##_config = { \ + .pwm = NRFX_PWM_INSTANCE(idx), \ + .initial_config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .base_clock = NRF_PWM_CLK_1MHz, \ + .count_mode = \ + (PWM_PROP(idx, center_aligned) ? NRF_PWM_MODE_UP_AND_DOWN \ + : NRF_PWM_MODE_UP), \ + .top_value = 1000, \ + .load_mode = NRF_PWM_LOAD_INDIVIDUAL, \ + .step_mode = NRF_PWM_STEP_TRIGGERED, \ + }, \ + .seq.values.p_raw = pwm_##idx##_seq_values, \ + .seq.length = NRF_PWM_CHANNEL_COUNT, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(PWM(idx)), \ .clock_freq = COND_CODE_1(DT_CLOCKS_HAS_IDX(PWM(idx), 0), \ (DT_PROP(DT_CLOCKS_CTLR(PWM(idx)), clock_frequency)), \ - (16ul * 1000ul * 1000ul)), \ - IF_ENABLED(CONFIG_DCACHE, \ - (.mem_attr = PWM_GET_MEM_ATTR(idx),)) \ - IF_ENABLED(PWM_NRFX_USE_CLOCK_CONTROL, \ + (16ul * 1000ul * 1000ul)), \ + IF_ENABLED(CONFIG_DCACHE, \ + (.mem_attr = PWM_GET_MEM_ATTR(idx),)) \ + IF_ENABLED(PWM_NRFX_USE_CLOCK_CONTROL, \ (.clk_dev = PWM_NRFX_IS_FAST(_, /*empty*/, idx, _) \ ? DEVICE_DT_GET(DT_CLOCKS_CTLR(PWM(idx))) \ : NULL, \ .clk_spec = { \ .frequency = \ NRF_PERIPH_GET_FREQUENCY(PWM(idx)), \ - },)) \ - }; \ - static int pwm_nrfx_init##idx(const struct devi

Check notice on line 547 in drivers/pwm/pwm_nrfx.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/pwm/pwm_nrfx.c:547 -#define PWM_NRFX_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(PWM(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(PWM(idx)); \ - static struct pwm_nrfx_data pwm_nrfx_##idx##_data; \ - static uint16_t pwm_##idx##_seq_values[NRF_PWM_CHANNEL_COUNT] \ - PWM_MEMORY_SECTION(idx); \ - PINCTRL_DT_DEFINE(PWM(idx)); \ - static const struct pwm_nrfx_config pwm_nrfx_##idx##_config = { \ - .pwm = NRFX_PWM_INSTANCE(idx), \ - .initial_config = { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .base_clock = NRF_PWM_CLK_1MHz, \ - .count_mode = (PWM_PROP(idx, center_aligned) \ - ? NRF_PWM_MODE_UP_AND_DOWN \ - : NRF_PWM_MODE_UP), \ - .top_value = 1000, \ - .load_mode = NRF_PWM_LOAD_INDIVIDUAL, \ - .step_mode = NRF_PWM_STEP_TRIGGERED, \ - }, \ - .seq.values.p_raw = pwm_##idx##_seq_values, \ - .seq.length = NRF_PWM_CHANNEL_COUNT, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(PWM(idx)), \ +#define PWM_NRFX_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(PWM(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(PWM(idx)); \ + static struct pwm_nrfx_data pwm_nrfx_##idx##_data; \ + static uint16_t pwm_##idx##_seq_values[NRF_PWM_CHANNEL_COUNT] PWM_MEMORY_SECTION(idx); \ + PINCTRL_DT_DEFINE(PWM(idx)); \ + static const struct pwm_nrfx_config pwm_nrfx_##idx##_config = { \ + .pwm = NRFX_PWM_INSTANCE(idx), \ + .initial_config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .base_clock = NRF_PWM_CLK_1MHz, \ + .count_mode = \ + (PWM_PROP(idx, center_aligned) ? NRF_PWM_MODE_UP_AND_DOWN \ + : NRF_PWM_MODE_UP), \ + .top_value = 1000, \ + .load_mode = NRF_PWM_LOAD_INDIVIDUAL, \ + .step_mode = NRF_PWM_STEP_TRIGGERED, \ + }, \ + .seq.values.p_raw = pwm_##idx##_seq_values, \ + .seq.length = NRF_PWM_CHANNEL_COUNT, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(PWM(idx)), \ .clock_freq = COND_CODE_1(DT_CLOCKS_HAS_IDX(PWM(idx), 0), \ (DT_PROP(DT_CLOCKS_CTLR(PWM(idx)), clock_frequency)), \ - (16ul * 1000ul * 1000ul)), \ - IF_ENABLED(CONFIG_DCACHE, \ - (.mem_attr = PWM_GET_MEM_ATTR(idx),)) \ - IF_ENABLED(PWM_NRFX_USE_CLOCK_CONTROL, \ + (16ul * 1000ul * 1000ul)), \ + IF_ENABLED(CONFIG_DCACHE, \ + (.mem_attr = PWM_GET_MEM_ATTR(idx),)) \ + IF_ENABLED(PWM_NRFX_USE_CLOCK_CONTROL, \ (.clk_dev = PWM_NRFX_IS_FAST(_, /*empty*/, idx, _) \ ? DEVICE_DT_GET(DT_CLOCKS_CTLR(PWM(idx))) \ : NULL, \ .clk_spec = { \ .frequency = \ NRF_PERIPH_GET_FREQUENCY(PWM(idx)), \ - },)) \ - }; \ - static int pwm_nrfx_init##idx(const struct devi
#define COND_PWM_NRFX_DEVICE(unused, prefix, i, _) \
IF_ENABLED(CONFIG_HAS_HW_NRF_PWM##prefix##i, (PWM_NRFX_DEVICE(prefix##i);))

Expand Down
1 change: 1 addition & 0 deletions drivers/serial/uart_nrfx_uarte.c
Original file line number Diff line number Diff line change
Expand Up @@ -2714,6 +2714,7 @@

#define UART_NRF_UARTE_DEVICE(idx) \
NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(UARTE(idx)); \
NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(UARTE(idx)); \
UARTE_INT_DRIVEN(idx); \
PINCTRL_DT_DEFINE(UARTE(idx)); \
IF_ENABLED(CONFIG_UART_##idx##_ASYNC, ( \
Expand Down Expand Up @@ -2801,7 +2802,7 @@
UARTE_INIT_LEVEL(idx), \
UARTE_INIT_PRIO(idx), \
&uart_nrfx_uarte_driver_api)

Check notice on line 2805 in drivers/serial/uart_nrfx_uarte.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/serial/uart_nrfx_uarte.c:2805 - (PM_DEVICE_ISR_SAFE), (0)))))) \ - -#define UART_NRF_UARTE_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(UARTE(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(UARTE(idx)); \ - UARTE_INT_DRIVEN(idx); \ - PINCTRL_DT_DEFINE(UARTE(idx)); \ + (PM_DEVICE_ISR_SAFE), (0)))))) + +#define UART_NRF_UARTE_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(UARTE(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(UARTE(idx)); \ + UARTE_INT_DRIVEN(idx); \ + PINCTRL_DT_DEFINE(UARTE(idx)); \ IF_ENABLED(CONFIG_UART_##idx##_ASYNC, ( \ static uint8_t \ uarte##idx##_tx_cache[CONFIG_UART_ASYNC_TX_CACHE_SIZE] \ DMM_MEMORY_SECTION(UARTE(idx)); \ static uint8_t uarte##idx##_flush_buf[UARTE_HW_RX_FIFO_SIZE] \ DMM_MEMORY_SECTION(UARTE(idx)); \ - struct uarte_async_cb uarte##idx##_async;)) \ - static uint8_t uarte##idx##_poll_out_byte DMM_MEMORY_SECTION(UARTE(idx));\ - static uint8_t uarte##idx##_poll_in_byte DMM_MEMORY_SECTION(UARTE(idx)); \ - static struct uarte_nrfx_data uarte_##idx##_data = { \ - IF_ENABLED(CONFIG_UART_USE_RUNTIME_CONFIGURE, \ - (.uart_config = UARTE_CONFIG(idx),)) \ - IF_ENABLED(CONFIG_UART_##idx##_ASYNC, \ - (.async = &uarte##idx##_async,)) \ - IF_ENABLED(CONFIG_UART_##idx##_INTERRUPT_DRIVEN, \ - (.int_driven = &uarte##idx##_int_driven,)) \ - }; \ + struct uarte_async_cb uarte##idx##_async;)) \ + static uint8_t uarte##idx##_poll_out_byte DMM_MEMORY_SECTION(UARTE(idx)); \ + static uint8_t uarte##idx##_poll_in_byte DMM_MEMORY_SECTION(UARTE(idx)); \ + static struct uarte_nrfx_data uarte_##idx##_data = {IF_ENABLED(CONFIG_UART_USE_RUNTIME_CONFIGURE, \ + (.uart_config = UARTE_CONFIG(idx),)) \ + IF_ENABLED(CONFIG_UART_##idx##_ASYNC, \ + (.async = &uarte##idx##_async,)) \ + IF_ENABLED(CONFIG_UART_##idx##_INTERRUPT_DRIVEN, \ + (.int_driven = &uarte##idx##_int_driven,)) }; \ COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, (), \ (BUILD_ASSERT(UARTE_GET_BAUDRATE(idx) > 0, \ - "Unsupported baudrate");)) \ - static const struct uarte_nrfx_config uarte_##idx##z_config = { \ - COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, \ + "Unsupported baudrate");)) \ + static const struct uarte_nrfx_config uarte_##idx##z_config = {COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, \ (.clock_freq = NRF_PERIPH_GET_FREQUENCY(UARTE(idx)),), \ (IF_ENABLED(UARTE_HAS_FRAME_TIMEOUT, \ (.baudrate = UARTE_PROP(idx, current_speed),)) \ .nrf_baudrate = UARTE_GET_BAUDRATE(idx), \ - .hw_config = UARTE_NRF_CONFIG(idx),)) \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(UARTE(idx)), \ - .uarte_regs = _CONCAT(NRF_UARTE, idx), \ - IF_ENABLED(CONFIG_HAS_NORDIC_DMM, \ - (.mem_reg = DMM_DEV_TO_REG(UARTE(idx)),)) \ - .flags = \ - (IS_ENABLED(CONFIG_UART_##idx##_ENHANCED_POLL_OUT) ? \ - UARTE_CFG_FLAG_PPI_ENDTX : 0)

Check notice on line 2805 in drivers/serial/uart_nrfx_uarte.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/serial/uart_nrfx_uarte.c:2805 - (PM_DEVICE_ISR_SAFE), (0)))))) \ - -#define UART_NRF_UARTE_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(UARTE(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(UARTE(idx)); \ - UARTE_INT_DRIVEN(idx); \ - PINCTRL_DT_DEFINE(UARTE(idx)); \ + (PM_DEVICE_ISR_SAFE), (0)))))) + +#define UART_NRF_UARTE_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(UARTE(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(UARTE(idx)); \ + UARTE_INT_DRIVEN(idx); \ + PINCTRL_DT_DEFINE(UARTE(idx)); \ IF_ENABLED(CONFIG_UART_##idx##_ASYNC, ( \ static uint8_t \ uarte##idx##_tx_cache[CONFIG_UART_ASYNC_TX_CACHE_SIZE] \ DMM_MEMORY_SECTION(UARTE(idx)); \ static uint8_t uarte##idx##_flush_buf[UARTE_HW_RX_FIFO_SIZE] \ DMM_MEMORY_SECTION(UARTE(idx)); \ - struct uarte_async_cb uarte##idx##_async;)) \ - static uint8_t uarte##idx##_poll_out_byte DMM_MEMORY_SECTION(UARTE(idx));\ - static uint8_t uarte##idx##_poll_in_byte DMM_MEMORY_SECTION(UARTE(idx)); \ - static struct uarte_nrfx_data uarte_##idx##_data = { \ - IF_ENABLED(CONFIG_UART_USE_RUNTIME_CONFIGURE, \ - (.uart_config = UARTE_CONFIG(idx),)) \ - IF_ENABLED(CONFIG_UART_##idx##_ASYNC, \ - (.async = &uarte##idx##_async,)) \ - IF_ENABLED(CONFIG_UART_##idx##_INTERRUPT_DRIVEN, \ - (.int_driven = &uarte##idx##_int_driven,)) \ - }; \ + struct uarte_async_cb uarte##idx##_async;)) \ + static uint8_t uarte##idx##_poll_out_byte DMM_MEMORY_SECTION(UARTE(idx)); \ + static uint8_t uarte##idx##_poll_in_byte DMM_MEMORY_SECTION(UARTE(idx)); \ + static struct uarte_nrfx_data uarte_##idx##_data = {IF_ENABLED(CONFIG_UART_USE_RUNTIME_CONFIGURE, \ + (.uart_config = UARTE_CONFIG(idx),)) \ + IF_ENABLED(CONFIG_UART_##idx##_ASYNC, \ + (.async = &uarte##idx##_async,)) \ + IF_ENABLED(CONFIG_UART_##idx##_INTERRUPT_DRIVEN, \ + (.int_driven = &uarte##idx##_int_driven,)) }; \ COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, (), \ (BUILD_ASSERT(UARTE_GET_BAUDRATE(idx) > 0, \ - "Unsupported baudrate");)) \ - static const struct uarte_nrfx_config uarte_##idx##z_config = { \ - COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, \ + "Unsupported baudrate");)) \ + static const struct uarte_nrfx_config uarte_##idx##z_config = {COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, \ (.clock_freq = NRF_PERIPH_GET_FREQUENCY(UARTE(idx)),), \ (IF_ENABLED(UARTE_HAS_FRAME_TIMEOUT, \ (.baudrate = UARTE_PROP(idx, current_speed),)) \ .nrf_baudrate = UARTE_GET_BAUDRATE(idx), \ - .hw_config = UARTE_NRF_CONFIG(idx),)) \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(UARTE(idx)), \ - .uarte_regs = _CONCAT(NRF_UARTE, idx), \ - IF_ENABLED(CONFIG_HAS_NORDIC_DMM, \ - (.mem_reg = DMM_DEV_TO_REG(UARTE(idx)),)) \ - .flags = \ - (IS_ENABLED(CONFIG_UART_##idx##_ENHANCED_POLL_OUT) ? \ - UARTE_CFG_FLAG_PPI_ENDTX : 0)
#define UARTE_INT_DRIVEN(idx) \
IF_ENABLED(CONFIG_UART_##idx##_INTERRUPT_DRIVEN, \
(static uint8_t uarte##idx##_tx_buffer \
Expand Down
1 change: 1 addition & 0 deletions drivers/spi/spi_nrfx_spim.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,7 @@

#define SPI_NRFX_SPIM_DEFINE(idx) \
NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(SPIM(idx)); \
NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIM(idx)); \
static void irq_connect##idx(void) \
{ \
IRQ_CONNECT(DT_IRQN(SPIM(idx)), DT_IRQ(SPIM(idx), priority), \
Expand Down Expand Up @@ -987,7 +988,7 @@
&spi_##idx##z_config, \
POST_KERNEL, SPIM_INIT_PRIORITY(idx), \
&spi_nrfx_driver_api)

Check notice on line 991 in drivers/spi/spi_nrfx_spim.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/spi/spi_nrfx_spim.c:991 -#define SPI_NRFX_SPIM_DEFINE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(SPIM(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIM(idx)); \ - static void irq_connect##idx(void) \ - { \ - IRQ_CONNECT(DT_IRQN(SPIM(idx)), DT_IRQ(SPIM(idx), priority), \ - nrfx_isr, nrfx_spim_##idx##_irq_handler, 0); \ - } \ +#define SPI_NRFX_SPIM_DEFINE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(SPIM(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIM(idx)); \ + static void irq_connect##idx(void) \ + { \ + IRQ_CONNECT(DT_IRQN(SPIM(idx)), DT_IRQ(SPIM(idx), priority), nrfx_isr, \ + nrfx_spim_##idx##_irq_handler, 0); \ + } \ IF_ENABLED(SPI_BUFFER_IN_RAM, \ (static uint8_t spim_##idx##_tx_buffer \ [CONFIG_SPI_NRFX_RAM_BUFFER_SIZE] \ SPIM_MEMORY_SECTION(idx); \ static uint8_t spim_##idx##_rx_buffer \ [CONFIG_SPI_NRFX_RAM_BUFFER_SIZE] \ - SPIM_MEMORY_SECTION(idx);)) \ - static struct spi_nrfx_data spi_##idx##_data = { \ + SPIM_MEMORY_SECTION(idx);)) \ + static struct spi_nrfx_data spi_##idx##_data = { \ IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ - IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_SYNC(spi_##idx##_data, ctx),)) \ - SPI_CONTEXT_CS_GPIOS_INITIALIZE(SPIM(idx), ctx) \ - IF_ENABLED(SPI_BUFFER_IN_RAM, \ + (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ + IF_ENABLED(CONFIG_MULTITHREADING, \ + (SPI_CONTEXT_INIT_SYNC(spi_##idx##_data, ctx),)) SPI_CONTEXT_CS_GPIOS_INITIALIZE(SPIM(idx), \ + ctx) \ + IF_ENABLED(SPI_BUFFER_IN_RAM, \ (.tx_buffer = spim_##idx##_tx_buffer, \ - .rx_buffer = spim_##idx##_rx_buffer,)) \ - .dev = DEVICE_DT_GET(SPIM(idx)), \ - .busy = false, \ - }; \ - PINCTRL_DT_DEFINE(SPIM(idx)); \ - static const struct spi_nrfx_config spi_##idx##z_config = { \ - .spim = { \ - .p_reg = (NRF_SPIM_Type *)DT_REG_ADDR(SPIM(idx)), \ - .drv_inst_idx = NRFX_SPIM##idx##_INST_IDX, \ - }, \ - .max_freq = SPIM_PROP(idx, max_frequency), \ - .def_config = { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .ss_pin = NRF_SPIM_PIN_NOT_CONNECTED, \ - .orc = SPIM_PROP(idx, overrun_character), \ - SPI_NRFX_SPIM_EXTENDED_CONFIG(idx) \ - }, \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SPIM(idx)), \ - .max_chunk_len = BIT_MASK(SPIM_PROP(idx, easydma_maxcnt_bits)),\ - COND_CODE_1(CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58, \ + .rx_buffer = spim_##idx##_rx_buffer,)) .dev = \ + DEVICE_DT_GET(SPIM(idx)), \ + .busy = false, \ + }; \ + PINCTRL_DT_DEFINE(SPIM(idx)); \ + static const struct spi_nrfx_config spi_##idx##z_config = \ + {.spim = \ + {

Check notice on line 991 in drivers/spi/spi_nrfx_spim.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/spi/spi_nrfx_spim.c:991 -#define SPI_NRFX_SPIM_DEFINE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(SPIM(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIM(idx)); \ - static void irq_connect##idx(void) \ - { \ - IRQ_CONNECT(DT_IRQN(SPIM(idx)), DT_IRQ(SPIM(idx), priority), \ - nrfx_isr, nrfx_spim_##idx##_irq_handler, 0); \ - } \ +#define SPI_NRFX_SPIM_DEFINE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(SPIM(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIM(idx)); \ + static void irq_connect##idx(void) \ + { \ + IRQ_CONNECT(DT_IRQN(SPIM(idx)), DT_IRQ(SPIM(idx), priority), nrfx_isr, \ + nrfx_spim_##idx##_irq_handler, 0); \ + } \ IF_ENABLED(SPI_BUFFER_IN_RAM, \ (static uint8_t spim_##idx##_tx_buffer \ [CONFIG_SPI_NRFX_RAM_BUFFER_SIZE] \ SPIM_MEMORY_SECTION(idx); \ static uint8_t spim_##idx##_rx_buffer \ [CONFIG_SPI_NRFX_RAM_BUFFER_SIZE] \ - SPIM_MEMORY_SECTION(idx);)) \ - static struct spi_nrfx_data spi_##idx##_data = { \ + SPIM_MEMORY_SECTION(idx);)) \ + static struct spi_nrfx_data spi_##idx##_data = { \ IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ - IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_SYNC(spi_##idx##_data, ctx),)) \ - SPI_CONTEXT_CS_GPIOS_INITIALIZE(SPIM(idx), ctx) \ - IF_ENABLED(SPI_BUFFER_IN_RAM, \ + (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ + IF_ENABLED(CONFIG_MULTITHREADING, \ + (SPI_CONTEXT_INIT_SYNC(spi_##idx##_data, ctx),)) SPI_CONTEXT_CS_GPIOS_INITIALIZE(SPIM(idx), \ + ctx) \ + IF_ENABLED(SPI_BUFFER_IN_RAM, \ (.tx_buffer = spim_##idx##_tx_buffer, \ - .rx_buffer = spim_##idx##_rx_buffer,)) \ - .dev = DEVICE_DT_GET(SPIM(idx)), \ - .busy = false, \ - }; \ - PINCTRL_DT_DEFINE(SPIM(idx)); \ - static const struct spi_nrfx_config spi_##idx##z_config = { \ - .spim = { \ - .p_reg = (NRF_SPIM_Type *)DT_REG_ADDR(SPIM(idx)), \ - .drv_inst_idx = NRFX_SPIM##idx##_INST_IDX, \ - }, \ - .max_freq = SPIM_PROP(idx, max_frequency), \ - .def_config = { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .ss_pin = NRF_SPIM_PIN_NOT_CONNECTED, \ - .orc = SPIM_PROP(idx, overrun_character), \ - SPI_NRFX_SPIM_EXTENDED_CONFIG(idx) \ - }, \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SPIM(idx)), \ - .max_chunk_len = BIT_MASK(SPIM_PROP(idx, easydma_maxcnt_bits)),\ - COND_CODE_1(CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58, \ + .rx_buffer = spim_##idx##_rx_buffer,)) .dev = \ + DEVICE_DT_GET(SPIM(idx)), \ + .busy = false, \ + }; \ + PINCTRL_DT_DEFINE(SPIM(idx)); \ + static const struct spi_nrfx_config spi_##idx##z_config = \ + {.spim = \ + {
#define SPIM_MEMORY_SECTION(idx) \
COND_CODE_1(SPIM_HAS_PROP(idx, memory_regions), \
(__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \
Expand Down
1 change: 1 addition & 0 deletions drivers/spi/spi_nrfx_spis.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@
}

#define SPI_NRFX_SPIS_DEFINE(idx) \
NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIS(idx)); \
static void irq_connect##idx(void) \
{ \
IRQ_CONNECT(DT_IRQN(SPIS(idx)), DT_IRQ(SPIS(idx), priority), \
Expand Down Expand Up @@ -627,7 +628,7 @@
POST_KERNEL, \
CONFIG_SPI_INIT_PRIORITY, \
&spi_nrfx_driver_api)

Check notice on line 631 in drivers/spi/spi_nrfx_spis.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/spi/spi_nrfx_spis.c:631 -#define SPI_NRFX_SPIS_DEFINE(idx) \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIS(idx)); \ - static void irq_connect##idx(void) \ - { \ - IRQ_CONNECT(DT_IRQN(SPIS(idx)), DT_IRQ(SPIS(idx), priority), \ - nrfx_isr, nrfx_spis_##idx##_irq_handler, 0); \ - } \ - static struct spi_nrfx_data spi_##idx##_data = { \ - IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ - IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_SYNC(spi_##idx##_data, ctx),)) \ - .dev = DEVICE_DT_GET(SPIS(idx)), \ - IF_ENABLED(CONFIG_MULTITHREADING, \ +#define SPI_NRFX_SPIS_DEFINE(idx) \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIS(idx)); \ + static void irq_connect##idx(void) \ + { \ + IRQ_CONNECT(DT_IRQN(SPIS(idx)), DT_IRQ(SPIS(idx), priority), nrfx_isr, \ + nrfx_spis_##idx##_irq_handler, 0); \ + } \ + static struct spi_nrfx_data spi_##idx##_data = {IF_ENABLED(CONFIG_MULTITHREADING, \ + (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ + IF_ENABLED(CONFIG_MULTITHREADING, \ + (SPI_CONTEXT_INIT_SYNC(spi_##idx##_data, ctx),)) .dev = \ + DEVICE_DT_GET(SPIS(idx)), \ + IF_ENABLED(CONFIG_MULTITHREADING, \ (.wake_sem = Z_SEM_INITIALIZER( \ - spi_##idx##_data.wake_sem, 0, 1),)) \ - }; \ - PINCTRL_DT_DEFINE(SPIS(idx)); \ - static const struct spi_nrfx_config spi_##idx##z_config = { \ - .spis = { \ - .p_reg = (NRF_SPIS_Type *)DT_REG_ADDR(SPIS(idx)), \ - .drv_inst_idx = NRFX_SPIS##idx##_INST_IDX, \ - }, \ - .config = { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .mode = NRF_SPIS_MODE_0, \ - .bit_order = NRF_SPIS_BIT_ORDER_MSB_FIRST, \ - .orc = SPIS_PROP(idx, overrun_character), \ - .def = SPIS_PROP(idx, def_char), \ - }, \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SPIS(idx)), \ - .max_buf_len = BIT_MASK(SPIS_PROP(idx, easydma_maxcnt_bits)), \ + spi_##idx##_data.wake_sem, 0, 1),)) }; \ + PINCTRL_DT_DEFINE(SPIS(idx)); \ + static const struct spi_nrfx_config spi_##idx##z_config = { \ + .spis = \ + { \ + .p_reg = (NRF_SPIS_Type *)DT_REG_ADDR(SPIS(idx)), \ + .drv_inst_idx = NRFX_SPIS##idx##_INST_IDX, \ + }, \ + .config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .mode = NRF_SPIS_MODE_0, \ + .bit_order = NRF_SPIS_BIT_ORDER_MSB_FIRST, \ + .orc = SPIS_PROP(idx, overrun_character), \ + .def = SPIS_PROP(idx, def_char), \ + }, \ + .irq_

Check notice on line 631 in drivers/spi/spi_nrfx_spis.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/spi/spi_nrfx_spis.c:631 -#define SPI_NRFX_SPIS_DEFINE(idx) \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIS(idx)); \ - static void irq_connect##idx(void) \ - { \ - IRQ_CONNECT(DT_IRQN(SPIS(idx)), DT_IRQ(SPIS(idx), priority), \ - nrfx_isr, nrfx_spis_##idx##_irq_handler, 0); \ - } \ - static struct spi_nrfx_data spi_##idx##_data = { \ - IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ - IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_SYNC(spi_##idx##_data, ctx),)) \ - .dev = DEVICE_DT_GET(SPIS(idx)), \ - IF_ENABLED(CONFIG_MULTITHREADING, \ +#define SPI_NRFX_SPIS_DEFINE(idx) \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIS(idx)); \ + static void irq_connect##idx(void) \ + { \ + IRQ_CONNECT(DT_IRQN(SPIS(idx)), DT_IRQ(SPIS(idx), priority), nrfx_isr, \ + nrfx_spis_##idx##_irq_handler, 0); \ + } \ + static struct spi_nrfx_data spi_##idx##_data = {IF_ENABLED(CONFIG_MULTITHREADING, \ + (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ + IF_ENABLED(CONFIG_MULTITHREADING, \ + (SPI_CONTEXT_INIT_SYNC(spi_##idx##_data, ctx),)) .dev = \ + DEVICE_DT_GET(SPIS(idx)), \ + IF_ENABLED(CONFIG_MULTITHREADING, \ (.wake_sem = Z_SEM_INITIALIZER( \ - spi_##idx##_data.wake_sem, 0, 1),)) \ - }; \ - PINCTRL_DT_DEFINE(SPIS(idx)); \ - static const struct spi_nrfx_config spi_##idx##z_config = { \ - .spis = { \ - .p_reg = (NRF_SPIS_Type *)DT_REG_ADDR(SPIS(idx)), \ - .drv_inst_idx = NRFX_SPIS##idx##_INST_IDX, \ - }, \ - .config = { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .mode = NRF_SPIS_MODE_0, \ - .bit_order = NRF_SPIS_BIT_ORDER_MSB_FIRST, \ - .orc = SPIS_PROP(idx, overrun_character), \ - .def = SPIS_PROP(idx, def_char), \ - }, \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SPIS(idx)), \ - .max_buf_len = BIT_MASK(SPIS_PROP(idx, easydma_maxcnt_bits)), \ + spi_##idx##_data.wake_sem, 0, 1),)) }; \ + PINCTRL_DT_DEFINE(SPIS(idx)); \ + static const struct spi_nrfx_config spi_##idx##z_config = { \ + .spis = \ + { \ + .p_reg = (NRF_SPIS_Type *)DT_REG_ADDR(SPIS(idx)), \ + .drv_inst_idx = NRFX_SPIS##idx##_INST_IDX, \ + }, \ + .config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .mode = NRF_SPIS_MODE_0, \ + .bit_order = NRF_SPIS_BIT_ORDER_MSB_FIRST, \ + .orc = SPIS_PROP(idx, overrun_character), \ + .def = SPIS_PROP(idx, def_char), \ + }, \ + .irq_
/* Macro creates device instance if it is enabled in devicetree. */
#define SPIS_DEVICE(periph, prefix, id, _) \
IF_ENABLED(CONFIG_HAS_HW_NRF_SPIS##prefix##id, (SPI_NRFX_SPIS_DEFINE(prefix##id);))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@

&uart135 {
status = "okay";
memory-regions = <&cpuapp_dma_region>;
};
13 changes: 13 additions & 0 deletions soc/nordic/common/soc_nrf_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,19 @@
DT_PINCTRL_HAS_NAME(node_id, sleep), \
DT_NODE_PATH(node_id) " defined without sleep state")

/**
* Error out the build if CONFIG_HAS_NORDIC_DMM=y and memory-regions property is not defined
* or the status of the selected memory region is not "okay"
*
* @param node Devicetree node.
*/
#define NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(node_id) \
IF_ENABLED(CONFIG_HAS_NORDIC_DMM, \

Check notice on line 246 in soc/nordic/common/soc_nrf_common.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

soc/nordic/common/soc_nrf_common.h:246 -#define NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(node_id) \ +#define NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(node_id) \

Check notice on line 246 in soc/nordic/common/soc_nrf_common.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

soc/nordic/common/soc_nrf_common.h:246 -#define NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(node_id) \ +#define NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(node_id) \
(BUILD_ASSERT(( \
DT_NODE_HAS_PROP(node_id, memory_regions) && \
DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE_BY_IDX(node_id, memory_regions, 0))), \
DT_NODE_PATH(node_id) " defined without memory regions")))

/** @brief Get clock frequency that is used for the given node.
*
* Macro checks if node has clock property and if yes then if clock has clock_frequency property
Expand Down
Loading