aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-06-01 18:39:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-06-01 18:39:26 -0400
commit37b22400f86e83076c8e540b65e8b7e3f1f63e6b (patch)
tree14d834900fdec065ee0b29f0e27c5ab14f25286c /sound
parent86c47b70f62a7072d441ba212aab33c2f82627c2 (diff)
parentfbf2045af7691fbab2fd9f6d6fa96839bea13d31 (diff)
Merge tag 'sound-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Just a few trivial driver-specific fixes." * tag 'sound-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hdspm - Work around broken DDS value on PCI RME MADI ALSA: usb-audio: fix rate_list memory leak ASoC: fsi: bugfix: ensure dma is terminated ASoC: fsi: bugfix: correct dma area ASoC: fsi: bugfix: enable master clock control on DMA stream ASoC: imx-ssi: Use clk_prepare_enable/clk_disable_unprepare
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/rme9652/hdspm.c7
-rw-r--r--sound/soc/fsl/imx-ssi.c6
-rw-r--r--sound/soc/sh/fsi.c25
-rw-r--r--sound/usb/pcm.c3
4 files changed, 29 insertions, 12 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 0a5027b94714..b8ac8710f47f 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -1988,6 +1988,13 @@ static int hdspm_get_system_sample_rate(struct hdspm *hdspm)
1988 period = hdspm_read(hdspm, HDSPM_RD_PLL_FREQ); 1988 period = hdspm_read(hdspm, HDSPM_RD_PLL_FREQ);
1989 rate = hdspm_calc_dds_value(hdspm, period); 1989 rate = hdspm_calc_dds_value(hdspm, period);
1990 1990
1991 if (rate > 207000) {
1992 /* Unreasonable high sample rate as seen on PCI MADI cards.
1993 * Use the cached value instead.
1994 */
1995 rate = hdspm->system_sample_rate;
1996 }
1997
1991 return rate; 1998 return rate;
1992} 1999}
1993 2000
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
index cf3ed0362c9c..28dd76c7cb1c 100644
--- a/sound/soc/fsl/imx-ssi.c
+++ b/sound/soc/fsl/imx-ssi.c
@@ -543,7 +543,7 @@ static int imx_ssi_probe(struct platform_device *pdev)
543 ret); 543 ret);
544 goto failed_clk; 544 goto failed_clk;
545 } 545 }
546 clk_enable(ssi->clk); 546 clk_prepare_enable(ssi->clk);
547 547
548 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 548 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
549 if (!res) { 549 if (!res) {
@@ -641,7 +641,7 @@ failed_ac97:
641failed_ioremap: 641failed_ioremap:
642 release_mem_region(res->start, resource_size(res)); 642 release_mem_region(res->start, resource_size(res));
643failed_get_resource: 643failed_get_resource:
644 clk_disable(ssi->clk); 644 clk_disable_unprepare(ssi->clk);
645 clk_put(ssi->clk); 645 clk_put(ssi->clk);
646failed_clk: 646failed_clk:
647 kfree(ssi); 647 kfree(ssi);
@@ -664,7 +664,7 @@ static int __devexit imx_ssi_remove(struct platform_device *pdev)
664 664
665 iounmap(ssi->base); 665 iounmap(ssi->base);
666 release_mem_region(res->start, resource_size(res)); 666 release_mem_region(res->start, resource_size(res));
667 clk_disable(ssi->clk); 667 clk_disable_unprepare(ssi->clk);
668 clk_put(ssi->clk); 668 clk_put(ssi->clk);
669 kfree(ssi); 669 kfree(ssi);
670 670
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 7cee22515d9d..2ef98536f1da 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -1052,6 +1052,13 @@ static int fsi_dma_quit(struct fsi_priv *fsi, struct fsi_stream *io)
1052 return 0; 1052 return 0;
1053} 1053}
1054 1054
1055static dma_addr_t fsi_dma_get_area(struct fsi_stream *io)
1056{
1057 struct snd_pcm_runtime *runtime = io->substream->runtime;
1058
1059 return io->dma + samples_to_bytes(runtime, io->buff_sample_pos);
1060}
1061
1055static void fsi_dma_complete(void *data) 1062static void fsi_dma_complete(void *data)
1056{ 1063{
1057 struct fsi_stream *io = (struct fsi_stream *)data; 1064 struct fsi_stream *io = (struct fsi_stream *)data;
@@ -1061,7 +1068,7 @@ static void fsi_dma_complete(void *data)
1061 enum dma_data_direction dir = fsi_stream_is_play(fsi, io) ? 1068 enum dma_data_direction dir = fsi_stream_is_play(fsi, io) ?
1062 DMA_TO_DEVICE : DMA_FROM_DEVICE; 1069 DMA_TO_DEVICE : DMA_FROM_DEVICE;
1063 1070
1064 dma_sync_single_for_cpu(dai->dev, io->dma, 1071 dma_sync_single_for_cpu(dai->dev, fsi_dma_get_area(io),
1065 samples_to_bytes(runtime, io->period_samples), dir); 1072 samples_to_bytes(runtime, io->period_samples), dir);
1066 1073
1067 io->buff_sample_pos += io->period_samples; 1074 io->buff_sample_pos += io->period_samples;
@@ -1078,13 +1085,6 @@ static void fsi_dma_complete(void *data)
1078 snd_pcm_period_elapsed(io->substream); 1085 snd_pcm_period_elapsed(io->substream);
1079} 1086}
1080 1087
1081static dma_addr_t fsi_dma_get_area(struct fsi_stream *io)
1082{
1083 struct snd_pcm_runtime *runtime = io->substream->runtime;
1084
1085 return io->dma + samples_to_bytes(runtime, io->buff_sample_pos);
1086}
1087
1088static void fsi_dma_do_tasklet(unsigned long data) 1088static void fsi_dma_do_tasklet(unsigned long data)
1089{ 1089{
1090 struct fsi_stream *io = (struct fsi_stream *)data; 1090 struct fsi_stream *io = (struct fsi_stream *)data;
@@ -1110,7 +1110,7 @@ static void fsi_dma_do_tasklet(unsigned long data)
1110 len = samples_to_bytes(runtime, io->period_samples); 1110 len = samples_to_bytes(runtime, io->period_samples);
1111 buf = fsi_dma_get_area(io); 1111 buf = fsi_dma_get_area(io);
1112 1112
1113 dma_sync_single_for_device(dai->dev, io->dma, len, dir); 1113 dma_sync_single_for_device(dai->dev, buf, len, dir);
1114 1114
1115 sg_init_table(&sg, 1); 1115 sg_init_table(&sg, 1);
1116 sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf)), 1116 sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf)),
@@ -1172,9 +1172,16 @@ static int fsi_dma_transfer(struct fsi_priv *fsi, struct fsi_stream *io)
1172static void fsi_dma_push_start_stop(struct fsi_priv *fsi, struct fsi_stream *io, 1172static void fsi_dma_push_start_stop(struct fsi_priv *fsi, struct fsi_stream *io,
1173 int start) 1173 int start)
1174{ 1174{
1175 struct fsi_master *master = fsi_get_master(fsi);
1176 u32 clk = fsi_is_port_a(fsi) ? CRA : CRB;
1175 u32 enable = start ? DMA_ON : 0; 1177 u32 enable = start ? DMA_ON : 0;
1176 1178
1177 fsi_reg_mask_set(fsi, OUT_DMAC, DMA_ON, enable); 1179 fsi_reg_mask_set(fsi, OUT_DMAC, DMA_ON, enable);
1180
1181 dmaengine_terminate_all(io->chan);
1182
1183 if (fsi_is_clk_master(fsi))
1184 fsi_master_mask_set(master, CLK_RST, clk, (enable) ? clk : 0);
1178} 1185}
1179 1186
1180static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io) 1187static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io)
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index 24839d932648..cdf8b7601973 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -788,6 +788,9 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime,
788 int count = 0, needs_knot = 0; 788 int count = 0, needs_knot = 0;
789 int err; 789 int err;
790 790
791 kfree(subs->rate_list.list);
792 subs->rate_list.list = NULL;
793
791 list_for_each_entry(fp, &subs->fmt_list, list) { 794 list_for_each_entry(fp, &subs->fmt_list, list) {
792 if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS) 795 if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS)
793 return 0; 796 return 0;