Lines Matching refs:_inst

556 #define DMA_EMUL_INST_HAS_PROP(_inst, _prop) DT_NODE_HAS_PROP(DT_DRV_INST(_inst), _prop)  argument
558 #define DMA_EMUL_INST_CHANNEL_MASK(_inst) \ argument
559 DT_INST_PROP_OR(_inst, dma_channel_mask, \
560 DMA_EMUL_INST_HAS_PROP(_inst, dma_channels) \
561 ? ((DT_INST_PROP(_inst, dma_channels) > 0) \
562 ? BIT_MASK(DT_INST_PROP_OR(_inst, dma_channels, 0)) \
566 #define DMA_EMUL_INST_NUM_CHANNELS(_inst) \ argument
567 DT_INST_PROP_OR(_inst, dma_channels, \
568 DMA_EMUL_INST_HAS_PROP(_inst, dma_channel_mask) \
569 ? POPCOUNT(DT_INST_PROP_OR(_inst, dma_channel_mask, 0)) \
572 #define DMA_EMUL_INST_NUM_REQUESTS(_inst) DT_INST_PROP_OR(_inst, dma_requests, 1) argument
574 #define DEFINE_DMA_EMUL(_inst) \ argument
575 BUILD_ASSERT(DMA_EMUL_INST_HAS_PROP(_inst, dma_channel_mask) || \
576 DMA_EMUL_INST_HAS_PROP(_inst, dma_channels), \
579 BUILD_ASSERT(DMA_EMUL_INST_NUM_CHANNELS(_inst) <= 32, "invalid dma-channels property"); \
581 static K_THREAD_STACK_DEFINE(work_q_stack_##_inst, DT_INST_PROP(_inst, stack_size)); \
584 dma_emul_xfer_desc_##_inst[DMA_EMUL_INST_NUM_CHANNELS(_inst)]; \
587 dma_emul_block_config_##_inst[DMA_EMUL_INST_NUM_CHANNELS(_inst) * \
588 DMA_EMUL_INST_NUM_REQUESTS(_inst)]; \
590 static const struct dma_emul_config dma_emul_config_##_inst = { \
591 .channel_mask = DMA_EMUL_INST_CHANNEL_MASK(_inst), \
592 .num_channels = DMA_EMUL_INST_NUM_CHANNELS(_inst), \
593 .num_requests = DMA_EMUL_INST_NUM_REQUESTS(_inst), \
594 .addr_align = DT_INST_PROP_OR(_inst, dma_buf_addr_alignment, 1), \
595 .size_align = DT_INST_PROP_OR(_inst, dma_buf_size_alignment, 1), \
596 .copy_align = DT_INST_PROP_OR(_inst, dma_copy_alignment, 1), \
597 .work_q_stack = (k_thread_stack_t *)&work_q_stack_##_inst, \
598 .work_q_stack_size = K_THREAD_STACK_SIZEOF(work_q_stack_##_inst), \
599 .work_q_priority = DT_INST_PROP_OR(_inst, priority, 0), \
600 .xfer = dma_emul_xfer_desc_##_inst, \
601 .block = dma_emul_block_config_##_inst, \
604 static ATOMIC_DEFINE(dma_emul_channels_atomic_##_inst, \
605 DT_INST_PROP_OR(_inst, dma_channels, 0)); \
607 static struct dma_emul_data dma_emul_data_##_inst = { \
608 .channels_atomic = dma_emul_channels_atomic_##_inst, \
611 PM_DEVICE_DT_INST_DEFINE(_inst, dma_emul_pm_device_pm_action); \
613 DEVICE_DT_INST_DEFINE(_inst, dma_emul_init, PM_DEVICE_DT_INST_GET(_inst), \
614 &dma_emul_data_##_inst, &dma_emul_config_##_inst, POST_KERNEL, \