diff options
Diffstat (limited to 'sound/soc/pxa/pxa-ssp.c')
-rw-r--r-- | sound/soc/pxa/pxa-ssp.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index e69397f40f72..5d65a00e4bc0 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c | |||
@@ -103,10 +103,9 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream, | |||
103 | ssp_disable(&priv->dev); | 103 | ssp_disable(&priv->dev); |
104 | } | 104 | } |
105 | 105 | ||
106 | if (cpu_dai->dma_data) { | 106 | kfree(snd_soc_dai_get_dma_data(cpu_dai, substream)); |
107 | kfree(cpu_dai->dma_data); | 107 | snd_soc_dai_set_dma_data(cpu_dai, substream, NULL); |
108 | cpu_dai->dma_data = NULL; | 108 | |
109 | } | ||
110 | return ret; | 109 | return ret; |
111 | } | 110 | } |
112 | 111 | ||
@@ -122,10 +121,8 @@ static void pxa_ssp_shutdown(struct snd_pcm_substream *substream, | |||
122 | clk_disable(priv->dev.ssp->clk); | 121 | clk_disable(priv->dev.ssp->clk); |
123 | } | 122 | } |
124 | 123 | ||
125 | if (cpu_dai->dma_data) { | 124 | kfree(snd_soc_dai_get_dma_data(cpu_dai, substream)); |
126 | kfree(cpu_dai->dma_data); | 125 | snd_soc_dai_set_dma_data(cpu_dai, substream, NULL); |
127 | cpu_dai->dma_data = NULL; | ||
128 | } | ||
129 | } | 126 | } |
130 | 127 | ||
131 | #ifdef CONFIG_PM | 128 | #ifdef CONFIG_PM |
@@ -538,19 +535,23 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream, | |||
538 | u32 sspsp; | 535 | u32 sspsp; |
539 | int width = snd_pcm_format_physical_width(params_format(params)); | 536 | int width = snd_pcm_format_physical_width(params_format(params)); |
540 | int ttsa = ssp_read_reg(ssp, SSTSA) & 0xf; | 537 | int ttsa = ssp_read_reg(ssp, SSTSA) & 0xf; |
538 | struct pxa2xx_pcm_dma_params *dma_data; | ||
539 | |||
540 | dma_data = snd_soc_dai_get_dma_data(dai, substream); | ||
541 | 541 | ||
542 | /* generate correct DMA params */ | 542 | /* generate correct DMA params */ |
543 | if (cpu_dai->dma_data) | 543 | kfree(dma_data); |
544 | kfree(cpu_dai->dma_data); | ||
545 | 544 | ||
546 | /* Network mode with one active slot (ttsa == 1) can be used | 545 | /* Network mode with one active slot (ttsa == 1) can be used |
547 | * to force 16-bit frame width on the wire (for S16_LE), even | 546 | * to force 16-bit frame width on the wire (for S16_LE), even |
548 | * with two channels. Use 16-bit DMA transfers for this case. | 547 | * with two channels. Use 16-bit DMA transfers for this case. |
549 | */ | 548 | */ |
550 | cpu_dai->dma_data = ssp_get_dma_params(ssp, | 549 | dma_data = ssp_get_dma_params(ssp, |
551 | ((chn == 2) && (ttsa != 1)) || (width == 32), | 550 | ((chn == 2) && (ttsa != 1)) || (width == 32), |
552 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK); | 551 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK); |
553 | 552 | ||
553 | snd_soc_dai_set_dma_data(dai, substream, dma_data); | ||
554 | |||
554 | /* we can only change the settings if the port is not in use */ | 555 | /* we can only change the settings if the port is not in use */ |
555 | if (ssp_read_reg(ssp, SSCR0) & SSCR0_SSE) | 556 | if (ssp_read_reg(ssp, SSCR0) & SSCR0_SSE) |
556 | return 0; | 557 | return 0; |