From 5c15a6869a75000fecea61e9985f4753311ec534 Mon Sep 17 00:00:00 2001 From: Anton Vorontsov Date: Sat, 4 Apr 2009 22:33:19 +0400 Subject: ASoC: fsl_dma: Pass the proper device for dma mapping routines The driver should pass a device that specifies internal DMA ops, but substream->pcm is just a logical device, and thus doesn't have arch- specific dma callbacks, therefore following bug appears: Freescale Synchronous Serial Interface (SSI) ASoC Driver ------------[ cut here ]------------ kernel BUG at arch/powerpc/include/asm/dma-mapping.h:237! Oops: Exception in kernel mode, sig: 5 [#1] ... NIP [c02259c4] snd_malloc_dev_pages+0x58/0xac LR [c0225c74] snd_dma_alloc_pages+0xf8/0x108 Call Trace: [df02bde0] [df02be2c] 0xdf02be2c (unreliable) [df02bdf0] [c0225c74] snd_dma_alloc_pages+0xf8/0x108 [df02be10] [c023a100] fsl_dma_new+0x68/0x124 [df02be20] [c02342ac] soc_new_pcm+0x1bc/0x234 [df02bea0] [c02343dc] snd_soc_new_pcms+0xb8/0x148 [df02bed0] [c023824c] cs4270_probe+0x34/0x124 [df02bef0] [c0232fe8] snd_soc_instantiate_card+0x1a4/0x2f4 [df02bf20] [c0233164] snd_soc_instantiate_cards+0x2c/0x68 [df02bf30] [c0234704] snd_soc_register_platform+0x60/0x80 [df02bf50] [c03d5664] fsl_soc_platform_init+0x18/0x28 ... This patch fixes the issue by using card's device instead. Signed-off-by: Anton Vorontsov Acked-by: Timur Tabi Signed-off-by: Mark Brown --- sound/soc/fsl/fsl_dma.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c index 2c4892c853c..b1a3a278819 100644 --- a/sound/soc/fsl/fsl_dma.c +++ b/sound/soc/fsl/fsl_dma.c @@ -300,7 +300,7 @@ static int fsl_dma_new(struct snd_card *card, struct snd_soc_dai *dai, if (!card->dev->coherent_dma_mask) card->dev->coherent_dma_mask = fsl_dma_dmamask; - ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->dev, + ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev, fsl_dma_hardware.buffer_bytes_max, &pcm->streams[0].substream->dma_buffer); if (ret) { @@ -310,7 +310,7 @@ static int fsl_dma_new(struct snd_card *card, struct snd_soc_dai *dai, return -ENOMEM; } - ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->dev, + ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev, fsl_dma_hardware.buffer_bytes_max, &pcm->streams[1].substream->dma_buffer); if (ret) { @@ -418,7 +418,7 @@ static int fsl_dma_open(struct snd_pcm_substream *substream) return -EBUSY; } - dma_private = dma_alloc_coherent(substream->pcm->dev, + dma_private = dma_alloc_coherent(substream->pcm->card->dev, sizeof(struct fsl_dma_private), &ld_buf_phys, GFP_KERNEL); if (!dma_private) { dev_err(substream->pcm->card->dev, @@ -445,7 +445,7 @@ static int fsl_dma_open(struct snd_pcm_substream *substream) dev_err(substream->pcm->card->dev, "can't register ISR for IRQ %u (ret=%i)\n", dma_private->irq, ret); - dma_free_coherent(substream->pcm->dev, + dma_free_coherent(substream->pcm->card->dev, sizeof(struct fsl_dma_private), dma_private, dma_private->ld_buf_phys); return ret; @@ -778,13 +778,13 @@ static int fsl_dma_close(struct snd_pcm_substream *substream) free_irq(dma_private->irq, dma_private); if (dma_private->ld_buf_phys) { - dma_unmap_single(substream->pcm->dev, + dma_unmap_single(substream->pcm->card->dev, dma_private->ld_buf_phys, sizeof(dma_private->link), DMA_TO_DEVICE); } /* Deallocate the fsl_dma_private structure */ - dma_free_coherent(substream->pcm->dev, + dma_free_coherent(substream->pcm->card->dev, sizeof(struct fsl_dma_private), dma_private, dma_private->ld_buf_phys); substream->runtime->private_data = NULL; -- cgit v1.2.3-70-g09d2 From d6648da122870ff42bc720da25483bdb8bc868f8 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 7 Apr 2009 09:14:00 +0300 Subject: ASoC: TWL4030: Compillation error fix Fix for compillation error introduced by the constrain patch. Signed-off-by: Peter Ujfalusi Signed-off-by: Mark Brown --- sound/soc/codecs/twl4030.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index bfda7a88e82..921b205de28 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c @@ -1220,11 +1220,12 @@ static int twl4030_set_bias_level(struct snd_soc_codec *codec, return 0; } -static int twl4030_startup(struct snd_pcm_substream *substream) +static int twl4030_startup(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_device *socdev = rtd->socdev; - struct snd_soc_codec *codec = socdev->codec; + struct snd_soc_codec *codec = socdev->card->codec; struct twl4030_priv *twl4030 = codec->private_data; /* If we already have a playback or capture going then constrain @@ -1251,11 +1252,12 @@ static int twl4030_startup(struct snd_pcm_substream *substream) return 0; } -static void twl4030_shutdown(struct snd_pcm_substream *substream) +static void twl4030_shutdown(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_device *socdev = rtd->socdev; - struct snd_soc_codec *codec = socdev->codec; + struct snd_soc_codec *codec = socdev->card->codec; struct twl4030_priv *twl4030 = codec->private_data; if (twl4030->master_substream == substream) -- cgit v1.2.3-70-g09d2 From fd2bd98818fc1c9672241b845344cbfbb159a4f9 Mon Sep 17 00:00:00 2001 From: Eric Miao Date: Thu, 9 Apr 2009 14:13:07 +0800 Subject: ASoC: magician: remove un-necessary #include of pxa-regs.h and hardware.h Signed-off-by: Eric Miao Cc: Philipp Zabel Signed-off-by: Mark Brown --- sound/soc/pxa/magician.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/pxa/magician.c b/sound/soc/pxa/magician.c index f7c4544f785..0625c342a1c 100644 --- a/sound/soc/pxa/magician.c +++ b/sound/soc/pxa/magician.c @@ -27,8 +27,6 @@ #include #include -#include -#include #include #include #include "../codecs/uda1380.h" -- cgit v1.2.3-70-g09d2 From 6e498d5eb6afb50659b4b7fc302d480ca0ceaa93 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 9 Apr 2009 16:40:41 +0100 Subject: ASoC: Disable S3C64xx support in Kconfig Due to the process and communications issues with the 2.6.30 S3C platform merges none of the underlying arch/arm code for S3C64xx audio support made it into mainline, rendering the drivers useless. Disable them in Kconfig to avoid user confusion - users patching in the required support can always reenable this too. Signed-off-by: Mark Brown --- sound/soc/s3c24xx/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/s3c24xx/Kconfig b/sound/soc/s3c24xx/Kconfig index 2f3a21eee05..df494d1e346 100644 --- a/sound/soc/s3c24xx/Kconfig +++ b/sound/soc/s3c24xx/Kconfig @@ -1,10 +1,10 @@ config SND_S3C24XX_SOC tristate "SoC Audio for the Samsung S3CXXXX chips" - depends on ARCH_S3C2410 || ARCH_S3C64XX + depends on ARCH_S3C2410 help Say Y or M if you want to add support for codecs attached to - the S3C24XX and S3C64XX AC97, I2S or SSP interface. You will - also need to select the audio interfaces to support below. + the S3C24XX AC97 or I2S interfaces. You will also need to + select the audio interfaces to support below. config SND_S3C24XX_SOC_I2S tristate -- cgit v1.2.3-70-g09d2