Skip to content
Open
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
29 changes: 11 additions & 18 deletions drivers/i2c/i2c_nrfx_twim.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@
BUILD_ASSERT(I2C_FREQUENCY(DT_DRV_INST(idx)) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \
"Wrong I2C " #idx " frequency setting in dts"); \
static struct i2c_nrfx_twim_data twim_##idx##_data; \
static struct i2c_nrfx_twim_common_config twim_##idx##z_config; \
static struct i2c_nrfx_twim_common_config twim_##idx##z_config; \
static void pre_init##idx(void) \
{ \
twim_##idx##z_config.twim = &twim_##idx##_data.twim; \
twim_##idx##z_config.twim = &twim_##idx##_data.twim; \
twim_##idx##_data.twim.p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(idx); \
IRQ_CONNECT(DT_INST_IRQN(idx), DT_INST_IRQ(idx, priority), nrfx_twim_irq_handler, \
&twim_##idx##_data.twim, 0); \
Expand All @@ -286,24 +286,17 @@
.pre_init = pre_init##idx, \
.pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(idx), \
IF_ENABLED(USES_MSG_BUF(idx), \
(.msg_buf = twim_##idx##_msg_buf,)) \
.max_transfer_size = BIT_MASK( \
DT_INST_PROP(idx, easydma_maxcnt_bits)), \
}; \
PM_DEVICE_DT_INST_DEFINE(idx, twim_nrfx_pm_action, \
I2C_PM_ISR_SAFE(idx)); \
I2C_DEVICE_DT_INST_DEINIT_DEFINE(idx, \
i2c_nrfx_twim_init, \
i2c_nrfx_twim_deinit, \
PM_DEVICE_DT_INST_GET(idx), \
&twim_##idx##_data, \
&twim_##idx##z_config, \
POST_KERNEL, \
CONFIG_I2C_INIT_PRIORITY, \
&i2c_nrfx_twim_driver_api)
(.msg_buf = twim_##idx##_msg_buf,)) .max_transfer_size = \
BIT_MASK(DT_INST_PROP(idx, easydma_maxcnt_bits)), \

Check notice on line 290 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:290 - (.msg_buf = twim_##idx##_msg_buf,)) .max_transfer_size = \ + (.msg_buf = twim_##idx##_msg_buf,)) .max_transfer_size = \
}; \
PM_DEVICE_DT_INST_DEFINE(idx, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \
I2C_DEVICE_DT_INST_DEINIT_DEFINE(idx, i2c_nrfx_twim_init, i2c_nrfx_twim_deinit, \
PM_DEVICE_DT_INST_GET(idx), &twim_##idx##_data, \
&twim_##idx##z_config, POST_KERNEL, \
CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twim_driver_api)

#define I2C_MEMORY_SECTION(idx) \
COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), prop), \
COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), memory_regions), \
(__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \
DT_PHANDLE(DT_DRV_INST(idx), memory_regions)))))), \
())
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/i2c_nrfx_twim_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extern "C" {
* no longer ISR safe. This macro let's us check if we will be requesting/releasing
* power domains and determines PM device ISR safety value.
*/
#define I2C_PM_ISR_SAFE(idx) \
#define I2C_PM_ISR_SAFE(idx) \
COND_CODE_1( \
UTIL_AND( \
IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/i2c_nrfx_twim_rtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
&twim_##idx##z_data.twim, 0); \
} \
IF_ENABLED(USES_MSG_BUF(idx), (MSG_BUF_DEFINE(idx);)) \
I2C_RTIO_DEFINE(_i2c##idx##_twim_rtio, \

Check notice on line 274 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:274 - IF_ENABLED(USES_MSG_BUF(idx), (MSG_BUF_DEFINE(idx);)) \ + IF_ENABLED(USES_MSG_BUF(idx), (MSG_BUF_DEFINE(idx);)) \
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_INST_DEFINE(idx); \
Expand All @@ -291,9 +291,9 @@
MAX_TRANSFER_SIZE(idx), \
.twim = &twim_##idx##z_data.twim, \
}, \
.ctx = &_i2c##idx##_twim_rtio, \

Check notice on line 294 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:294 - IF_ENABLED(USES_MSG_BUF(idx), (.msg_buf = MSG_BUF_SYM(idx),)) .max_transfer_size = \ - MAX_TRANSFER_SIZE(idx), \ - .twim = &twim_##idx##z_data.twim, \ - }, \ + IF_ENABLED(USES_MSG_BUF(idx), (.msg_buf = MSG_BUF_SYM(idx),)) .max_transfer_size = \ + MAX_TRANSFER_SIZE(idx), \ + .twim = &twim_##idx##z_data.twim, \ + }, \
}; \
PM_DEVICE_DT_INST_DEFINE(idx, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \
PM_DEVICE_DT_INST_DEFINE(idx, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \
I2C_DEVICE_DT_INST_DEINIT_DEFINE(idx, i2c_nrfx_twim_rtio_init, i2c_nrfx_twim_rtio_deinit, \
PM_DEVICE_DT_INST_GET(idx), &twim_##idx##z_data, \
&twim_##idx##z_config, POST_KERNEL, \
Expand Down
5 changes: 2 additions & 3 deletions drivers/i2c/i2c_nrfx_twis.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ static void shim_nrf_twis_handle_write_done(const struct device *dev)
callbacks->buf_write_received(target_config, dev_config->buf, nrfx_twis_rx_amount(twis));
}

static void shim_nrf_twis_event_handler(const struct device *dev,
nrfx_twis_event_t const *event)
static void shim_nrf_twis_event_handler(const struct device *dev, nrfx_twis_event_t const *event)
{
switch (event->type) {
case NRFX_TWIS_EVT_READ_REQ:
Expand Down Expand Up @@ -318,7 +317,7 @@ static int shim_nrf_twis_deinit(const struct device *dev)
&SHIM_NRF_TWIS_NAME(id, data).twis, 0); \
} \
\
static void SHIM_NRF_TWIS_NAME(id, event_handler)(nrfx_twis_event_t const *event) \
static void SHIM_NRF_TWIS_NAME(id, event_handler)(nrfx_twis_event_t const *event) \
{ \
shim_nrf_twis_event_handler(DEVICE_DT_INST_GET(id), event); \
} \
Expand Down
4 changes: 2 additions & 2 deletions drivers/pwm/pwm_nrfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,13 +480,13 @@
#define PWM_MEM_REGION(inst) DT_PHANDLE(DT_DRV_INST(inst), memory_regions)

#define PWM_MEMORY_SECTION(inst) \
COND_CODE_1(DT_NODE_HAS_PROP(inst, memory_regions), \
COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(inst), memory_regions), \
(__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \
PWM_MEM_REGION(inst)))))), \
())

#define PWM_GET_MEM_ATTR(inst) \
COND_CODE_1(DT_NODE_HAS_PROP(inst, memory_regions), \
COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(inst), memory_regions), \

Check notice on line 489 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:489 -#define PWM_MEMORY_SECTION(inst) \ +#define PWM_MEMORY_SECTION(inst) \ COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(inst), memory_regions), \ (__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \ PWM_MEM_REGION(inst)))))), \ ()) -#define PWM_GET_MEM_ATTR(inst) \ +#define PWM_GET_MEM_ATTR(inst) \
(DT_PROP_OR(PWM_MEM_REGION(inst), zephyr_memory_attr, 0)), (0))

/* Fast instances depend on the global HSFLL clock controller (as they need
Expand Down
Loading