hsu.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Driver for the High Speed UART DMA
  3. *
  4. * Copyright (C) 2015 Intel Corporation
  5. *
  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. */
  10. #ifndef _DMA_HSU_H
  11. #define _DMA_HSU_H
  12. #include <linux/device.h>
  13. #include <linux/interrupt.h>
  14. #include <linux/platform_data/dma-hsu.h>
  15. struct hsu_dma;
  16. /**
  17. * struct hsu_dma_chip - representation of HSU DMA hardware
  18. * @dev: struct device of the DMA controller
  19. * @irq: irq line
  20. * @regs: memory mapped I/O space
  21. * @length: I/O space length
  22. * @offset: offset of the I/O space where registers are located
  23. * @hsu: struct hsu_dma that is filed by ->probe()
  24. * @pdata: platform data for the DMA controller if provided
  25. */
  26. struct hsu_dma_chip {
  27. struct device *dev;
  28. int irq;
  29. void __iomem *regs;
  30. unsigned int length;
  31. unsigned int offset;
  32. struct hsu_dma *hsu;
  33. };
  34. #if IS_ENABLED(CONFIG_HSU_DMA)
  35. /* Export to the internal users */
  36. irqreturn_t hsu_dma_irq(struct hsu_dma_chip *chip, unsigned short nr);
  37. /* Export to the platform drivers */
  38. int hsu_dma_probe(struct hsu_dma_chip *chip);
  39. int hsu_dma_remove(struct hsu_dma_chip *chip);
  40. #else
  41. static inline irqreturn_t hsu_dma_irq(struct hsu_dma_chip *chip,
  42. unsigned short nr)
  43. {
  44. return IRQ_NONE;
  45. }
  46. static inline int hsu_dma_probe(struct hsu_dma_chip *chip) { return -ENODEV; }
  47. static inline int hsu_dma_remove(struct hsu_dma_chip *chip) { return 0; }
  48. #endif /* CONFIG_HSU_DMA */
  49. #endif /* _DMA_HSU_H */