dw-dma: disable linear link position when releasing dma channel

The linear link position is only used by windows driver for
computing present position. When doing pause-resume operation
only zero data is reported by linear link position register.

Currently when stream is resumed after paused, dw-dma will
be first stopped and then started and the value of link position
register is cleared when it is disabled.

This patch will disable linear link position when the dma channel
is released

Signed-off-by: Rander Wang <rander.wang@intel.com>
This commit is contained in:
Rander Wang 2022-02-09 16:01:04 +08:00 committed by Liam Girdwood
parent fb19dcb8f5
commit fa287e637b
2 changed files with 8 additions and 5 deletions

View File

@ -228,6 +228,9 @@ static void dw_dma_channel_put_unlocked(struct dma_chan_data *channel)
dw_dma_interrupt_mask(channel);
/* disable linear link position */
platform_dw_dma_llp_disable(channel->dma, channel);
/* free the lli allocated by set_config*/
if (dw_chan->lli) {
rfree(dw_chan->lli);
@ -443,9 +446,6 @@ static int dw_dma_stop(struct dma_chan_data *channel)
sizeof(struct dw_lli) * channel->desc_count);
#endif
/* disable linear link position */
platform_dw_dma_llp_disable(dma, channel);
channel->status = COMP_STATE_PREPARE;
out:

View File

@ -80,8 +80,11 @@ static inline void platform_dw_dma_llp_config(struct dma *dma,
static inline void platform_dw_dma_llp_enable(struct dma *dma,
struct dma_chan_data *chan)
{
shim_write(DW_CHLLPC(dma, chan),
shim_read(DW_CHLLPC(dma, chan)) | SHIM_GPDMA_CHLLPC_EN);
uint32_t val;
val = shim_read(DW_CHLLPC(dma, chan));
if (!(val & SHIM_GPDMA_CHLLPC_EN))
shim_write(DW_CHLLPC(dma, chan), val | SHIM_GPDMA_CHLLPC_EN);
}
static inline void platform_dw_dma_llp_disable(struct dma *dma,