1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright (c) 2018-2019 Synopsys, Inc. and/or its affiliates.
4 * Synopsys DesignWare eDMA core driver
5 *
6 * Author: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
7 */
8
9 #ifndef _DW_EDMA_H
10 #define _DW_EDMA_H
11
12 #include <linux/device.h>
13 #include <linux/dmaengine.h>
14
15 struct dw_edma;
16
17 /**
18 * struct dw_edma_chip - representation of DesignWare eDMA controller hardware
19 * @dev: struct device of the eDMA controller
20 * @id: instance ID
21 * @irq: irq line
22 * @dw: struct dw_edma that is filed by dw_edma_probe()
23 */
24 struct dw_edma_chip {
25 struct device *dev;
26 int id;
27 int irq;
28 struct dw_edma *dw;
29 };
30
31 /* Export to the platform drivers */
32 #if IS_ENABLED(CONFIG_DW_EDMA)
33 int dw_edma_probe(struct dw_edma_chip *chip);
34 int dw_edma_remove(struct dw_edma_chip *chip);
35 #else
36 static inline int dw_edma_probe(struct dw_edma_chip *chip)
37 {
38 return -ENODEV;
39 }
40
41 static inline int dw_edma_remove(struct dw_edma_chip *chip)
42 {
43 return 0;
44 }
45 #endif /* CONFIG_DW_EDMA */
46
47 #endif /* _DW_EDMA_H */