dw.h 1.5 KB

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