diff options
author | Zeng Zhaoming <b32542@freescale.com> | 2011-03-10 02:43:46 +0800 |
---|---|---|
committer | Alex Gonzalez <alex.gonzalez@digi.com> | 2011-08-01 09:51:17 +0200 |
commit | c8afbb0445d2dbcafd5ef96c454de26f7b1da18b (patch) | |
tree | f8d9710e5c0af6b2a13e20fa762ae856242c871c /sound | |
parent | 7e5224a0db761e377d5406d7b56dbce4bd62376c (diff) |
ENGR00140460 spdif: Fix spdif can't playback at the first bootup
spdif can't playback at system first bootup, write I/O error print out.
This problem is caused by DMA channel not requested before enable spdif dma
trigger register.
Signed-off-by: Zeng Zhaoming <b32542@freescale.com>
Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/arm/mxc-alsa-spdif.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sound/arm/mxc-alsa-spdif.c b/sound/arm/mxc-alsa-spdif.c index 282cd6c3720a..523a8079225c 100644 --- a/sound/arm/mxc-alsa-spdif.c +++ b/sound/arm/mxc-alsa-spdif.c @@ -881,6 +881,7 @@ spdif_configure_dma_channel(struct mxc_spdif_stream *s, } pr_debug("spdif_configure_dma_channel: %d\n", channel); + spdif_dma_enable(SCR_DMA_TX_EN, 1); ret = mxc_dma_callback_set(channel, (mxc_dma_callback_t) callback, (void *)s); @@ -889,6 +890,7 @@ spdif_configure_dma_channel(struct mxc_spdif_stream *s, mxc_dma_free(channel); return -1; } + s->dma_wchannel = channel; return 0; } @@ -980,8 +982,15 @@ static void spdif_start_tx(struct mxc_spdif_stream *s) dma_request.dst_addr = (dma_addr_t) (chip->reg_phys_base + 0x2c); dma_request.num_of_bytes = dma_size; - mxc_dma_config(s->dma_wchannel, &dma_request, 1, + ret = mxc_dma_config(s->dma_wchannel, &dma_request, 1, MXC_DMA_MODE_WRITE); + + if (ret) { + printk(KERN_ERR "%s %d config dma channel failed %d\n", + __func__, __LINE__, ret); + return; + } + ret = mxc_dma_enable(s->dma_wchannel); if (ret) { pr_info("audio_process_dma: cannot queue DMA \ @@ -1034,9 +1043,9 @@ static void spdif_start_tx(struct mxc_spdif_stream *s) s->period++; s->period %= runtime->periods; - } else + } else { spdif_dma_enable(SCR_DMA_TX_EN, 0); - + } return; } @@ -1639,6 +1648,7 @@ static int snd_mxc_spdif_hw_params(struct snd_pcm_substream struct snd_pcm_runtime *runtime; int ret = 0; runtime = substream->runtime; + ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); if (ret < 0) { @@ -1646,7 +1656,6 @@ static int snd_mxc_spdif_hw_params(struct snd_pcm_substream return ret; } runtime->dma_addr = virt_to_phys(runtime->dma_area); - spdif_dma_enable(SCR_DMA_TX_EN, 1); return ret; } |