soc: rockchip: aoa_middleware: Remove the restriction that DMA count cannot be greater than periods

In AOR mode, the DMA count does not need to correspond
to the AAD frame count, and the maximum DMA count range
can be used, such as 16-bit 0 to 65535 in RV1126B.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Change-Id: Ia5143d788d2c7fb142ffd453e25fbf2aa867348b
This commit is contained in:
Xing Zheng
2025-09-12 21:22:17 +08:00
committed by Tao Huang
parent 9c6f4c5898
commit 8ee05d07ba

View File

@@ -90,11 +90,7 @@ int aoa_middleware_dma_notifier(s32 dma_count, void *data)
kill_fasync(&amw_d->rk_dma_fasync_queue, SIGRTMIN + 0, POLL_IN);
/* ns_id: start from 1, range: 0 ~ (periods-1) */
if (dma_count < 0 || dma_count >= n_rkdma->periods) {
pr_err("Invalid dma_count: %d >= periods: %d\n", dma_count, n_rkdma->periods);
return -EINVAL;
}
dma_count = array_index_nospec(dma_count, n_rkdma->periods);
dma_count = array_index_nospec(dma_count % n_rkdma->periods, n_rkdma->periods);
n_ns->ns_id = dma_count;
n_rkdma->ns_tbl[n_ns->ns_id] = n_ns->ns;
if (n_ns->ns_id < n_rkdma->last_ns_id)