aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-04-07 11:42:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-04-07 11:42:25 -0400
commit84db18bbeb5c9c1a9c86e38a89d76ee526fd2c6f (patch)
tree49d3959eb24cd7c0754ed50e05fb96b0fb8d04aa /sound/soc/pxa
parent6948ec70355ae6cf6082519e3d76b280373dade1 (diff)
parent55b371d4ac5ed6f3338a398fbf9f2eb9ace78799 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: ALSA: mixart: range checking proc file ALSA: hda - Fix a wrong array range check in patch_realtek.c ALSA: ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream ALSA: hda - Enable amplifiers on Acer Inspire 6530G ASoC: Only do WM8994 bias off transition from standby ASoC: Don't use DCS_DATAPATH_BUSY for WM hubs devices ASoC: Don't do runtime wm_hubs DC servo updates if using offset correction ASoC: Support second DC servo readback method for wm_hubs ASoC: Avoid wraparound in wm_hubs DC servo correction ALSA: echoaudio - Eliminate use after free ALSA: i2c: cleanup: change parameter to pointer ALSA: hda - Add MSI blacklist for Aopen MZ915-M ASoC: OMAP: Fix capture pointer handling for OMAP1510 to work correctly with recent ALSA PCM code ALSA: hda - Update document about MSI and interrupts ALSA: hda: Fix 0 dB offset for Lenovo Thinkpad models using AD1981 ALSA: hda - Add missing printk argument in previous patch ASoC: Fix passing platform_data to ac97 bus users and fix a leak ALSA: hda - Fix ADC/MUX assignment of ALC269 codec ALSA: hda - Fix invalid bit values passed to snd_hda_codec_amp_stereo() ASoC: wm8994: playback => capture
Diffstat (limited to 'sound/soc/pxa')
-rw-r--r--sound/soc/pxa/pxa-ssp.c23
-rw-r--r--sound/soc/pxa/pxa2xx-ac97.c17
-rw-r--r--sound/soc/pxa/pxa2xx-i2s.c7
-rw-r--r--sound/soc/pxa/pxa2xx-pcm.c4
4 files changed, 32 insertions, 19 deletions
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
index d5fc52d0a3c4..544fd9566f4d 100644
--- a/sound/soc/pxa/pxa-ssp.c
+++ b/sound/soc/pxa/pxa-ssp.c
@@ -122,10 +122,9 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream,
122 ssp_disable(ssp); 122 ssp_disable(ssp);
123 } 123 }
124 124
125 if (cpu_dai->dma_data) { 125 kfree(snd_soc_dai_get_dma_data(cpu_dai, substream));
126 kfree(cpu_dai->dma_data); 126 snd_soc_dai_set_dma_data(cpu_dai, substream, NULL);
127 cpu_dai->dma_data = NULL; 127
128 }
129 return ret; 128 return ret;
130} 129}
131 130
@@ -142,10 +141,8 @@ static void pxa_ssp_shutdown(struct snd_pcm_substream *substream,
142 clk_disable(ssp->clk); 141 clk_disable(ssp->clk);
143 } 142 }
144 143
145 if (cpu_dai->dma_data) { 144 kfree(snd_soc_dai_get_dma_data(cpu_dai, substream));
146 kfree(cpu_dai->dma_data); 145 snd_soc_dai_set_dma_data(cpu_dai, substream, NULL);
147 cpu_dai->dma_data = NULL;
148 }
149} 146}
150 147
151#ifdef CONFIG_PM 148#ifdef CONFIG_PM
@@ -570,19 +567,23 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
570 u32 sspsp; 567 u32 sspsp;
571 int width = snd_pcm_format_physical_width(params_format(params)); 568 int width = snd_pcm_format_physical_width(params_format(params));
572 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);
573 573
574 /* generate correct DMA params */ 574 /* generate correct DMA params */
575 if (cpu_dai->dma_data) 575 kfree(dma_data);
576 kfree(cpu_dai->dma_data);
577 576
578 /* Network mode with one active slot (ttsa == 1) can be used 577 /* Network mode with one active slot (ttsa == 1) can be used
579 * 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
580 * with two channels. Use 16-bit DMA transfers for this case. 579 * with two channels. Use 16-bit DMA transfers for this case.
581 */ 580 */
582 cpu_dai->dma_data = ssp_get_dma_params(ssp, 581 dma_data = ssp_get_dma_params(ssp,
583 ((chn == 2) && (ttsa != 1)) || (width == 32), 582 ((chn == 2) && (ttsa != 1)) || (width == 32),
584 substream->stream == SNDRV_PCM_STREAM_PLAYBACK); 583 substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
585 584
585 snd_soc_dai_set_dma_data(dai, substream, dma_data);
586
586 /* 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 */
587 if (ssp_read_reg(ssp, SSCR0) & SSCR0_SSE) 588 if (ssp_read_reg(ssp, SSCR0) & SSCR0_SSE)
588 return 0; 589 return 0;
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index e9ae7b3a7e00..d314115e3dd7 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -122,11 +122,14 @@ static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream,
122{ 122{
123 struct snd_soc_pcm_runtime *rtd = substream->private_data; 123 struct snd_soc_pcm_runtime *rtd = substream->private_data;
124 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 124 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
125 struct pxa2xx_pcm_dma_params *dma_data;
125 126
126 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 127 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
127 cpu_dai->dma_data = &pxa2xx_ac97_pcm_stereo_out; 128 dma_data = &pxa2xx_ac97_pcm_stereo_out;
128 else 129 else
129 cpu_dai->dma_data = &pxa2xx_ac97_pcm_stereo_in; 130 dma_data = &pxa2xx_ac97_pcm_stereo_in;
131
132 snd_soc_dai_set_dma_data(cpu_dai, substream, dma_data);
130 133
131 return 0; 134 return 0;
132} 135}
@@ -137,11 +140,14 @@ static int pxa2xx_ac97_hw_aux_params(struct snd_pcm_substream *substream,
137{ 140{
138 struct snd_soc_pcm_runtime *rtd = substream->private_data; 141 struct snd_soc_pcm_runtime *rtd = substream->private_data;
139 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 142 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
143 struct pxa2xx_pcm_dma_params *dma_data;
140 144
141 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 145 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
142 cpu_dai->dma_data = &pxa2xx_ac97_pcm_aux_mono_out; 146 dma_data = &pxa2xx_ac97_pcm_aux_mono_out;
143 else 147 else
144 cpu_dai->dma_data = &pxa2xx_ac97_pcm_aux_mono_in; 148 dma_data = &pxa2xx_ac97_pcm_aux_mono_in;
149
150 snd_soc_dai_set_dma_data(cpu_dai, substream, dma_data);
145 151
146 return 0; 152 return 0;
147} 153}
@@ -156,7 +162,8 @@ static int pxa2xx_ac97_hw_mic_params(struct snd_pcm_substream *substream,
156 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 162 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
157 return -ENODEV; 163 return -ENODEV;
158 else 164 else
159 cpu_dai->dma_data = &pxa2xx_ac97_pcm_mic_mono_in; 165 snd_soc_dai_set_dma_data(cpu_dai, substream,
166 &pxa2xx_ac97_pcm_mic_mono_in);
160 167
161 return 0; 168 return 0;
162} 169}
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c
index 6b8f655d1ad8..c1a5275721e4 100644
--- a/sound/soc/pxa/pxa2xx-i2s.c
+++ b/sound/soc/pxa/pxa2xx-i2s.c
@@ -164,6 +164,7 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream,
164{ 164{
165 struct snd_soc_pcm_runtime *rtd = substream->private_data; 165 struct snd_soc_pcm_runtime *rtd = substream->private_data;
166 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 166 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
167 struct pxa2xx_pcm_dma_params *dma_data;
167 168
168 BUG_ON(IS_ERR(clk_i2s)); 169 BUG_ON(IS_ERR(clk_i2s));
169 clk_enable(clk_i2s); 170 clk_enable(clk_i2s);
@@ -171,9 +172,11 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream,
171 pxa_i2s_wait(); 172 pxa_i2s_wait();
172 173
173 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 174 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
174 cpu_dai->dma_data = &pxa2xx_i2s_pcm_stereo_out; 175 dma_data = &pxa2xx_i2s_pcm_stereo_out;
175 else 176 else
176 cpu_dai->dma_data = &pxa2xx_i2s_pcm_stereo_in; 177 dma_data = &pxa2xx_i2s_pcm_stereo_in;
178
179 snd_soc_dai_set_dma_data(cpu_dai, substream, dma_data);
177 180
178 /* is port used by another stream */ 181 /* is port used by another stream */
179 if (!(SACR0 & SACR0_ENB)) { 182 if (!(SACR0 & SACR0_ENB)) {
diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c
index d38e39575f51..adc7e6f15f93 100644
--- a/sound/soc/pxa/pxa2xx-pcm.c
+++ b/sound/soc/pxa/pxa2xx-pcm.c
@@ -25,9 +25,11 @@ static int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
25 struct snd_pcm_runtime *runtime = substream->runtime; 25 struct snd_pcm_runtime *runtime = substream->runtime;
26 struct pxa2xx_runtime_data *prtd = runtime->private_data; 26 struct pxa2xx_runtime_data *prtd = runtime->private_data;
27 struct snd_soc_pcm_runtime *rtd = substream->private_data; 27 struct snd_soc_pcm_runtime *rtd = substream->private_data;
28 struct pxa2xx_pcm_dma_params *dma = rtd->dai->cpu_dai->dma_data; 28 struct pxa2xx_pcm_dma_params *dma;
29 int ret; 29 int ret;
30 30
31 dma = snd_soc_dai_get_dma_data(rtd->dai->cpu_dai, substream);
32
31 /* return if this is a bufferless transfer e.g. 33 /* return if this is a bufferless transfer e.g.
32 * codec <--> BT codec or GSM modem -- lg FIXME */ 34 * codec <--> BT codec or GSM modem -- lg FIXME */
33 if (!dma) 35 if (!dma)