mirror of https://github.com/thesofproject/sof.git
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:
parent
fb19dcb8f5
commit
fa287e637b
|
@ -228,6 +228,9 @@ static void dw_dma_channel_put_unlocked(struct dma_chan_data *channel)
|
||||||
|
|
||||||
dw_dma_interrupt_mask(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*/
|
/* free the lli allocated by set_config*/
|
||||||
if (dw_chan->lli) {
|
if (dw_chan->lli) {
|
||||||
rfree(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);
|
sizeof(struct dw_lli) * channel->desc_count);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* disable linear link position */
|
|
||||||
platform_dw_dma_llp_disable(dma, channel);
|
|
||||||
|
|
||||||
channel->status = COMP_STATE_PREPARE;
|
channel->status = COMP_STATE_PREPARE;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
|
@ -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,
|
static inline void platform_dw_dma_llp_enable(struct dma *dma,
|
||||||
struct dma_chan_data *chan)
|
struct dma_chan_data *chan)
|
||||||
{
|
{
|
||||||
shim_write(DW_CHLLPC(dma, chan),
|
uint32_t val;
|
||||||
shim_read(DW_CHLLPC(dma, chan)) | SHIM_GPDMA_CHLLPC_EN);
|
|
||||||
|
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,
|
static inline void platform_dw_dma_llp_disable(struct dma *dma,
|
||||||
|
|
Loading…
Reference in New Issue