Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Driver for the Synopsys DesignWare DMA Controller
0004  *
0005  * Copyright (C) 2007 Atmel Corporation
0006  * Copyright (C) 2010-2011 ST Microelectronics
0007  * Copyright (C) 2014 Intel Corporation
0008  */
0009 #ifndef _DMA_DW_H
0010 #define _DMA_DW_H
0011 
0012 #include <linux/clk.h>
0013 #include <linux/device.h>
0014 #include <linux/dmaengine.h>
0015 
0016 #include <linux/platform_data/dma-dw.h>
0017 
0018 struct dw_dma;
0019 
0020 /**
0021  * struct dw_dma_chip - representation of DesignWare DMA controller hardware
0022  * @dev:        struct device of the DMA controller
0023  * @id:         instance ID
0024  * @irq:        irq line
0025  * @regs:       memory mapped I/O space
0026  * @clk:        hclk clock
0027  * @dw:         struct dw_dma that is filed by dw_dma_probe()
0028  * @pdata:      pointer to platform data
0029  */
0030 struct dw_dma_chip {
0031     struct device   *dev;
0032     int     id;
0033     int     irq;
0034     void __iomem    *regs;
0035     struct clk  *clk;
0036     struct dw_dma   *dw;
0037 
0038     const struct dw_dma_platform_data   *pdata;
0039 };
0040 
0041 /* Export to the platform drivers */
0042 #if IS_ENABLED(CONFIG_DW_DMAC_CORE)
0043 int dw_dma_probe(struct dw_dma_chip *chip);
0044 int dw_dma_remove(struct dw_dma_chip *chip);
0045 int idma32_dma_probe(struct dw_dma_chip *chip);
0046 int idma32_dma_remove(struct dw_dma_chip *chip);
0047 #else
0048 static inline int dw_dma_probe(struct dw_dma_chip *chip) { return -ENODEV; }
0049 static inline int dw_dma_remove(struct dw_dma_chip *chip) { return 0; }
0050 static inline int idma32_dma_probe(struct dw_dma_chip *chip) { return -ENODEV; }
0051 static inline int idma32_dma_remove(struct dw_dma_chip *chip) { return 0; }
0052 #endif /* CONFIG_DW_DMAC_CORE */
0053 
0054 #endif /* _DMA_DW_H */