Sound fixes for 3.5-rc1

Just a few trivial driver-specific fixes.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQIcBAABAgAGBQJPyGJVAAoJEGwxgFQ9KSmktdIQAJ+P5L4imwwNgU2jPyT+Qq4B
 bolQsPCmKFCskV8QkZxhVCzQoKuOyfQZDqhtFgEO4ALN9EHpHFYCFugnuwpZ805C
 D7ToKhsNgAkS7S8s/fyDof9JwBbD0e/c9k+GqeR5CmhMUqhmPwQD/hxAawE022UC
 jOqX5ZSEOMkMZDKLMo1Ss8C1pwuU0J+F2U0C4471dopM8gTnwrvwHXGYbfxkQtmH
 z+eCk13YOO5ZjP4wOVftk07VrF1aFtjbbet53/rN9SBURCxLavA3rvLU9aLY2m0K
 Jrx3NWq2qgdcsExqcUCU+T8Znyn5xo6UclXiCm36VxEG6TYgjxKuhewNQY/lCWhu
 4I+hNzu7oI6kPniok3IYarRFG7lfHyeY942ZfdOXx0CBOV/iy5o7nITXk7k22t9P
 MPXa8Nv+mlp7vyLtWEQKZd5jBobCYnC6ERJB86lQ+/TI1I1+/L6REkENfKEfHmGU
 sO4qcDhBb9UEJRg3s1OQWuTJ7MKXdL6rF6UY3xuuoVgwA+bYNXQhfN/cIn0c+QFS
 IvnjTtEikG7h5h/e1WtcdeA+jEDVQOXRAqYKFnCqXwkVfjbDy/gBp1oqW5d/Sb90
 Dt3okYpNiPtIOv/1cKCXbURS0r+pdA7bwW2bebte72OwCGDgerJisdxxLhd6gbsF
 virl4c4jGnjUy8kS9Ftb
 =Oc6V
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2012-06-01 15:39:26 -07:00
commit 37b22400f8
4 changed files with 29 additions and 12 deletions

View File

@ -1988,6 +1988,13 @@ static int hdspm_get_system_sample_rate(struct hdspm *hdspm)
period = hdspm_read(hdspm, HDSPM_RD_PLL_FREQ);
rate = hdspm_calc_dds_value(hdspm, period);
if (rate > 207000) {
/* Unreasonable high sample rate as seen on PCI MADI cards.
* Use the cached value instead.
*/
rate = hdspm->system_sample_rate;
}
return rate;
}

View File

@ -543,7 +543,7 @@ static int imx_ssi_probe(struct platform_device *pdev)
ret);
goto failed_clk;
}
clk_enable(ssi->clk);
clk_prepare_enable(ssi->clk);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
@ -641,7 +641,7 @@ failed_ac97:
failed_ioremap:
release_mem_region(res->start, resource_size(res));
failed_get_resource:
clk_disable(ssi->clk);
clk_disable_unprepare(ssi->clk);
clk_put(ssi->clk);
failed_clk:
kfree(ssi);
@ -664,7 +664,7 @@ static int __devexit imx_ssi_remove(struct platform_device *pdev)
iounmap(ssi->base);
release_mem_region(res->start, resource_size(res));
clk_disable(ssi->clk);
clk_disable_unprepare(ssi->clk);
clk_put(ssi->clk);
kfree(ssi);

View File

@ -1052,6 +1052,13 @@ static int fsi_dma_quit(struct fsi_priv *fsi, struct fsi_stream *io)
return 0;
}
static dma_addr_t fsi_dma_get_area(struct fsi_stream *io)
{
struct snd_pcm_runtime *runtime = io->substream->runtime;
return io->dma + samples_to_bytes(runtime, io->buff_sample_pos);
}
static void fsi_dma_complete(void *data)
{
struct fsi_stream *io = (struct fsi_stream *)data;
@ -1061,7 +1068,7 @@ static void fsi_dma_complete(void *data)
enum dma_data_direction dir = fsi_stream_is_play(fsi, io) ?
DMA_TO_DEVICE : DMA_FROM_DEVICE;
dma_sync_single_for_cpu(dai->dev, io->dma,
dma_sync_single_for_cpu(dai->dev, fsi_dma_get_area(io),
samples_to_bytes(runtime, io->period_samples), dir);
io->buff_sample_pos += io->period_samples;
@ -1078,13 +1085,6 @@ static void fsi_dma_complete(void *data)
snd_pcm_period_elapsed(io->substream);
}
static dma_addr_t fsi_dma_get_area(struct fsi_stream *io)
{
struct snd_pcm_runtime *runtime = io->substream->runtime;
return io->dma + samples_to_bytes(runtime, io->buff_sample_pos);
}
static void fsi_dma_do_tasklet(unsigned long data)
{
struct fsi_stream *io = (struct fsi_stream *)data;
@ -1110,7 +1110,7 @@ static void fsi_dma_do_tasklet(unsigned long data)
len = samples_to_bytes(runtime, io->period_samples);
buf = fsi_dma_get_area(io);
dma_sync_single_for_device(dai->dev, io->dma, len, dir);
dma_sync_single_for_device(dai->dev, buf, len, dir);
sg_init_table(&sg, 1);
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)
static void fsi_dma_push_start_stop(struct fsi_priv *fsi, struct fsi_stream *io,
int start)
{
struct fsi_master *master = fsi_get_master(fsi);
u32 clk = fsi_is_port_a(fsi) ? CRA : CRB;
u32 enable = start ? DMA_ON : 0;
fsi_reg_mask_set(fsi, OUT_DMAC, DMA_ON, enable);
dmaengine_terminate_all(io->chan);
if (fsi_is_clk_master(fsi))
fsi_master_mask_set(master, CLK_RST, clk, (enable) ? clk : 0);
}
static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io)

View File

@ -788,6 +788,9 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime,
int count = 0, needs_knot = 0;
int err;
kfree(subs->rate_list.list);
subs->rate_list.list = NULL;
list_for_each_entry(fp, &subs->fmt_list, list) {
if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS)
return 0;