]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/linux/dma/dw.h
UBUNTU: Ubuntu-4.13.0-45.50
[mirror_ubuntu-artful-kernel.git] / include / linux / dma / dw.h
CommitLineData
3d588f83
AS
1/*
2 * Driver for the Synopsys DesignWare DMA Controller
3 *
4 * Copyright (C) 2007 Atmel Corporation
5 * Copyright (C) 2010-2011 ST Microelectronics
2a52f6e4 6 * Copyright (C) 2014 Intel Corporation
3d588f83
AS
7 *
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.
11 */
12#ifndef _DMA_DW_H
13#define _DMA_DW_H
14
2a52f6e4
AS
15#include <linux/clk.h>
16#include <linux/device.h>
3d588f83
AS
17#include <linux/dmaengine.h>
18
2a52f6e4
AS
19#include <linux/platform_data/dma-dw.h>
20
21struct dw_dma;
22
23/**
24 * struct dw_dma_chip - representation of DesignWare DMA controller hardware
25 * @dev: struct device of the DMA controller
08d62f58 26 * @id: instance ID
2a52f6e4
AS
27 * @irq: irq line
28 * @regs: memory mapped I/O space
29 * @clk: hclk clock
30 * @dw: struct dw_dma that is filed by dw_dma_probe()
3a14c66d 31 * @pdata: pointer to platform data
2a52f6e4
AS
32 */
33struct dw_dma_chip {
34 struct device *dev;
08d62f58 35 int id;
2a52f6e4
AS
36 int irq;
37 void __iomem *regs;
38 struct clk *clk;
39 struct dw_dma *dw;
3a14c66d
AS
40
41 const struct dw_dma_platform_data *pdata;
2a52f6e4
AS
42};
43
44/* Export to the platform drivers */
19d82910 45#if IS_ENABLED(CONFIG_DW_DMAC_CORE)
3a14c66d 46int dw_dma_probe(struct dw_dma_chip *chip);
2a52f6e4 47int dw_dma_remove(struct dw_dma_chip *chip);
19d82910
AS
48#else
49static inline int dw_dma_probe(struct dw_dma_chip *chip) { return -ENODEV; }
50static inline int dw_dma_remove(struct dw_dma_chip *chip) { return 0; }
51#endif /* CONFIG_DW_DMAC_CORE */
2a52f6e4 52
3d588f83 53#endif /* _DMA_DW_H */