imx-pcm.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright 2009 Sascha Hauer <[email protected]>
  4. *
  5. * This code is based on code copyrighted by Freescale,
  6. * Liam Girdwood, Javier Martin and probably others.
  7. */
  8. #ifndef _IMX_PCM_H
  9. #define _IMX_PCM_H
  10. #include <linux/dma/imx-dma.h>
  11. /*
  12. * Do not change this as the FIQ handler depends on this size
  13. */
  14. #define IMX_SSI_DMABUF_SIZE (64 * 1024)
  15. #define IMX_DEFAULT_DMABUF_SIZE (64 * 1024)
  16. struct imx_pcm_fiq_params {
  17. int irq;
  18. void __iomem *base;
  19. /* Pointer to original ssi driver to setup tx rx sizes */
  20. struct snd_dmaengine_dai_dma_data *dma_params_rx;
  21. struct snd_dmaengine_dai_dma_data *dma_params_tx;
  22. };
  23. #if IS_ENABLED(CONFIG_SND_SOC_IMX_PCM_DMA)
  24. int imx_pcm_dma_init(struct platform_device *pdev);
  25. #else
  26. static inline int imx_pcm_dma_init(struct platform_device *pdev)
  27. {
  28. return -ENODEV;
  29. }
  30. #endif
  31. #if IS_ENABLED(CONFIG_SND_SOC_IMX_PCM_FIQ)
  32. int imx_pcm_fiq_init(struct platform_device *pdev,
  33. struct imx_pcm_fiq_params *params);
  34. void imx_pcm_fiq_exit(struct platform_device *pdev);
  35. #else
  36. static inline int imx_pcm_fiq_init(struct platform_device *pdev,
  37. struct imx_pcm_fiq_params *params)
  38. {
  39. return -ENODEV;
  40. }
  41. static inline void imx_pcm_fiq_exit(struct platform_device *pdev)
  42. {
  43. }
  44. #endif
  45. #endif /* _IMX_PCM_H */