diff options
author | Zeng Zhaoming <b32542@freescale.com> | 2011-03-10 02:43:46 +0800 |
---|---|---|
committer | Zeng Zhaoming <b32542@freescale.com> | 2011-03-14 02:15:36 +0800 |
commit | f72cbf0ef2ad6289109ed27ee979b98fd7c3cfd5 (patch) | |
tree | 0565abad741771fcb3e9e2be84331ef9d9d43258 | |
parent | 0a776d3bf3ca161203e81545ffb1fcf1aa839b62 (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>
-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; } |