aboutsummaryrefslogtreecommitdiffstats
path: root/sound/arm
diff options
context:
space:
mode:
Diffstat (limited to 'sound/arm')
-rw-r--r--sound/arm/pxa2xx-ac97.c10
-rw-r--r--sound/arm/pxa2xx-pcm-lib.c3
2 files changed, 13 insertions, 0 deletions
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c
index 9c12563db1c4..b4b48afb6de6 100644
--- a/sound/arm/pxa2xx-ac97.c
+++ b/sound/arm/pxa2xx-ac97.c
@@ -171,6 +171,13 @@ static int __devinit pxa2xx_ac97_probe(struct platform_device *dev)
171 struct snd_ac97_bus *ac97_bus; 171 struct snd_ac97_bus *ac97_bus;
172 struct snd_ac97_template ac97_template; 172 struct snd_ac97_template ac97_template;
173 int ret; 173 int ret;
174 pxa2xx_audio_ops_t *pdata = dev->dev.platform_data;
175
176 if (dev->id >= 0) {
177 dev_err(&dev->dev, "PXA2xx has only one AC97 port.\n");
178 ret = -ENXIO;
179 goto err_dev;
180 }
174 181
175 ret = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, 182 ret = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
176 THIS_MODULE, 0, &card); 183 THIS_MODULE, 0, &card);
@@ -201,6 +208,8 @@ static int __devinit pxa2xx_ac97_probe(struct platform_device *dev)
201 snprintf(card->longname, sizeof(card->longname), 208 snprintf(card->longname, sizeof(card->longname),
202 "%s (%s)", dev->dev.driver->name, card->mixername); 209 "%s (%s)", dev->dev.driver->name, card->mixername);
203 210
211 if (pdata && pdata->codec_pdata[0])
212 snd_ac97_dev_add_pdata(ac97_bus->codec[0], pdata->codec_pdata[0]);
204 snd_card_set_dev(card, &dev->dev); 213 snd_card_set_dev(card, &dev->dev);
205 ret = snd_card_register(card); 214 ret = snd_card_register(card);
206 if (ret == 0) { 215 if (ret == 0) {
@@ -213,6 +222,7 @@ err_remove:
213err: 222err:
214 if (card) 223 if (card)
215 snd_card_free(card); 224 snd_card_free(card);
225err_dev:
216 return ret; 226 return ret;
217} 227}
218 228
diff --git a/sound/arm/pxa2xx-pcm-lib.c b/sound/arm/pxa2xx-pcm-lib.c
index 6205f37d547c..743ac6a29065 100644
--- a/sound/arm/pxa2xx-pcm-lib.c
+++ b/sound/arm/pxa2xx-pcm-lib.c
@@ -136,6 +136,9 @@ int __pxa2xx_pcm_prepare(struct snd_pcm_substream *substream)
136{ 136{
137 struct pxa2xx_runtime_data *prtd = substream->runtime->private_data; 137 struct pxa2xx_runtime_data *prtd = substream->runtime->private_data;
138 138
139 if (!prtd || !prtd->params)
140 return 0;
141
139 DCSR(prtd->dma_ch) &= ~DCSR_RUN; 142 DCSR(prtd->dma_ch) &= ~DCSR_RUN;
140 DCSR(prtd->dma_ch) = 0; 143 DCSR(prtd->dma_ch) = 0;
141 DCMD(prtd->dma_ch) = 0; 144 DCMD(prtd->dma_ch) = 0;