Skip to content

Commit

Permalink
dma: hda: trigger link commit at dma_start
Browse files Browse the repository at this point in the history
This will trigger link commit immediately after start
to fix hda start flow.
Applies to link out only.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
  • Loading branch information
abonislawski authored and fabiobaltieri committed Sep 30, 2022
1 parent 8c90c40 commit 7eeeff5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/dma/dma_intel_adsp_hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,15 @@ bool intel_adsp_hda_dma_chan_filter(const struct device *dev, int channel, void
int intel_adsp_hda_dma_start(const struct device *dev, uint32_t channel)
{
const struct intel_adsp_hda_dma_cfg *const cfg = dev->config;
uint32_t size;

__ASSERT(channel < cfg->dma_channels, "Channel does not exist");

intel_adsp_hda_enable(cfg->base, cfg->regblock_size, channel);
if (cfg->direction == MEMORY_TO_PERIPHERAL) {
size = intel_adsp_hda_get_buffer_size(cfg->base, cfg->regblock_size, channel);
intel_adsp_hda_link_commit(cfg->base, cfg->regblock_size, channel, size);
}

return 0;
}
Expand Down
17 changes: 17 additions & 0 deletions soc/xtensa/intel_adsp/common/include/intel_adsp_hda.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,23 @@ static inline int intel_adsp_hda_set_buffer(uint32_t base,
return 0;
}

/**
* @brief Get the buffer size
*
* @param hda Stream set to work with
* @param regblock_size Register block size
* @param sid Stream ID
*
* @retval buf_size Buffer size in bytes
*/
static inline uint32_t intel_adsp_hda_get_buffer_size(uint32_t base,
uint32_t regblock_size,
uint32_t sid)
{

return *DGBS(base, regblock_size, sid);
}

/**
* @brief Enable the stream
*
Expand Down

0 comments on commit 7eeeff5

Please sign in to comment.