Date:2012-01-15 00:56:11 (8 years 8 months ago)
Author:Lars C.
Commit:069052c14a1fda713b14175ccdc2a132b8a21732
Message:Revert "ASoC: JZ4740: Support buffer size that is not a multiple of period size."

This reverts commit fcc71f3634c3aa6c77222256eb09b97f44dd5961.
Files: sound/soc/jz4740/jz4740-pcm.c (7 diffs)

Change Details

sound/soc/jz4740/jz4740-pcm.c
3131
3232struct jz4740_runtime_data {
3333    unsigned long dma_period;
34    unsigned long dma_period_left;
3534    dma_addr_t dma_start;
3635    dma_addr_t dma_pos;
3736    dma_addr_t dma_end;
...... 
6867    if (prtd->dma_pos == prtd->dma_end)
6968        prtd->dma_pos = prtd->dma_start;
7069
71    if (prtd->dma_period_left == 0)
72        prtd->dma_period_left = prtd->dma_period;
73
74    if (prtd->dma_pos + prtd->dma_period_left > prtd->dma_end)
70    if (prtd->dma_pos + prtd->dma_period > prtd->dma_end)
7571        count = prtd->dma_end - prtd->dma_pos;
7672    else
77        count = prtd->dma_period_left;
73        count = prtd->dma_period;
7874
7975    jz4740_dma_disable(prtd->dma);
8076
...... 
8985    jz4740_dma_set_transfer_count(prtd->dma, count);
9086
9187    prtd->dma_pos += count;
92    prtd->dma_period_left -= count;
9388
9489    jz4740_dma_enable(prtd->dma);
9590}
...... 
10196    struct snd_pcm_runtime *runtime = substream->runtime;
10297    struct jz4740_runtime_data *prtd = runtime->private_data;
10398
104    if (prtd->dma_period_left == 0)
105        snd_pcm_period_elapsed(substream);
99    snd_pcm_period_elapsed(substream);
106100
107101    jz4740_pcm_start_transfer(prtd, substream);
108102}
...... 
139133    runtime->dma_bytes = params_buffer_bytes(params);
140134
141135    prtd->dma_period = params_period_bytes(params);
142    prtd->dma_period_left = 0;
143136    prtd->dma_start = runtime->dma_addr;
144137    prtd->dma_pos = prtd->dma_start;
145138    prtd->dma_end = prtd->dma_start + runtime->dma_bytes;
...... 
167160    if (!prtd->dma)
168161        return -EBUSY;
169162
170    prtd->dma_period_left = 0;
171163    prtd->dma_pos = prtd->dma_start;
172164
173165    return 0;
...... 
227219    if (prtd == NULL)
228220        return -ENOMEM;
229221
230    /* Force period and buffer size to be a multiple of the DMA transfer
231     * size, which is 16 bytes. */
232    snd_pcm_hw_constraint_step(runtime, 0,
233                   SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 16);
234    snd_pcm_hw_constraint_step(runtime, 0,
235                   SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 16);
236
237222    snd_soc_set_runtime_hwparams(substream, &jz4740_pcm_hardware);
238223
239224    runtime->private_data = prtd;

Archive Download the corresponding diff file



interactive