1 /* 2 * Copyright (c) 2022 Intel Corporation. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #define DT_DRV_COMPAT intel_adsp_hda_link_out 8 9 #include <zephyr/drivers/dma.h> 10 #include "dma_intel_adsp_hda.h" 11 12 #define LOG_LEVEL CONFIG_DMA_LOG_LEVEL 13 #include <zephyr/logging/log.h> 14 LOG_MODULE_REGISTER(dma_intel_adsp_hda_dma_link_out); 15 16 static DEVICE_API(dma, intel_adsp_hda_dma_link_out_api) = { 17 .config = intel_adsp_hda_dma_link_out_config, 18 .reload = intel_adsp_hda_dma_link_reload, 19 .start = intel_adsp_hda_dma_start, 20 .stop = intel_adsp_hda_dma_stop, 21 .suspend = intel_adsp_hda_dma_stop, 22 .get_status = intel_adsp_hda_dma_status, 23 .get_attribute = intel_adsp_hda_dma_get_attribute, 24 .chan_filter = intel_adsp_hda_dma_chan_filter, 25 }; 26 27 #define INTEL_ADSP_HDA_DMA_LINK_OUT_INIT(inst) \ 28 static const struct intel_adsp_hda_dma_cfg intel_adsp_hda_dma##inst##_config = { \ 29 .base = DT_INST_REG_ADDR(inst), \ 30 .regblock_size = DT_INST_REG_SIZE(inst), \ 31 .dma_channels = DT_INST_PROP(inst, dma_channels), \ 32 .direction = MEMORY_TO_PERIPHERAL, \ 33 .irq_config = NULL \ 34 }; \ 35 \ 36 static struct intel_adsp_hda_dma_data intel_adsp_hda_dma##inst##_data = {}; \ 37 \ 38 PM_DEVICE_DT_INST_DEFINE(inst, intel_adsp_hda_dma_pm_action); \ 39 \ 40 DEVICE_DT_INST_DEFINE(inst, &intel_adsp_hda_dma_init, \ 41 PM_DEVICE_DT_INST_GET(inst), \ 42 &intel_adsp_hda_dma##inst##_data, \ 43 &intel_adsp_hda_dma##inst##_config, POST_KERNEL, \ 44 CONFIG_DMA_INIT_PRIORITY, \ 45 &intel_adsp_hda_dma_link_out_api); 46 47 DT_INST_FOREACH_STATUS_OKAY(INTEL_ADSP_HDA_DMA_LINK_OUT_INIT) 48