diff options
Diffstat (limited to 'sound/soc/omap/omap-pcm.c')
-rw-r--r-- | sound/soc/omap/omap-pcm.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index c3c931d4537a..3e3a9d478c0d 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c | |||
@@ -59,16 +59,18 @@ static void omap_pcm_dma_irq(int ch, u16 stat, void *data) | |||
59 | struct omap_runtime_data *prtd = runtime->private_data; | 59 | struct omap_runtime_data *prtd = runtime->private_data; |
60 | unsigned long flags; | 60 | unsigned long flags; |
61 | 61 | ||
62 | if (cpu_is_omap1510()) { | 62 | if ((cpu_is_omap1510()) && |
63 | (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)) { | ||
63 | /* | 64 | /* |
64 | * OMAP1510 doesn't support DMA chaining so have to restart | 65 | * OMAP1510 doesn't fully support DMA progress counter |
65 | * the transfer after all periods are transferred | 66 | * and there is no software emulation implemented yet, |
67 | * so have to maintain our own playback progress counter | ||
68 | * that can be used by omap_pcm_pointer() instead. | ||
66 | */ | 69 | */ |
67 | spin_lock_irqsave(&prtd->lock, flags); | 70 | spin_lock_irqsave(&prtd->lock, flags); |
68 | if (prtd->period_index >= 0) { | 71 | if (prtd->period_index >= 0) { |
69 | if (++prtd->period_index == runtime->periods) { | 72 | if (++prtd->period_index == runtime->periods) { |
70 | prtd->period_index = 0; | 73 | prtd->period_index = 0; |
71 | omap_start_dma(prtd->dma_ch); | ||
72 | } | 74 | } |
73 | } | 75 | } |
74 | spin_unlock_irqrestore(&prtd->lock, flags); | 76 | spin_unlock_irqrestore(&prtd->lock, flags); |
@@ -100,7 +102,7 @@ static int omap_pcm_hw_params(struct snd_pcm_substream *substream, | |||
100 | prtd->dma_data = dma_data; | 102 | prtd->dma_data = dma_data; |
101 | err = omap_request_dma(dma_data->dma_req, dma_data->name, | 103 | err = omap_request_dma(dma_data->dma_req, dma_data->name, |
102 | omap_pcm_dma_irq, substream, &prtd->dma_ch); | 104 | omap_pcm_dma_irq, substream, &prtd->dma_ch); |
103 | if (!err && !cpu_is_omap1510()) { | 105 | if (!err) { |
104 | /* | 106 | /* |
105 | * Link channel with itself so DMA doesn't need any | 107 | * Link channel with itself so DMA doesn't need any |
106 | * reprogramming while looping the buffer | 108 | * reprogramming while looping the buffer |
@@ -119,8 +121,7 @@ static int omap_pcm_hw_free(struct snd_pcm_substream *substream) | |||
119 | if (prtd->dma_data == NULL) | 121 | if (prtd->dma_data == NULL) |
120 | return 0; | 122 | return 0; |
121 | 123 | ||
122 | if (!cpu_is_omap1510()) | 124 | omap_dma_unlink_lch(prtd->dma_ch, prtd->dma_ch); |
123 | omap_dma_unlink_lch(prtd->dma_ch, prtd->dma_ch); | ||
124 | omap_free_dma(prtd->dma_ch); | 125 | omap_free_dma(prtd->dma_ch); |
125 | prtd->dma_data = NULL; | 126 | prtd->dma_data = NULL; |
126 | 127 | ||