Skip to content

SDMA: Fix sound issues caused by SDMA driver #90330

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

Merged
merged 2 commits into from
May 28, 2025
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
8 changes: 8 additions & 0 deletions drivers/dma/dma_nxp_sdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ static void dma_nxp_sdma_setup_bd(const struct device *dev, uint32_t channel,

chan_data = &dev_data->chan[channel];

chan_data->capacity = 0;

/* initialize bd pool */
chan_data->bd_pool = &dev_data->bd_pool[channel][0];
chan_data->bd_count = config->block_count;
Expand Down Expand Up @@ -374,11 +376,14 @@ static int dma_nxp_sdma_get_status(const struct device *dev, uint32_t channel,
{
struct sdma_dev_data *dev_data = dev->data;
struct sdma_channel_data *chan_data;
unsigned int key;

chan_data = &dev_data->chan[channel];

key = irq_lock();
stat->free = chan_data->stat.free;
stat->pending_length = chan_data->stat.pending_length;
irq_unlock(key);

return 0;
}
Expand All @@ -388,18 +393,21 @@ static int dma_nxp_sdma_reload(const struct device *dev, uint32_t channel, uint3
{
struct sdma_dev_data *dev_data = dev->data;
struct sdma_channel_data *chan_data;
unsigned int key;

chan_data = &dev_data->chan[channel];

if (!size) {
return 0;
}

key = irq_lock();
if (chan_data->direction == MEMORY_TO_PERIPHERAL) {
dma_nxp_sdma_produce(chan_data, size);
} else {
dma_nxp_sdma_consume(chan_data, size);
}
irq_unlock(key);

return 0;
}
Expand Down
Loading