2 * Driver for the Synopsys DesignWare DMA Controller
4 * Copyright (C) 2007 Atmel Corporation
5 * Copyright (C) 2010-2011 ST Microelectronics
6 * Copyright (C) 2014 Intel Corporation
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
15 #include <linux/clk.h>
16 #include <linux/device.h>
17 #include <linux/dmaengine.h>
19 #include <linux/platform_data/dma-dw.h>
24 * struct dw_dma_chip - representation of DesignWare DMA controller hardware
25 * @dev: struct device of the DMA controller
28 * @regs: memory mapped I/O space
30 * @dw: struct dw_dma that is filed by dw_dma_probe()
31 * @pdata: pointer to platform data
41 const struct dw_dma_platform_data
*pdata
;
44 /* Export to the platform drivers */
45 #if IS_ENABLED(CONFIG_DW_DMAC_CORE)
46 int dw_dma_probe(struct dw_dma_chip
*chip
);
47 int dw_dma_remove(struct dw_dma_chip
*chip
);
49 static inline int dw_dma_probe(struct dw_dma_chip
*chip
) { return -ENODEV
; }
50 static inline int dw_dma_remove(struct dw_dma_chip
*chip
) { return 0; }
51 #endif /* CONFIG_DW_DMAC_CORE */
53 /* DMA API extensions */
56 struct dw_cyclic_desc
{
57 struct dw_desc
**desc
;
58 unsigned long periods
;
59 void (*period_callback
)(void *param
);
60 void *period_callback_param
;
63 struct dw_cyclic_desc
*dw_dma_cyclic_prep(struct dma_chan
*chan
,
64 dma_addr_t buf_addr
, size_t buf_len
, size_t period_len
,
65 enum dma_transfer_direction direction
);
66 void dw_dma_cyclic_free(struct dma_chan
*chan
);
67 int dw_dma_cyclic_start(struct dma_chan
*chan
);
68 void dw_dma_cyclic_stop(struct dma_chan
*chan
);
70 dma_addr_t
dw_dma_get_src_addr(struct dma_chan
*chan
);
72 dma_addr_t
dw_dma_get_dst_addr(struct dma_chan
*chan
);
74 #endif /* _DMA_DW_H */