treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / sound / soc / fsl / imx-pcm.h
blob5dd406774d3eac48f0dc473fe595e1115a11dd85
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3 * Copyright 2009 Sascha Hauer <s.hauer@pengutronix.de>
5 * This code is based on code copyrighted by Freescale,
6 * Liam Girdwood, Javier Martin and probably others.
7 */
9 #ifndef _IMX_PCM_H
10 #define _IMX_PCM_H
12 #include <linux/platform_data/dma-imx.h>
15 * Do not change this as the FIQ handler depends on this size
17 #define IMX_SSI_DMABUF_SIZE (64 * 1024)
19 #define IMX_DEFAULT_DMABUF_SIZE (64 * 1024)
20 #define IMX_SAI_DMABUF_SIZE (64 * 1024)
21 #define IMX_SPDIF_DMABUF_SIZE (64 * 1024)
22 #define IMX_ESAI_DMABUF_SIZE (256 * 1024)
24 static inline void
25 imx_pcm_dma_params_init_data(struct imx_dma_data *dma_data,
26 int dma, enum sdma_peripheral_type peripheral_type)
28 dma_data->dma_request = dma;
29 dma_data->priority = DMA_PRIO_HIGH;
30 dma_data->peripheral_type = peripheral_type;
33 struct imx_pcm_fiq_params {
34 int irq;
35 void __iomem *base;
37 /* Pointer to original ssi driver to setup tx rx sizes */
38 struct snd_dmaengine_dai_dma_data *dma_params_rx;
39 struct snd_dmaengine_dai_dma_data *dma_params_tx;
42 #if IS_ENABLED(CONFIG_SND_SOC_IMX_PCM_DMA)
43 int imx_pcm_dma_init(struct platform_device *pdev, size_t size);
44 #else
45 static inline int imx_pcm_dma_init(struct platform_device *pdev, size_t size)
47 return -ENODEV;
49 #endif
51 #if IS_ENABLED(CONFIG_SND_SOC_IMX_PCM_FIQ)
52 int imx_pcm_fiq_init(struct platform_device *pdev,
53 struct imx_pcm_fiq_params *params);
54 void imx_pcm_fiq_exit(struct platform_device *pdev);
55 #else
56 static inline int imx_pcm_fiq_init(struct platform_device *pdev,
57 struct imx_pcm_fiq_params *params)
59 return -ENODEV;
62 static inline void imx_pcm_fiq_exit(struct platform_device *pdev)
65 #endif
67 #endif /* _IMX_PCM_H */