mirror of https://github.com/thesofproject/sof.git
Merge pull request #517 from mmaka1/hda-size-fixed
dma: hda: Free size computation fixed
This commit is contained in:
commit
04b1ce4883
|
@ -162,11 +162,11 @@ static inline uint32_t hda_dma_get_data_size(struct dma *dma, uint32_t chan)
|
||||||
const uint32_t rp = host_dma_reg_read(dma, chan, DGBRP);
|
const uint32_t rp = host_dma_reg_read(dma, chan, DGBRP);
|
||||||
const uint32_t wp = host_dma_reg_read(dma, chan, DGBWP);
|
const uint32_t wp = host_dma_reg_read(dma, chan, DGBWP);
|
||||||
|
|
||||||
uint32_t ds;
|
int32_t ds;
|
||||||
|
|
||||||
if (!(cs & DGCS_BNE))
|
if (!(cs & DGCS_BNE))
|
||||||
return 0; /* buffer is empty */
|
return 0; /* buffer is empty */
|
||||||
ds = wp - rp;
|
ds = (int32_t)wp - (int32_t)rp;
|
||||||
if (ds <= 0)
|
if (ds <= 0)
|
||||||
ds += bs;
|
ds += bs;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue