aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa/pxa-ssp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/pxa/pxa-ssp.c')
-rw-r--r--sound/soc/pxa/pxa-ssp.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
index 9e95e5117c88..544fd9566f4d 100644
--- a/sound/soc/pxa/pxa-ssp.c
+++ b/sound/soc/pxa/pxa-ssp.c
@@ -16,6 +16,7 @@
16 16
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/slab.h>
19#include <linux/platform_device.h> 20#include <linux/platform_device.h>
20#include <linux/clk.h> 21#include <linux/clk.h>
21#include <linux/io.h> 22#include <linux/io.h>
@@ -121,10 +122,9 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream,
121 ssp_disable(ssp); 122 ssp_disable(ssp);
122 } 123 }
123 124
124 if (cpu_dai->dma_data) { 125 kfree(snd_soc_dai_get_dma_data(cpu_dai, substream));
125 kfree(cpu_dai->dma_data); 126 snd_soc_dai_set_dma_data(cpu_dai, substream, NULL);
126 cpu_dai->dma_data = NULL; 127
127 }
128 return ret; 128 return ret;
129} 129}
130 130
@@ -141,10 +141,8 @@ static void pxa_ssp_shutdown(struct snd_pcm_substream *substream,
141 clk_disable(ssp->clk); 141 clk_disable(ssp->clk);
142 } 142 }
143 143
144 if (cpu_dai->dma_data) { 144 kfree(snd_soc_dai_get_dma_data(cpu_dai, substream));
145 kfree(cpu_dai->dma_data); 145 snd_soc_dai_set_dma_data(cpu_dai, substream, NULL);
146 cpu_dai->dma_data = NULL;
147 }
148} 146}
149 147
150#ifdef CONFIG_PM 148#ifdef CONFIG_PM
@@ -569,19 +567,23 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
569 u32 sspsp; 567 u32 sspsp;
570 int width = snd_pcm_format_physical_width(params_format(params)); 568 int width = snd_pcm_format_physical_width(params_format(params));
571 int ttsa = ssp_read_reg(ssp, SSTSA) & 0xf; 569 int ttsa = ssp_read_reg(ssp, SSTSA) & 0xf;
570 struct pxa2xx_pcm_dma_params *dma_data;
571
572 dma_data = snd_soc_dai_get_dma_data(dai, substream);
572 573
573 /* generate correct DMA params */ 574 /* generate correct DMA params */
574 if (cpu_dai->dma_data) 575 kfree(dma_data);
575 kfree(cpu_dai->dma_data);
576 576
577 /* Network mode with one active slot (ttsa == 1) can be used 577 /* Network mode with one active slot (ttsa == 1) can be used
578 * to force 16-bit frame width on the wire (for S16_LE), even 578 * to force 16-bit frame width on the wire (for S16_LE), even
579 * with two channels. Use 16-bit DMA transfers for this case. 579 * with two channels. Use 16-bit DMA transfers for this case.
580 */ 580 */
581 cpu_dai->dma_data = ssp_get_dma_params(ssp, 581 dma_data = ssp_get_dma_params(ssp,
582 ((chn == 2) && (ttsa != 1)) || (width == 32), 582 ((chn == 2) && (ttsa != 1)) || (width == 32),
583 substream->stream == SNDRV_PCM_STREAM_PLAYBACK); 583 substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
584 584
585 snd_soc_dai_set_dma_data(dai, substream, dma_data);
586
585 /* we can only change the settings if the port is not in use */ 587 /* we can only change the settings if the port is not in use */
586 if (ssp_read_reg(ssp, SSCR0) & SSCR0_SSE) 588 if (ssp_read_reg(ssp, SSCR0) & SSCR0_SSE)
587 return 0; 589 return 0;