diff options
Diffstat (limited to 'sound/soc/pxa/mmp-pcm.c')
-rw-r--r-- | sound/soc/pxa/mmp-pcm.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/sound/soc/pxa/mmp-pcm.c b/sound/soc/pxa/mmp-pcm.c index 7929e19b0ef5..5e8d81330173 100644 --- a/sound/soc/pxa/mmp-pcm.c +++ b/sound/soc/pxa/mmp-pcm.c | |||
@@ -36,14 +36,9 @@ struct mmp_dma_data { | |||
36 | SNDRV_PCM_INFO_PAUSE | \ | 36 | SNDRV_PCM_INFO_PAUSE | \ |
37 | SNDRV_PCM_INFO_RESUME) | 37 | SNDRV_PCM_INFO_RESUME) |
38 | 38 | ||
39 | #define MMP_PCM_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ | ||
40 | SNDRV_PCM_FMTBIT_S24_LE | \ | ||
41 | SNDRV_PCM_FMTBIT_S32_LE) | ||
42 | |||
43 | static struct snd_pcm_hardware mmp_pcm_hardware[] = { | 39 | static struct snd_pcm_hardware mmp_pcm_hardware[] = { |
44 | { | 40 | { |
45 | .info = MMP_PCM_INFO, | 41 | .info = MMP_PCM_INFO, |
46 | .formats = MMP_PCM_FORMATS, | ||
47 | .period_bytes_min = 1024, | 42 | .period_bytes_min = 1024, |
48 | .period_bytes_max = 2048, | 43 | .period_bytes_max = 2048, |
49 | .periods_min = 2, | 44 | .periods_min = 2, |
@@ -53,7 +48,6 @@ static struct snd_pcm_hardware mmp_pcm_hardware[] = { | |||
53 | }, | 48 | }, |
54 | { | 49 | { |
55 | .info = MMP_PCM_INFO, | 50 | .info = MMP_PCM_INFO, |
56 | .formats = MMP_PCM_FORMATS, | ||
57 | .period_bytes_min = 1024, | 51 | .period_bytes_min = 1024, |
58 | .period_bytes_max = 2048, | 52 | .period_bytes_max = 2048, |
59 | .periods_min = 2, | 53 | .periods_min = 2, |
@@ -67,27 +61,15 @@ static int mmp_pcm_hw_params(struct snd_pcm_substream *substream, | |||
67 | struct snd_pcm_hw_params *params) | 61 | struct snd_pcm_hw_params *params) |
68 | { | 62 | { |
69 | struct dma_chan *chan = snd_dmaengine_pcm_get_chan(substream); | 63 | struct dma_chan *chan = snd_dmaengine_pcm_get_chan(substream); |
70 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
71 | struct snd_dmaengine_dai_dma_data *dma_params; | ||
72 | struct dma_slave_config slave_config; | 64 | struct dma_slave_config slave_config; |
73 | int ret; | 65 | int ret; |
74 | 66 | ||
75 | dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); | 67 | ret = |
76 | if (!dma_params) | 68 | snd_dmaengine_pcm_prepare_slave_config(substream, params, |
77 | return 0; | 69 | &slave_config); |
78 | |||
79 | ret = snd_hwparams_to_dma_slave_config(substream, params, &slave_config); | ||
80 | if (ret) | 70 | if (ret) |
81 | return ret; | 71 | return ret; |
82 | 72 | ||
83 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | ||
84 | slave_config.dst_addr = dma_params->addr; | ||
85 | slave_config.dst_maxburst = 4; | ||
86 | } else { | ||
87 | slave_config.src_addr = dma_params->addr; | ||
88 | slave_config.src_maxburst = 4; | ||
89 | } | ||
90 | |||
91 | ret = dmaengine_slave_config(chan, &slave_config); | 73 | ret = dmaengine_slave_config(chan, &slave_config); |
92 | if (ret) | 74 | if (ret) |
93 | return ret; | 75 | return ret; |