dw.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Driver for the Synopsys DesignWare DMA Controller
  3. *
  4. * Copyright (C) 2007 Atmel Corporation
  5. * Copyright (C) 2010-2011 ST Microelectronics
  6. * Copyright (C) 2014 Intel Corporation
  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. #include <linux/clk.h>
  15. #include <linux/device.h>
  16. #include <linux/dmaengine.h>
  17. #include <linux/platform_data/dma-dw.h>
  18. struct dw_dma;
  19. /**
  20. * struct dw_dma_chip - representation of DesignWare DMA controller hardware
  21. * @dev: struct device of the DMA controller
  22. * @id: instance ID
  23. * @irq: irq line
  24. * @regs: memory mapped I/O space
  25. * @clk: hclk clock
  26. * @dw: struct dw_dma that is filed by dw_dma_probe()
  27. * @pdata: pointer to platform data
  28. */
  29. struct dw_dma_chip {
  30. struct device *dev;
  31. int id;
  32. int irq;
  33. void __iomem *regs;
  34. struct clk *clk;
  35. struct dw_dma *dw;
  36. const struct dw_dma_platform_data *pdata;
  37. };
  38. /* Export to the platform drivers */
  39. #if IS_ENABLED(CONFIG_DW_DMAC_CORE)
  40. int dw_dma_probe(struct dw_dma_chip *chip);
  41. int dw_dma_remove(struct dw_dma_chip *chip);
  42. #else
  43. static inline int dw_dma_probe(struct dw_dma_chip *chip) { return -ENODEV; }
  44. static inline int dw_dma_remove(struct dw_dma_chip *chip) { return 0; }
  45. #endif /* CONFIG_DW_DMAC_CORE */
  46. #endif /* _DMA_DW_H */