• Shawn Guo's avatar
    dmaengine: zx: fix residue calculation · 156ae092
    Shawn Guo authored
    The dma residue is defined as the free space to end of transfer buffer,
    which could be multiple segments chained together.  So the residue
    calculation in zx_dma_tx_status() works for both slave_sg and cyclic
    case.  But unfortunately, the 'index' is wrong.  It should plus one,
    because the current segment is already occupied and shouldn't be counted
    into free space.
    
    This fixes the HDMI audio noise issue we see on ZX296718 with SPDIF
    interface.
    Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
    Reviewed-by: default avatarJun Nie <jun.nie@linaro.org>
    Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
    156ae092
zx_dma.c 23.5 KB