dma.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef __ASM_ARCH_DMA_H
  2. #define __ASM_ARCH_DMA_H
  3. #include <linux/list.h>
  4. #include <linux/types.h>
  5. struct ep93xx_dma_buffer {
  6. struct list_head list;
  7. u32 bus_addr;
  8. u16 size;
  9. };
  10. struct ep93xx_dma_m2p_client {
  11. char *name;
  12. u8 flags;
  13. void *cookie;
  14. void (*buffer_started)(void *cookie,
  15. struct ep93xx_dma_buffer *buf);
  16. void (*buffer_finished)(void *cookie,
  17. struct ep93xx_dma_buffer *buf,
  18. int bytes, int error);
  19. /* Internal to the DMA code. */
  20. void *channel;
  21. };
  22. #define EP93XX_DMA_M2P_PORT_I2S1 0x00
  23. #define EP93XX_DMA_M2P_PORT_I2S2 0x01
  24. #define EP93XX_DMA_M2P_PORT_AAC1 0x02
  25. #define EP93XX_DMA_M2P_PORT_AAC2 0x03
  26. #define EP93XX_DMA_M2P_PORT_AAC3 0x04
  27. #define EP93XX_DMA_M2P_PORT_I2S3 0x05
  28. #define EP93XX_DMA_M2P_PORT_UART1 0x06
  29. #define EP93XX_DMA_M2P_PORT_UART2 0x07
  30. #define EP93XX_DMA_M2P_PORT_UART3 0x08
  31. #define EP93XX_DMA_M2P_PORT_IRDA 0x09
  32. #define EP93XX_DMA_M2P_PORT_MASK 0x0f
  33. #define EP93XX_DMA_M2P_TX 0x00
  34. #define EP93XX_DMA_M2P_RX 0x10
  35. #define EP93XX_DMA_M2P_ABORT_ON_ERROR 0x20
  36. #define EP93XX_DMA_M2P_IGNORE_ERROR 0x40
  37. #define EP93XX_DMA_M2P_ERROR_MASK 0x60
  38. int ep93xx_dma_m2p_client_register(struct ep93xx_dma_m2p_client *m2p);
  39. void ep93xx_dma_m2p_client_unregister(struct ep93xx_dma_m2p_client *m2p);
  40. void ep93xx_dma_m2p_submit(struct ep93xx_dma_m2p_client *m2p,
  41. struct ep93xx_dma_buffer *buf);
  42. void ep93xx_dma_m2p_submit_recursive(struct ep93xx_dma_m2p_client *m2p,
  43. struct ep93xx_dma_buffer *buf);
  44. void ep93xx_dma_m2p_flush(struct ep93xx_dma_m2p_client *m2p);
  45. #endif /* __ASM_ARCH_DMA_H */