dma-imx.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #ifndef __ASM_ARCH_MXC_DMA_H__
  9. #define __ASM_ARCH_MXC_DMA_H__
  10. #include <linux/scatterlist.h>
  11. #include <linux/device.h>
  12. #include <linux/dmaengine.h>
  13. /*
  14. * This enumerates peripheral types. Used for SDMA.
  15. */
  16. enum sdma_peripheral_type {
  17. IMX_DMATYPE_SSI, /* MCU domain SSI */
  18. IMX_DMATYPE_SSI_SP, /* Shared SSI */
  19. IMX_DMATYPE_MMC, /* MMC */
  20. IMX_DMATYPE_SDHC, /* SDHC */
  21. IMX_DMATYPE_UART, /* MCU domain UART */
  22. IMX_DMATYPE_UART_SP, /* Shared UART */
  23. IMX_DMATYPE_FIRI, /* FIRI */
  24. IMX_DMATYPE_CSPI, /* MCU domain CSPI */
  25. IMX_DMATYPE_CSPI_SP, /* Shared CSPI */
  26. IMX_DMATYPE_SIM, /* SIM */
  27. IMX_DMATYPE_ATA, /* ATA */
  28. IMX_DMATYPE_CCM, /* CCM */
  29. IMX_DMATYPE_EXT, /* External peripheral */
  30. IMX_DMATYPE_MSHC, /* Memory Stick Host Controller */
  31. IMX_DMATYPE_MSHC_SP, /* Shared Memory Stick Host Controller */
  32. IMX_DMATYPE_DSP, /* DSP */
  33. IMX_DMATYPE_MEMORY, /* Memory */
  34. IMX_DMATYPE_FIFO_MEMORY,/* FIFO type Memory */
  35. IMX_DMATYPE_SPDIF, /* SPDIF */
  36. IMX_DMATYPE_IPU_MEMORY, /* IPU Memory */
  37. IMX_DMATYPE_ASRC, /* ASRC */
  38. IMX_DMATYPE_ESAI, /* ESAI */
  39. IMX_DMATYPE_SSI_DUAL, /* SSI Dual FIFO */
  40. IMX_DMATYPE_ASRC_SP, /* Shared ASRC */
  41. IMX_DMATYPE_SAI, /* SAI */
  42. };
  43. enum imx_dma_prio {
  44. DMA_PRIO_HIGH = 0,
  45. DMA_PRIO_MEDIUM = 1,
  46. DMA_PRIO_LOW = 2
  47. };
  48. struct imx_dma_data {
  49. int dma_request; /* DMA request line */
  50. int dma_request2; /* secondary DMA request line */
  51. enum sdma_peripheral_type peripheral_type;
  52. int priority;
  53. };
  54. static inline int imx_dma_is_ipu(struct dma_chan *chan)
  55. {
  56. return !strcmp(dev_name(chan->device->dev), "ipu-core");
  57. }
  58. static inline int imx_dma_is_general_purpose(struct dma_chan *chan)
  59. {
  60. return !strcmp(chan->device->dev->driver->name, "imx-sdma") ||
  61. !strcmp(chan->device->dev->driver->name, "imx-dma");
  62. }
  63. #endif