hsu.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. int hsu_dma_get_status(struct hsu_dma_chip *chip, unsigned short nr,
  37. u32 *status);
  38. int hsu_dma_do_irq(struct hsu_dma_chip *chip, unsigned short nr, u32 status);
  39. /* Export to the platform drivers */
  40. int hsu_dma_probe(struct hsu_dma_chip *chip);
  41. int hsu_dma_remove(struct hsu_dma_chip *chip);
  42. #else
  43. static inline int hsu_dma_get_status(struct hsu_dma_chip *chip,
  44. unsigned short nr, u32 *status)
  45. {
  46. return 0;
  47. }
  48. static inline int hsu_dma_do_irq(struct hsu_dma_chip *chip, unsigned short nr,
  49. u32 status)
  50. {
  51. return 0;
  52. }
  53. static inline int hsu_dma_probe(struct hsu_dma_chip *chip) { return -ENODEV; }
  54. static inline int hsu_dma_remove(struct hsu_dma_chip *chip) { return 0; }
  55. #endif /* CONFIG_HSU_DMA */
  56. #endif /* _DMA_HSU_H */