diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-05-31 15:19:31 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-05-31 15:19:31 -0400 |
commit | fbf2045af7691fbab2fd9f6d6fa96839bea13d31 (patch) | |
tree | 4c3c235799a4ff12900ab023254c52e4209ad7d4 | |
parent | a97bda7d29d02a2e9c6609d0947b15e55f5200e5 (diff) | |
parent | fbe42f66c66c279b4ed9b8f515058a09bc731c49 (diff) |
Merge tag 'asoc-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: A few bug fixes for the merge window
Small driver-specific updates.
-rw-r--r-- | sound/soc/fsl/imx-ssi.c | 6 | ||||
-rw-r--r-- | sound/soc/sh/fsi.c | 25 |
2 files changed, 19 insertions, 12 deletions
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: | |||
641 | failed_ioremap: | 641 | failed_ioremap: |
642 | release_mem_region(res->start, resource_size(res)); | 642 | release_mem_region(res->start, resource_size(res)); |
643 | failed_get_resource: | 643 | failed_get_resource: |
644 | clk_disable(ssi->clk); | 644 | clk_disable_unprepare(ssi->clk); |
645 | clk_put(ssi->clk); | 645 | clk_put(ssi->clk); |
646 | failed_clk: | 646 | failed_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 | ||
1055 | static 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 | |||
1055 | static void fsi_dma_complete(void *data) | 1062 | static 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 | ||
1081 | static 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 | |||
1088 | static void fsi_dma_do_tasklet(unsigned long data) | 1088 | static 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) | |||
1172 | static void fsi_dma_push_start_stop(struct fsi_priv *fsi, struct fsi_stream *io, | 1172 | static 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 | ||
1180 | static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io) | 1187 | static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io) |