Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dma: dw: allow to stop in DW_DMA_SUSPENDED state #54900

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions drivers/dma/dma_dw_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,21 +517,18 @@ int dw_dma_stop(const struct device *dev, uint32_t channel)
{
const struct dw_dma_dev_cfg *const dev_cfg = dev->config;
struct dw_dma_dev_data *dev_data = dev->data;
struct dw_dma_chan_data *chan_data = &dev_data->chan[channel];
int ret = 0;

if (channel >= DW_MAX_CHAN) {
ret = -EINVAL;
goto out;
}

if (!dw_dma_is_enabled(dev, channel)) {
if (!dw_dma_is_enabled(dev, channel) && chan_data->state != DW_DMA_SUSPENDED) {
goto out;
}

#if defined(CONFIG_DMA_DW_HW_LLI) || defined(CONFIG_DMA_DW_SUSPEND_DRAIN)
struct dw_dma_chan_data *chan_data = &dev_data->chan[channel];
#endif

#ifdef CONFIG_DMA_DW_HW_LLI
struct dw_lli *lli = chan_data->lli;
int i;
Expand Down