ebus_dma.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_SPARC_EBUS_DMA_H
  3. #define __ASM_SPARC_EBUS_DMA_H
  4. struct ebus_dma_info {
  5. spinlock_t lock;
  6. void __iomem *regs;
  7. unsigned int flags;
  8. #define EBUS_DMA_FLAG_USE_EBDMA_HANDLER 0x00000001
  9. #define EBUS_DMA_FLAG_TCI_DISABLE 0x00000002
  10. /* These are only valid is EBUS_DMA_FLAG_USE_EBDMA_HANDLER is
  11. * set.
  12. */
  13. void (*callback)(struct ebus_dma_info *p, int event, void *cookie);
  14. void *client_cookie;
  15. unsigned int irq;
  16. #define EBUS_DMA_EVENT_ERROR 1
  17. #define EBUS_DMA_EVENT_DMA 2
  18. #define EBUS_DMA_EVENT_DEVICE 4
  19. unsigned char name[64];
  20. };
  21. int ebus_dma_register(struct ebus_dma_info *p);
  22. int ebus_dma_irq_enable(struct ebus_dma_info *p, int on);
  23. void ebus_dma_unregister(struct ebus_dma_info *p);
  24. int ebus_dma_request(struct ebus_dma_info *p, dma_addr_t bus_addr,
  25. size_t len);
  26. void ebus_dma_prepare(struct ebus_dma_info *p, int write);
  27. unsigned int ebus_dma_residue(struct ebus_dma_info *p);
  28. unsigned int ebus_dma_addr(struct ebus_dma_info *p);
  29. void ebus_dma_enable(struct ebus_dma_info *p, int on);
  30. #endif /* __ASM_SPARC_EBUS_DMA_H */