dma.h 1.6 KB

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