/* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2018-2019 Synopsys, Inc. and/or its affiliates. * Synopsys DesignWare eDMA core driver * * Author: Gustavo Pimentel <[email protected]> */ #ifndef _DW_EDMA_H #define _DW_EDMA_H #include <linux/device.h> #include <linux/dmaengine.h> #define EDMA_MAX_WR_CH … #define EDMA_MAX_RD_CH … struct dw_edma; struct dw_edma_region { … }; /** * struct dw_edma_core_ops - platform-specific eDMA methods * @irq_vector: Get IRQ number of the passed eDMA channel. Note the * method accepts the channel id in the end-to-end * numbering with the eDMA write channels being placed * first in the row. * @pci_address: Get PCIe bus address corresponding to the passed CPU * address. Note there is no need in specifying this * function if the address translation is performed by * the DW PCIe RP/EP controller with the DW eDMA device in * subject and DMA_BYPASS isn't set for all the outbound * iATU windows. That will be done by the controller * automatically. */ struct dw_edma_plat_ops { … }; enum dw_edma_map_format { … }; /** * enum dw_edma_chip_flags - Flags specific to an eDMA chip * @DW_EDMA_CHIP_LOCAL: eDMA is used locally by an endpoint */ enum dw_edma_chip_flags { … }; /** * struct dw_edma_chip - representation of DesignWare eDMA controller hardware * @dev: struct device of the eDMA controller * @id: instance ID * @nr_irqs: total number of DMA IRQs * @ops DMA channel to IRQ number mapping * @flags dw_edma_chip_flags * @reg_base DMA register base address * @ll_wr_cnt DMA write link list count * @ll_rd_cnt DMA read link list count * @rg_region DMA register region * @ll_region_wr DMA descriptor link list memory for write channel * @ll_region_rd DMA descriptor link list memory for read channel * @dt_region_wr DMA data memory for write channel * @dt_region_rd DMA data memory for read channel * @mf DMA register map format * @dw: struct dw_edma that is filled by dw_edma_probe() */ struct dw_edma_chip { … }; /* Export to the platform drivers */ #if IS_REACHABLE(CONFIG_DW_EDMA) int dw_edma_probe(struct dw_edma_chip *chip); int dw_edma_remove(struct dw_edma_chip *chip); #else static inline int dw_edma_probe(struct dw_edma_chip *chip) { return -ENODEV; } static inline int dw_edma_remove(struct dw_edma_chip *chip) { return 0; } #endif /* CONFIG_DW_EDMA */ #endif /* _DW_EDMA_H */