2014-09-23 22:18:11 +08:00
|
|
|
/*
|
|
|
|
* Driver for the Synopsys DesignWare DMA Controller
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 Atmel Corporation
|
|
|
|
* Copyright (C) 2010-2011 ST Microelectronics
|
2014-09-23 22:18:15 +08:00
|
|
|
* Copyright (C) 2014 Intel Corporation
|
2014-09-23 22:18:11 +08:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
#ifndef _DMA_DW_H
|
|
|
|
#define _DMA_DW_H
|
|
|
|
|
2014-09-23 22:18:15 +08:00
|
|
|
#include <linux/clk.h>
|
|
|
|
#include <linux/device.h>
|
2014-09-23 22:18:11 +08:00
|
|
|
#include <linux/dmaengine.h>
|
|
|
|
|
2014-09-23 22:18:15 +08:00
|
|
|
#include <linux/platform_data/dma-dw.h>
|
|
|
|
|
|
|
|
struct dw_dma;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct dw_dma_chip - representation of DesignWare DMA controller hardware
|
|
|
|
* @dev: struct device of the DMA controller
|
2017-01-17 19:57:26 +08:00
|
|
|
* @id: instance ID
|
2014-09-23 22:18:15 +08:00
|
|
|
* @irq: irq line
|
|
|
|
* @regs: memory mapped I/O space
|
|
|
|
* @clk: hclk clock
|
|
|
|
* @dw: struct dw_dma that is filed by dw_dma_probe()
|
2016-04-27 19:15:40 +08:00
|
|
|
* @pdata: pointer to platform data
|
2014-09-23 22:18:15 +08:00
|
|
|
*/
|
|
|
|
struct dw_dma_chip {
|
|
|
|
struct device *dev;
|
2017-01-17 19:57:26 +08:00
|
|
|
int id;
|
2014-09-23 22:18:15 +08:00
|
|
|
int irq;
|
|
|
|
void __iomem *regs;
|
|
|
|
struct clk *clk;
|
|
|
|
struct dw_dma *dw;
|
2016-04-27 19:15:40 +08:00
|
|
|
|
|
|
|
const struct dw_dma_platform_data *pdata;
|
2014-09-23 22:18:15 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Export to the platform drivers */
|
2016-08-18 00:20:23 +08:00
|
|
|
#if IS_ENABLED(CONFIG_DW_DMAC_CORE)
|
2016-04-27 19:15:40 +08:00
|
|
|
int dw_dma_probe(struct dw_dma_chip *chip);
|
2014-09-23 22:18:15 +08:00
|
|
|
int dw_dma_remove(struct dw_dma_chip *chip);
|
2016-08-18 00:20:23 +08:00
|
|
|
#else
|
|
|
|
static inline int dw_dma_probe(struct dw_dma_chip *chip) { return -ENODEV; }
|
|
|
|
static inline int dw_dma_remove(struct dw_dma_chip *chip) { return 0; }
|
|
|
|
#endif /* CONFIG_DW_DMAC_CORE */
|
2014-09-23 22:18:15 +08:00
|
|
|
|
2014-09-23 22:18:11 +08:00
|
|
|
#endif /* _DMA_DW_H */
|