PM / sleep: Asynchronous threads for suspend_noirq
[linux/fpc-iii.git] / drivers / dma / dw / internal.h
blob32667f9e0ddab2503fe89522e0d987cf65ad5b44
1 /*
2 * Driver for the Synopsys DesignWare DMA Controller
4 * Copyright (C) 2013 Intel Corporation
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
11 #ifndef _DW_DMAC_INTERNAL_H
12 #define _DW_DMAC_INTERNAL_H
14 #include <linux/device.h>
15 #include <linux/dw_dmac.h>
17 #include "regs.h"
19 /**
20 * struct dw_dma_chip - representation of DesignWare DMA controller hardware
21 * @dev: struct device of the DMA controller
22 * @irq: irq line
23 * @regs: memory mapped I/O space
24 * @dw: struct dw_dma that is filed by dw_dma_probe()
26 struct dw_dma_chip {
27 struct device *dev;
28 int irq;
29 void __iomem *regs;
30 struct dw_dma *dw;
33 /* Export to the platform drivers */
34 int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata);
35 int dw_dma_remove(struct dw_dma_chip *chip);
37 void dw_dma_shutdown(struct dw_dma_chip *chip);
39 #ifdef CONFIG_PM_SLEEP
41 int dw_dma_suspend(struct dw_dma_chip *chip);
42 int dw_dma_resume(struct dw_dma_chip *chip);
44 #endif /* CONFIG_PM_SLEEP */
46 /**
47 * dwc_get_dms - get destination master
48 * @slave: pointer to the custom slave configuration
50 * Returns destination master in the custom slave configuration if defined, or
51 * default value otherwise.
53 static inline unsigned int dwc_get_dms(struct dw_dma_slave *slave)
55 return slave ? slave->dst_master : 0;
58 /**
59 * dwc_get_sms - get source master
60 * @slave: pointer to the custom slave configuration
62 * Returns source master in the custom slave configuration if defined, or
63 * default value otherwise.
65 static inline unsigned int dwc_get_sms(struct dw_dma_slave *slave)
67 return slave ? slave->src_master : 1;
70 #endif /* _DW_DMAC_INTERNAL_H */