Commit | Line | Data |
---|---|---|
1c05c1ed | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
4762fbab SG |
2 | /* |
3 | * Copyright 2009 Sascha Hauer <s.hauer@pengutronix.de> | |
4 | * | |
5 | * This code is based on code copyrighted by Freescale, | |
6 | * Liam Girdwood, Javier Martin and probably others. | |
4762fbab SG |
7 | */ |
8 | ||
9 | #ifndef _IMX_PCM_H | |
10 | #define _IMX_PCM_H | |
11 | ||
312bb4f6 LPC |
12 | #include <linux/platform_data/dma-imx.h> |
13 | ||
4762fbab SG |
14 | /* |
15 | * Do not change this as the FIQ handler depends on this size | |
16 | */ | |
17 | #define IMX_SSI_DMABUF_SIZE (64 * 1024) | |
18 | ||
0d69e0dd SW |
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) | |
23 | ||
312bb4f6 | 24 | static inline void |
a8909c9b | 25 | imx_pcm_dma_params_init_data(struct imx_dma_data *dma_data, |
32bd8cd2 | 26 | int dma, enum sdma_peripheral_type peripheral_type) |
312bb4f6 | 27 | { |
a8909c9b LPC |
28 | dma_data->dma_request = dma; |
29 | dma_data->priority = DMA_PRIO_HIGH; | |
32bd8cd2 | 30 | dma_data->peripheral_type = peripheral_type; |
312bb4f6 LPC |
31 | } |
32 | ||
9051cba1 MP |
33 | struct imx_pcm_fiq_params { |
34 | int irq; | |
35 | void __iomem *base; | |
36 | ||
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; | |
40 | }; | |
41 | ||
3f1a91aa | 42 | #if IS_ENABLED(CONFIG_SND_SOC_IMX_PCM_DMA) |
0d69e0dd | 43 | int imx_pcm_dma_init(struct platform_device *pdev, size_t size); |
1927661b | 44 | #else |
0d69e0dd | 45 | static inline int imx_pcm_dma_init(struct platform_device *pdev, size_t size) |
1927661b SG |
46 | { |
47 | return -ENODEV; | |
48 | } | |
49 | #endif | |
50 | ||
3f1a91aa | 51 | #if IS_ENABLED(CONFIG_SND_SOC_IMX_PCM_FIQ) |
9051cba1 MP |
52 | int imx_pcm_fiq_init(struct platform_device *pdev, |
53 | struct imx_pcm_fiq_params *params); | |
88e89f55 | 54 | void imx_pcm_fiq_exit(struct platform_device *pdev); |
1927661b | 55 | #else |
9051cba1 MP |
56 | static inline int imx_pcm_fiq_init(struct platform_device *pdev, |
57 | struct imx_pcm_fiq_params *params) | |
1927661b SG |
58 | { |
59 | return -ENODEV; | |
60 | } | |
88e89f55 SG |
61 | |
62 | static inline void imx_pcm_fiq_exit(struct platform_device *pdev) | |
63 | { | |
64 | } | |
1927661b SG |
65 | #endif |
66 | ||
4762fbab | 67 | #endif /* _IMX_PCM_H */ |