Merge pull request #517 from mmaka1/hda-size-fixed

dma: hda: Free size computation fixed
This commit is contained in:
Liam Girdwood 2018-10-29 16:50:22 +00:00 committed by GitHub
commit 04b1ce4883
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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 wp = host_dma_reg_read(dma, chan, DGBWP);
uint32_t ds;
int32_t ds;
if (!(cs & DGCS_BNE))
return 0; /* buffer is empty */
ds = wp - rp;
ds = (int32_t)wp - (int32_t)rp;
if (ds <= 0)
ds += bs;