diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/atmel/Kconfig | 2 | ||||
-rw-r--r-- | sound/soc/atmel/atmel-pcm.c | 5 | ||||
-rw-r--r-- | sound/soc/blackfin/bf5xx-ac97-pcm.c | 5 | ||||
-rw-r--r-- | sound/soc/blackfin/bf5xx-i2s-pcm.c | 5 | ||||
-rw-r--r-- | sound/soc/blackfin/bf5xx-tdm-pcm.c | 5 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-pcm.c | 5 | ||||
-rw-r--r-- | sound/soc/ep93xx/ep93xx-pcm.c | 5 | ||||
-rw-r--r-- | sound/soc/jz4740/jz4740-pcm.c | 5 | ||||
-rw-r--r-- | sound/soc/kirkwood/kirkwood-dma.c | 5 | ||||
-rw-r--r-- | sound/soc/mid-x86/sst_platform.c | 5 | ||||
-rw-r--r-- | sound/soc/omap/omap-pcm.c | 5 | ||||
-rw-r--r-- | sound/soc/samsung/dma.c | 5 | ||||
-rw-r--r-- | sound/soc/samsung/idma.c | 4 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 44 | ||||
-rw-r--r-- | sound/soc/soc-dapm.c | 3 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_pcm.c | 5 |
16 files changed, 53 insertions, 60 deletions
diff --git a/sound/soc/atmel/Kconfig b/sound/soc/atmel/Kconfig index d1fcc816ce97..72b09cfd3dc3 100644 --- a/sound/soc/atmel/Kconfig +++ b/sound/soc/atmel/Kconfig | |||
@@ -26,7 +26,7 @@ config SND_AT91_SOC_SAM9G20_WM8731 | |||
26 | 26 | ||
27 | config SND_AT91_SOC_AFEB9260 | 27 | config SND_AT91_SOC_AFEB9260 |
28 | tristate "SoC Audio support for AFEB9260 board" | 28 | tristate "SoC Audio support for AFEB9260 board" |
29 | depends on ARCH_AT91 && MACH_AFEB9260 && SND_ATMEL_SOC | 29 | depends on ATMEL_SSC && ARCH_AT91 && MACH_AFEB9260 && SND_ATMEL_SOC |
30 | select SND_ATMEL_SOC_SSC | 30 | select SND_ATMEL_SOC_SSC |
31 | select SND_SOC_TLV320AIC23 | 31 | select SND_SOC_TLV320AIC23 |
32 | help | 32 | help |
diff --git a/sound/soc/atmel/atmel-pcm.c b/sound/soc/atmel/atmel-pcm.c index 60de05525c06..a21ff459e5d3 100644 --- a/sound/soc/atmel/atmel-pcm.c +++ b/sound/soc/atmel/atmel-pcm.c | |||
@@ -367,7 +367,6 @@ static u64 atmel_pcm_dmamask = 0xffffffff; | |||
367 | static int atmel_pcm_new(struct snd_soc_pcm_runtime *rtd) | 367 | static int atmel_pcm_new(struct snd_soc_pcm_runtime *rtd) |
368 | { | 368 | { |
369 | struct snd_card *card = rtd->card->snd_card; | 369 | struct snd_card *card = rtd->card->snd_card; |
370 | struct snd_soc_dai *dai = rtd->cpu_dai; | ||
371 | struct snd_pcm *pcm = rtd->pcm; | 370 | struct snd_pcm *pcm = rtd->pcm; |
372 | int ret = 0; | 371 | int ret = 0; |
373 | 372 | ||
@@ -376,14 +375,14 @@ static int atmel_pcm_new(struct snd_soc_pcm_runtime *rtd) | |||
376 | if (!card->dev->coherent_dma_mask) | 375 | if (!card->dev->coherent_dma_mask) |
377 | card->dev->coherent_dma_mask = 0xffffffff; | 376 | card->dev->coherent_dma_mask = 0xffffffff; |
378 | 377 | ||
379 | if (dai->driver->playback.channels_min) { | 378 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
380 | ret = atmel_pcm_preallocate_dma_buffer(pcm, | 379 | ret = atmel_pcm_preallocate_dma_buffer(pcm, |
381 | SNDRV_PCM_STREAM_PLAYBACK); | 380 | SNDRV_PCM_STREAM_PLAYBACK); |
382 | if (ret) | 381 | if (ret) |
383 | goto out; | 382 | goto out; |
384 | } | 383 | } |
385 | 384 | ||
386 | if (dai->driver->capture.channels_min) { | 385 | if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
387 | pr_debug("atmel-pcm:" | 386 | pr_debug("atmel-pcm:" |
388 | "Allocating PCM capture DMA buffer\n"); | 387 | "Allocating PCM capture DMA buffer\n"); |
389 | ret = atmel_pcm_preallocate_dma_buffer(pcm, | 388 | ret = atmel_pcm_preallocate_dma_buffer(pcm, |
diff --git a/sound/soc/blackfin/bf5xx-ac97-pcm.c b/sound/soc/blackfin/bf5xx-ac97-pcm.c index fcff58390848..d7dc9bde0976 100644 --- a/sound/soc/blackfin/bf5xx-ac97-pcm.c +++ b/sound/soc/blackfin/bf5xx-ac97-pcm.c | |||
@@ -421,7 +421,6 @@ static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32); | |||
421 | static int bf5xx_pcm_ac97_new(struct snd_soc_pcm_runtime *rtd) | 421 | static int bf5xx_pcm_ac97_new(struct snd_soc_pcm_runtime *rtd) |
422 | { | 422 | { |
423 | struct snd_card *card = rtd->card->snd_card; | 423 | struct snd_card *card = rtd->card->snd_card; |
424 | struct snd_soc_dai *dai = rtd->cpu_dai; | ||
425 | struct snd_pcm *pcm = rtd->pcm; | 424 | struct snd_pcm *pcm = rtd->pcm; |
426 | int ret = 0; | 425 | int ret = 0; |
427 | 426 | ||
@@ -431,14 +430,14 @@ static int bf5xx_pcm_ac97_new(struct snd_soc_pcm_runtime *rtd) | |||
431 | if (!card->dev->coherent_dma_mask) | 430 | if (!card->dev->coherent_dma_mask) |
432 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); | 431 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); |
433 | 432 | ||
434 | if (dai->driver->playback.channels_min) { | 433 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
435 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, | 434 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, |
436 | SNDRV_PCM_STREAM_PLAYBACK); | 435 | SNDRV_PCM_STREAM_PLAYBACK); |
437 | if (ret) | 436 | if (ret) |
438 | goto out; | 437 | goto out; |
439 | } | 438 | } |
440 | 439 | ||
441 | if (dai->driver->capture.channels_min) { | 440 | if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
442 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, | 441 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, |
443 | SNDRV_PCM_STREAM_CAPTURE); | 442 | SNDRV_PCM_STREAM_CAPTURE); |
444 | if (ret) | 443 | if (ret) |
diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c b/sound/soc/blackfin/bf5xx-i2s-pcm.c index 6ec3d41b9b6d..63205d723eab 100644 --- a/sound/soc/blackfin/bf5xx-i2s-pcm.c +++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c | |||
@@ -260,7 +260,6 @@ static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32); | |||
260 | static int bf5xx_pcm_i2s_new(struct snd_soc_pcm_runtime *rtd) | 260 | static int bf5xx_pcm_i2s_new(struct snd_soc_pcm_runtime *rtd) |
261 | { | 261 | { |
262 | struct snd_card *card = rtd->card->snd_card; | 262 | struct snd_card *card = rtd->card->snd_card; |
263 | struct snd_soc_dai *dai = rtd->cpu_dai; | ||
264 | struct snd_pcm *pcm = rtd->pcm; | 263 | struct snd_pcm *pcm = rtd->pcm; |
265 | int ret = 0; | 264 | int ret = 0; |
266 | 265 | ||
@@ -270,14 +269,14 @@ static int bf5xx_pcm_i2s_new(struct snd_soc_pcm_runtime *rtd) | |||
270 | if (!card->dev->coherent_dma_mask) | 269 | if (!card->dev->coherent_dma_mask) |
271 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); | 270 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); |
272 | 271 | ||
273 | if (dai->driver->playback.channels_min) { | 272 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
274 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, | 273 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, |
275 | SNDRV_PCM_STREAM_PLAYBACK); | 274 | SNDRV_PCM_STREAM_PLAYBACK); |
276 | if (ret) | 275 | if (ret) |
277 | goto out; | 276 | goto out; |
278 | } | 277 | } |
279 | 278 | ||
280 | if (dai->driver->capture.channels_min) { | 279 | if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
281 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, | 280 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, |
282 | SNDRV_PCM_STREAM_CAPTURE); | 281 | SNDRV_PCM_STREAM_CAPTURE); |
283 | if (ret) | 282 | if (ret) |
diff --git a/sound/soc/blackfin/bf5xx-tdm-pcm.c b/sound/soc/blackfin/bf5xx-tdm-pcm.c index 4406f9a865ae..254490cf1876 100644 --- a/sound/soc/blackfin/bf5xx-tdm-pcm.c +++ b/sound/soc/blackfin/bf5xx-tdm-pcm.c | |||
@@ -286,7 +286,6 @@ static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32); | |||
286 | static int bf5xx_pcm_tdm_new(struct snd_soc_pcm_runtime *rtd) | 286 | static int bf5xx_pcm_tdm_new(struct snd_soc_pcm_runtime *rtd) |
287 | { | 287 | { |
288 | struct snd_card *card = rtd->card->snd_card; | 288 | struct snd_card *card = rtd->card->snd_card; |
289 | struct snd_soc_dai *dai = rtd->cpu_dai; | ||
290 | struct snd_pcm *pcm = rtd->pcm; | 289 | struct snd_pcm *pcm = rtd->pcm; |
291 | int ret = 0; | 290 | int ret = 0; |
292 | 291 | ||
@@ -295,14 +294,14 @@ static int bf5xx_pcm_tdm_new(struct snd_soc_pcm_runtime *rtd) | |||
295 | if (!card->dev->coherent_dma_mask) | 294 | if (!card->dev->coherent_dma_mask) |
296 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); | 295 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); |
297 | 296 | ||
298 | if (dai->driver->playback.channels_min) { | 297 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
299 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, | 298 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, |
300 | SNDRV_PCM_STREAM_PLAYBACK); | 299 | SNDRV_PCM_STREAM_PLAYBACK); |
301 | if (ret) | 300 | if (ret) |
302 | goto out; | 301 | goto out; |
303 | } | 302 | } |
304 | 303 | ||
305 | if (dai->driver->capture.channels_min) { | 304 | if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
306 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, | 305 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, |
307 | SNDRV_PCM_STREAM_CAPTURE); | 306 | SNDRV_PCM_STREAM_CAPTURE); |
308 | if (ret) | 307 | if (ret) |
diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c index 65bff3d30dd7..b26401f87b85 100644 --- a/sound/soc/davinci/davinci-pcm.c +++ b/sound/soc/davinci/davinci-pcm.c | |||
@@ -831,7 +831,6 @@ static u64 davinci_pcm_dmamask = 0xffffffff; | |||
831 | static int davinci_pcm_new(struct snd_soc_pcm_runtime *rtd) | 831 | static int davinci_pcm_new(struct snd_soc_pcm_runtime *rtd) |
832 | { | 832 | { |
833 | struct snd_card *card = rtd->card->snd_card; | 833 | struct snd_card *card = rtd->card->snd_card; |
834 | struct snd_soc_dai *dai = rtd->cpu_dai; | ||
835 | struct snd_pcm *pcm = rtd->pcm; | 834 | struct snd_pcm *pcm = rtd->pcm; |
836 | int ret; | 835 | int ret; |
837 | 836 | ||
@@ -840,7 +839,7 @@ static int davinci_pcm_new(struct snd_soc_pcm_runtime *rtd) | |||
840 | if (!card->dev->coherent_dma_mask) | 839 | if (!card->dev->coherent_dma_mask) |
841 | card->dev->coherent_dma_mask = 0xffffffff; | 840 | card->dev->coherent_dma_mask = 0xffffffff; |
842 | 841 | ||
843 | if (dai->driver->playback.channels_min) { | 842 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
844 | ret = davinci_pcm_preallocate_dma_buffer(pcm, | 843 | ret = davinci_pcm_preallocate_dma_buffer(pcm, |
845 | SNDRV_PCM_STREAM_PLAYBACK, | 844 | SNDRV_PCM_STREAM_PLAYBACK, |
846 | pcm_hardware_playback.buffer_bytes_max); | 845 | pcm_hardware_playback.buffer_bytes_max); |
@@ -848,7 +847,7 @@ static int davinci_pcm_new(struct snd_soc_pcm_runtime *rtd) | |||
848 | return ret; | 847 | return ret; |
849 | } | 848 | } |
850 | 849 | ||
851 | if (dai->driver->capture.channels_min) { | 850 | if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
852 | ret = davinci_pcm_preallocate_dma_buffer(pcm, | 851 | ret = davinci_pcm_preallocate_dma_buffer(pcm, |
853 | SNDRV_PCM_STREAM_CAPTURE, | 852 | SNDRV_PCM_STREAM_CAPTURE, |
854 | pcm_hardware_capture.buffer_bytes_max); | 853 | pcm_hardware_capture.buffer_bytes_max); |
diff --git a/sound/soc/ep93xx/ep93xx-pcm.c b/sound/soc/ep93xx/ep93xx-pcm.c index a2de9c42b702..3fc96130d1a6 100644 --- a/sound/soc/ep93xx/ep93xx-pcm.c +++ b/sound/soc/ep93xx/ep93xx-pcm.c | |||
@@ -286,7 +286,6 @@ static u64 ep93xx_pcm_dmamask = 0xffffffff; | |||
286 | static int ep93xx_pcm_new(struct snd_soc_pcm_runtime *rtd) | 286 | static int ep93xx_pcm_new(struct snd_soc_pcm_runtime *rtd) |
287 | { | 287 | { |
288 | struct snd_card *card = rtd->card->snd_card; | 288 | struct snd_card *card = rtd->card->snd_card; |
289 | struct snd_soc_dai *dai = rtd->cpu_dai; | ||
290 | struct snd_pcm *pcm = rtd->pcm; | 289 | struct snd_pcm *pcm = rtd->pcm; |
291 | int ret = 0; | 290 | int ret = 0; |
292 | 291 | ||
@@ -295,14 +294,14 @@ static int ep93xx_pcm_new(struct snd_soc_pcm_runtime *rtd) | |||
295 | if (!card->dev->coherent_dma_mask) | 294 | if (!card->dev->coherent_dma_mask) |
296 | card->dev->coherent_dma_mask = 0xffffffff; | 295 | card->dev->coherent_dma_mask = 0xffffffff; |
297 | 296 | ||
298 | if (dai->driver->playback.channels_min) { | 297 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
299 | ret = ep93xx_pcm_preallocate_dma_buffer(pcm, | 298 | ret = ep93xx_pcm_preallocate_dma_buffer(pcm, |
300 | SNDRV_PCM_STREAM_PLAYBACK); | 299 | SNDRV_PCM_STREAM_PLAYBACK); |
301 | if (ret) | 300 | if (ret) |
302 | return ret; | 301 | return ret; |
303 | } | 302 | } |
304 | 303 | ||
305 | if (dai->driver->capture.channels_min) { | 304 | if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
306 | ret = ep93xx_pcm_preallocate_dma_buffer(pcm, | 305 | ret = ep93xx_pcm_preallocate_dma_buffer(pcm, |
307 | SNDRV_PCM_STREAM_CAPTURE); | 306 | SNDRV_PCM_STREAM_CAPTURE); |
308 | if (ret) | 307 | if (ret) |
diff --git a/sound/soc/jz4740/jz4740-pcm.c b/sound/soc/jz4740/jz4740-pcm.c index 50cda9ea9156..9b8cf256847d 100644 --- a/sound/soc/jz4740/jz4740-pcm.c +++ b/sound/soc/jz4740/jz4740-pcm.c | |||
@@ -302,7 +302,6 @@ static u64 jz4740_pcm_dmamask = DMA_BIT_MASK(32); | |||
302 | static int jz4740_pcm_new(struct snd_soc_pcm_runtime *rtd) | 302 | static int jz4740_pcm_new(struct snd_soc_pcm_runtime *rtd) |
303 | { | 303 | { |
304 | struct snd_card *card = rtd->card->snd_card; | 304 | struct snd_card *card = rtd->card->snd_card; |
305 | struct snd_soc_dai *dai = rtd->cpu_dai; | ||
306 | struct snd_pcm *pcm = rtd->pcm; | 305 | struct snd_pcm *pcm = rtd->pcm; |
307 | int ret = 0; | 306 | int ret = 0; |
308 | 307 | ||
@@ -312,14 +311,14 @@ static int jz4740_pcm_new(struct snd_soc_pcm_runtime *rtd) | |||
312 | if (!card->dev->coherent_dma_mask) | 311 | if (!card->dev->coherent_dma_mask) |
313 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); | 312 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); |
314 | 313 | ||
315 | if (dai->driver->playback.channels_min) { | 314 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
316 | ret = jz4740_pcm_preallocate_dma_buffer(pcm, | 315 | ret = jz4740_pcm_preallocate_dma_buffer(pcm, |
317 | SNDRV_PCM_STREAM_PLAYBACK); | 316 | SNDRV_PCM_STREAM_PLAYBACK); |
318 | if (ret) | 317 | if (ret) |
319 | goto err; | 318 | goto err; |
320 | } | 319 | } |
321 | 320 | ||
322 | if (dai->driver->capture.channels_min) { | 321 | if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
323 | ret = jz4740_pcm_preallocate_dma_buffer(pcm, | 322 | ret = jz4740_pcm_preallocate_dma_buffer(pcm, |
324 | SNDRV_PCM_STREAM_CAPTURE); | 323 | SNDRV_PCM_STREAM_CAPTURE); |
325 | if (ret) | 324 | if (ret) |
diff --git a/sound/soc/kirkwood/kirkwood-dma.c b/sound/soc/kirkwood/kirkwood-dma.c index 210438261a49..d4a17780cef4 100644 --- a/sound/soc/kirkwood/kirkwood-dma.c +++ b/sound/soc/kirkwood/kirkwood-dma.c | |||
@@ -315,7 +315,6 @@ static int kirkwood_dma_preallocate_dma_buffer(struct snd_pcm *pcm, | |||
315 | static int kirkwood_dma_new(struct snd_soc_pcm_runtime *rtd) | 315 | static int kirkwood_dma_new(struct snd_soc_pcm_runtime *rtd) |
316 | { | 316 | { |
317 | struct snd_card *card = rtd->card->snd_card; | 317 | struct snd_card *card = rtd->card->snd_card; |
318 | struct snd_soc_dai *dai = rtd->cpu_dai; | ||
319 | struct snd_pcm *pcm = rtd->pcm; | 318 | struct snd_pcm *pcm = rtd->pcm; |
320 | int ret; | 319 | int ret; |
321 | 320 | ||
@@ -324,14 +323,14 @@ static int kirkwood_dma_new(struct snd_soc_pcm_runtime *rtd) | |||
324 | if (!card->dev->coherent_dma_mask) | 323 | if (!card->dev->coherent_dma_mask) |
325 | card->dev->coherent_dma_mask = 0xffffffff; | 324 | card->dev->coherent_dma_mask = 0xffffffff; |
326 | 325 | ||
327 | if (dai->driver->playback.channels_min) { | 326 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
328 | ret = kirkwood_dma_preallocate_dma_buffer(pcm, | 327 | ret = kirkwood_dma_preallocate_dma_buffer(pcm, |
329 | SNDRV_PCM_STREAM_PLAYBACK); | 328 | SNDRV_PCM_STREAM_PLAYBACK); |
330 | if (ret) | 329 | if (ret) |
331 | return ret; | 330 | return ret; |
332 | } | 331 | } |
333 | 332 | ||
334 | if (dai->driver->capture.channels_min) { | 333 | if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
335 | ret = kirkwood_dma_preallocate_dma_buffer(pcm, | 334 | ret = kirkwood_dma_preallocate_dma_buffer(pcm, |
336 | SNDRV_PCM_STREAM_CAPTURE); | 335 | SNDRV_PCM_STREAM_CAPTURE); |
337 | if (ret) | 336 | if (ret) |
diff --git a/sound/soc/mid-x86/sst_platform.c b/sound/soc/mid-x86/sst_platform.c index c2bf172a196e..d34563b12c3b 100644 --- a/sound/soc/mid-x86/sst_platform.c +++ b/sound/soc/mid-x86/sst_platform.c | |||
@@ -446,13 +446,12 @@ static void sst_pcm_free(struct snd_pcm *pcm) | |||
446 | 446 | ||
447 | static int sst_pcm_new(struct snd_soc_pcm_runtime *rtd) | 447 | static int sst_pcm_new(struct snd_soc_pcm_runtime *rtd) |
448 | { | 448 | { |
449 | struct snd_soc_dai *dai = rtd->cpu_dai; | ||
450 | struct snd_pcm *pcm = rtd->pcm; | 449 | struct snd_pcm *pcm = rtd->pcm; |
451 | int retval = 0; | 450 | int retval = 0; |
452 | 451 | ||
453 | pr_debug("sst_pcm_new called\n"); | 452 | pr_debug("sst_pcm_new called\n"); |
454 | if (dai->driver->playback.channels_min || | 453 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream || |
455 | dai->driver->capture.channels_min) { | 454 | pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
456 | retval = snd_pcm_lib_preallocate_pages_for_all(pcm, | 455 | retval = snd_pcm_lib_preallocate_pages_for_all(pcm, |
457 | SNDRV_DMA_TYPE_CONTINUOUS, | 456 | SNDRV_DMA_TYPE_CONTINUOUS, |
458 | snd_dma_continuous_data(GFP_KERNEL), | 457 | snd_dma_continuous_data(GFP_KERNEL), |
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index 52a0f634948e..a59bd352d342 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c | |||
@@ -378,7 +378,6 @@ static void omap_pcm_free_dma_buffers(struct snd_pcm *pcm) | |||
378 | static int omap_pcm_new(struct snd_soc_pcm_runtime *rtd) | 378 | static int omap_pcm_new(struct snd_soc_pcm_runtime *rtd) |
379 | { | 379 | { |
380 | struct snd_card *card = rtd->card->snd_card; | 380 | struct snd_card *card = rtd->card->snd_card; |
381 | struct snd_soc_dai *dai = rtd->cpu_dai; | ||
382 | struct snd_pcm *pcm = rtd->pcm; | 381 | struct snd_pcm *pcm = rtd->pcm; |
383 | int ret = 0; | 382 | int ret = 0; |
384 | 383 | ||
@@ -387,14 +386,14 @@ static int omap_pcm_new(struct snd_soc_pcm_runtime *rtd) | |||
387 | if (!card->dev->coherent_dma_mask) | 386 | if (!card->dev->coherent_dma_mask) |
388 | card->dev->coherent_dma_mask = DMA_BIT_MASK(64); | 387 | card->dev->coherent_dma_mask = DMA_BIT_MASK(64); |
389 | 388 | ||
390 | if (dai->driver->playback.channels_min) { | 389 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
391 | ret = omap_pcm_preallocate_dma_buffer(pcm, | 390 | ret = omap_pcm_preallocate_dma_buffer(pcm, |
392 | SNDRV_PCM_STREAM_PLAYBACK); | 391 | SNDRV_PCM_STREAM_PLAYBACK); |
393 | if (ret) | 392 | if (ret) |
394 | goto out; | 393 | goto out; |
395 | } | 394 | } |
396 | 395 | ||
397 | if (dai->driver->capture.channels_min) { | 396 | if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
398 | ret = omap_pcm_preallocate_dma_buffer(pcm, | 397 | ret = omap_pcm_preallocate_dma_buffer(pcm, |
399 | SNDRV_PCM_STREAM_CAPTURE); | 398 | SNDRV_PCM_STREAM_CAPTURE); |
400 | if (ret) | 399 | if (ret) |
diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c index 797c3d5e79e5..427ae0d9817b 100644 --- a/sound/soc/samsung/dma.c +++ b/sound/soc/samsung/dma.c | |||
@@ -403,7 +403,6 @@ static u64 dma_mask = DMA_BIT_MASK(32); | |||
403 | static int dma_new(struct snd_soc_pcm_runtime *rtd) | 403 | static int dma_new(struct snd_soc_pcm_runtime *rtd) |
404 | { | 404 | { |
405 | struct snd_card *card = rtd->card->snd_card; | 405 | struct snd_card *card = rtd->card->snd_card; |
406 | struct snd_soc_dai *dai = rtd->cpu_dai; | ||
407 | struct snd_pcm *pcm = rtd->pcm; | 406 | struct snd_pcm *pcm = rtd->pcm; |
408 | int ret = 0; | 407 | int ret = 0; |
409 | 408 | ||
@@ -414,14 +413,14 @@ static int dma_new(struct snd_soc_pcm_runtime *rtd) | |||
414 | if (!card->dev->coherent_dma_mask) | 413 | if (!card->dev->coherent_dma_mask) |
415 | card->dev->coherent_dma_mask = 0xffffffff; | 414 | card->dev->coherent_dma_mask = 0xffffffff; |
416 | 415 | ||
417 | if (dai->driver->playback.channels_min) { | 416 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
418 | ret = preallocate_dma_buffer(pcm, | 417 | ret = preallocate_dma_buffer(pcm, |
419 | SNDRV_PCM_STREAM_PLAYBACK); | 418 | SNDRV_PCM_STREAM_PLAYBACK); |
420 | if (ret) | 419 | if (ret) |
421 | goto out; | 420 | goto out; |
422 | } | 421 | } |
423 | 422 | ||
424 | if (dai->driver->capture.channels_min) { | 423 | if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
425 | ret = preallocate_dma_buffer(pcm, | 424 | ret = preallocate_dma_buffer(pcm, |
426 | SNDRV_PCM_STREAM_CAPTURE); | 425 | SNDRV_PCM_STREAM_CAPTURE); |
427 | if (ret) | 426 | if (ret) |
diff --git a/sound/soc/samsung/idma.c b/sound/soc/samsung/idma.c index 2bcf75815624..c227c3163cae 100644 --- a/sound/soc/samsung/idma.c +++ b/sound/soc/samsung/idma.c | |||
@@ -387,7 +387,6 @@ static u64 idma_mask = DMA_BIT_MASK(32); | |||
387 | static int idma_new(struct snd_soc_pcm_runtime *rtd) | 387 | static int idma_new(struct snd_soc_pcm_runtime *rtd) |
388 | { | 388 | { |
389 | struct snd_card *card = rtd->card->snd_card; | 389 | struct snd_card *card = rtd->card->snd_card; |
390 | struct snd_soc_dai *dai = rtd->cpu_dai; | ||
391 | struct snd_pcm *pcm = rtd->pcm; | 390 | struct snd_pcm *pcm = rtd->pcm; |
392 | int ret = 0; | 391 | int ret = 0; |
393 | 392 | ||
@@ -396,9 +395,10 @@ static int idma_new(struct snd_soc_pcm_runtime *rtd) | |||
396 | if (!card->dev->coherent_dma_mask) | 395 | if (!card->dev->coherent_dma_mask) |
397 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); | 396 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); |
398 | 397 | ||
399 | if (dai->driver->playback.channels_min) | 398 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
400 | ret = preallocate_idma_buffer(pcm, | 399 | ret = preallocate_idma_buffer(pcm, |
401 | SNDRV_PCM_STREAM_PLAYBACK); | 400 | SNDRV_PCM_STREAM_PLAYBACK); |
401 | } | ||
402 | 402 | ||
403 | return ret; | 403 | return ret; |
404 | } | 404 | } |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index acbb96005a69..3986520b4677 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -169,8 +169,7 @@ static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf, | |||
169 | static ssize_t codec_reg_show(struct device *dev, | 169 | static ssize_t codec_reg_show(struct device *dev, |
170 | struct device_attribute *attr, char *buf) | 170 | struct device_attribute *attr, char *buf) |
171 | { | 171 | { |
172 | struct snd_soc_pcm_runtime *rtd = | 172 | struct snd_soc_pcm_runtime *rtd = dev_get_drvdata(dev); |
173 | container_of(dev, struct snd_soc_pcm_runtime, dev); | ||
174 | 173 | ||
175 | return soc_codec_reg_show(rtd->codec, buf, PAGE_SIZE, 0); | 174 | return soc_codec_reg_show(rtd->codec, buf, PAGE_SIZE, 0); |
176 | } | 175 | } |
@@ -180,8 +179,7 @@ static DEVICE_ATTR(codec_reg, 0444, codec_reg_show, NULL); | |||
180 | static ssize_t pmdown_time_show(struct device *dev, | 179 | static ssize_t pmdown_time_show(struct device *dev, |
181 | struct device_attribute *attr, char *buf) | 180 | struct device_attribute *attr, char *buf) |
182 | { | 181 | { |
183 | struct snd_soc_pcm_runtime *rtd = | 182 | struct snd_soc_pcm_runtime *rtd = dev_get_drvdata(dev); |
184 | container_of(dev, struct snd_soc_pcm_runtime, dev); | ||
185 | 183 | ||
186 | return sprintf(buf, "%ld\n", rtd->pmdown_time); | 184 | return sprintf(buf, "%ld\n", rtd->pmdown_time); |
187 | } | 185 | } |
@@ -190,8 +188,7 @@ static ssize_t pmdown_time_set(struct device *dev, | |||
190 | struct device_attribute *attr, | 188 | struct device_attribute *attr, |
191 | const char *buf, size_t count) | 189 | const char *buf, size_t count) |
192 | { | 190 | { |
193 | struct snd_soc_pcm_runtime *rtd = | 191 | struct snd_soc_pcm_runtime *rtd = dev_get_drvdata(dev); |
194 | container_of(dev, struct snd_soc_pcm_runtime, dev); | ||
195 | int ret; | 192 | int ret; |
196 | 193 | ||
197 | ret = strict_strtol(buf, 10, &rtd->pmdown_time); | 194 | ret = strict_strtol(buf, 10, &rtd->pmdown_time); |
@@ -884,9 +881,9 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num, int order) | |||
884 | 881 | ||
885 | /* unregister the rtd device */ | 882 | /* unregister the rtd device */ |
886 | if (rtd->dev_registered) { | 883 | if (rtd->dev_registered) { |
887 | device_remove_file(&rtd->dev, &dev_attr_pmdown_time); | 884 | device_remove_file(rtd->dev, &dev_attr_pmdown_time); |
888 | device_remove_file(&rtd->dev, &dev_attr_codec_reg); | 885 | device_remove_file(rtd->dev, &dev_attr_codec_reg); |
889 | device_unregister(&rtd->dev); | 886 | device_unregister(rtd->dev); |
890 | rtd->dev_registered = 0; | 887 | rtd->dev_registered = 0; |
891 | } | 888 | } |
892 | 889 | ||
@@ -1061,7 +1058,10 @@ err_probe: | |||
1061 | return ret; | 1058 | return ret; |
1062 | } | 1059 | } |
1063 | 1060 | ||
1064 | static void rtd_release(struct device *dev) {} | 1061 | static void rtd_release(struct device *dev) |
1062 | { | ||
1063 | kfree(dev); | ||
1064 | } | ||
1065 | 1065 | ||
1066 | static int soc_post_component_init(struct snd_soc_card *card, | 1066 | static int soc_post_component_init(struct snd_soc_card *card, |
1067 | struct snd_soc_codec *codec, | 1067 | struct snd_soc_codec *codec, |
@@ -1104,11 +1104,17 @@ static int soc_post_component_init(struct snd_soc_card *card, | |||
1104 | 1104 | ||
1105 | /* register the rtd device */ | 1105 | /* register the rtd device */ |
1106 | rtd->codec = codec; | 1106 | rtd->codec = codec; |
1107 | rtd->dev.parent = card->dev; | 1107 | |
1108 | rtd->dev.release = rtd_release; | 1108 | rtd->dev = kzalloc(sizeof(struct device), GFP_KERNEL); |
1109 | rtd->dev.init_name = name; | 1109 | if (!rtd->dev) |
1110 | return -ENOMEM; | ||
1111 | device_initialize(rtd->dev); | ||
1112 | rtd->dev->parent = card->dev; | ||
1113 | rtd->dev->release = rtd_release; | ||
1114 | rtd->dev->init_name = name; | ||
1115 | dev_set_drvdata(rtd->dev, rtd); | ||
1110 | mutex_init(&rtd->pcm_mutex); | 1116 | mutex_init(&rtd->pcm_mutex); |
1111 | ret = device_register(&rtd->dev); | 1117 | ret = device_add(rtd->dev); |
1112 | if (ret < 0) { | 1118 | if (ret < 0) { |
1113 | dev_err(card->dev, | 1119 | dev_err(card->dev, |
1114 | "asoc: failed to register runtime device: %d\n", ret); | 1120 | "asoc: failed to register runtime device: %d\n", ret); |
@@ -1117,14 +1123,14 @@ static int soc_post_component_init(struct snd_soc_card *card, | |||
1117 | rtd->dev_registered = 1; | 1123 | rtd->dev_registered = 1; |
1118 | 1124 | ||
1119 | /* add DAPM sysfs entries for this codec */ | 1125 | /* add DAPM sysfs entries for this codec */ |
1120 | ret = snd_soc_dapm_sys_add(&rtd->dev); | 1126 | ret = snd_soc_dapm_sys_add(rtd->dev); |
1121 | if (ret < 0) | 1127 | if (ret < 0) |
1122 | dev_err(codec->dev, | 1128 | dev_err(codec->dev, |
1123 | "asoc: failed to add codec dapm sysfs entries: %d\n", | 1129 | "asoc: failed to add codec dapm sysfs entries: %d\n", |
1124 | ret); | 1130 | ret); |
1125 | 1131 | ||
1126 | /* add codec sysfs entries */ | 1132 | /* add codec sysfs entries */ |
1127 | ret = device_create_file(&rtd->dev, &dev_attr_codec_reg); | 1133 | ret = device_create_file(rtd->dev, &dev_attr_codec_reg); |
1128 | if (ret < 0) | 1134 | if (ret < 0) |
1129 | dev_err(codec->dev, | 1135 | dev_err(codec->dev, |
1130 | "asoc: failed to add codec sysfs files: %d\n", ret); | 1136 | "asoc: failed to add codec sysfs files: %d\n", ret); |
@@ -1213,7 +1219,7 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num, int order) | |||
1213 | if (ret) | 1219 | if (ret) |
1214 | return ret; | 1220 | return ret; |
1215 | 1221 | ||
1216 | ret = device_create_file(&rtd->dev, &dev_attr_pmdown_time); | 1222 | ret = device_create_file(rtd->dev, &dev_attr_pmdown_time); |
1217 | if (ret < 0) | 1223 | if (ret < 0) |
1218 | printk(KERN_WARNING "asoc: failed to add pmdown_time sysfs\n"); | 1224 | printk(KERN_WARNING "asoc: failed to add pmdown_time sysfs\n"); |
1219 | 1225 | ||
@@ -1311,8 +1317,8 @@ static void soc_remove_aux_dev(struct snd_soc_card *card, int num) | |||
1311 | 1317 | ||
1312 | /* unregister the rtd device */ | 1318 | /* unregister the rtd device */ |
1313 | if (rtd->dev_registered) { | 1319 | if (rtd->dev_registered) { |
1314 | device_remove_file(&rtd->dev, &dev_attr_codec_reg); | 1320 | device_remove_file(rtd->dev, &dev_attr_codec_reg); |
1315 | device_unregister(&rtd->dev); | 1321 | device_del(rtd->dev); |
1316 | rtd->dev_registered = 0; | 1322 | rtd->dev_registered = 0; |
1317 | } | 1323 | } |
1318 | 1324 | ||
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index e174d0811dae..3ad1f59b8028 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -1738,8 +1738,7 @@ static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, | |||
1738 | static ssize_t dapm_widget_show(struct device *dev, | 1738 | static ssize_t dapm_widget_show(struct device *dev, |
1739 | struct device_attribute *attr, char *buf) | 1739 | struct device_attribute *attr, char *buf) |
1740 | { | 1740 | { |
1741 | struct snd_soc_pcm_runtime *rtd = | 1741 | struct snd_soc_pcm_runtime *rtd = dev_get_drvdata(dev); |
1742 | container_of(dev, struct snd_soc_pcm_runtime, dev); | ||
1743 | struct snd_soc_codec *codec =rtd->codec; | 1742 | struct snd_soc_codec *codec =rtd->codec; |
1744 | struct snd_soc_dapm_widget *w; | 1743 | struct snd_soc_dapm_widget *w; |
1745 | int count = 0; | 1744 | int count = 0; |
diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c index 90345ee138f3..c22431516ab2 100644 --- a/sound/soc/tegra/tegra_pcm.c +++ b/sound/soc/tegra/tegra_pcm.c | |||
@@ -330,7 +330,6 @@ static u64 tegra_dma_mask = DMA_BIT_MASK(32); | |||
330 | static int tegra_pcm_new(struct snd_soc_pcm_runtime *rtd) | 330 | static int tegra_pcm_new(struct snd_soc_pcm_runtime *rtd) |
331 | { | 331 | { |
332 | struct snd_card *card = rtd->card->snd_card; | 332 | struct snd_card *card = rtd->card->snd_card; |
333 | struct snd_soc_dai *dai = rtd->cpu_dai; | ||
334 | struct snd_pcm *pcm = rtd->pcm; | 333 | struct snd_pcm *pcm = rtd->pcm; |
335 | int ret = 0; | 334 | int ret = 0; |
336 | 335 | ||
@@ -339,14 +338,14 @@ static int tegra_pcm_new(struct snd_soc_pcm_runtime *rtd) | |||
339 | if (!card->dev->coherent_dma_mask) | 338 | if (!card->dev->coherent_dma_mask) |
340 | card->dev->coherent_dma_mask = 0xffffffff; | 339 | card->dev->coherent_dma_mask = 0xffffffff; |
341 | 340 | ||
342 | if (dai->driver->playback.channels_min) { | 341 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
343 | ret = tegra_pcm_preallocate_dma_buffer(pcm, | 342 | ret = tegra_pcm_preallocate_dma_buffer(pcm, |
344 | SNDRV_PCM_STREAM_PLAYBACK); | 343 | SNDRV_PCM_STREAM_PLAYBACK); |
345 | if (ret) | 344 | if (ret) |
346 | goto err; | 345 | goto err; |
347 | } | 346 | } |
348 | 347 | ||
349 | if (dai->driver->capture.channels_min) { | 348 | if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
350 | ret = tegra_pcm_preallocate_dma_buffer(pcm, | 349 | ret = tegra_pcm_preallocate_dma_buffer(pcm, |
351 | SNDRV_PCM_STREAM_CAPTURE); | 350 | SNDRV_PCM_STREAM_CAPTURE); |
352 | if (ret) | 351 | if (ret) |