summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuirong Wang <kuirongw@codeaurora.org>2016-07-24 21:04:28 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-09-21 10:13:21 -0700
commitb105c4f9de089c0d8ec4393aeda66fad807018e9 (patch)
tree797db149c9aed27cb9efa3fc698b9dfdc7399d5e
parent9e2d528dc47d04e98c5e6f1c4ef84fc268115d36 (diff)
ASoC: msm: update to align afe memory mapping as multiple of 4KB
It is required the buffer size to ADSP are multiple of 4kB. Update the buffer size to be 4kB alignment before passing to ADSP. CRs-Fixed: 1040066 Change-Id: I34f1b611000f5d9e4ae4c13a89b8571faa0f3393 Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
-rw-r--r--sound/soc/msm/qdsp6v2/q6afe.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/msm/qdsp6v2/q6afe.c b/sound/soc/msm/qdsp6v2/q6afe.c
index f6a687611f8a..1ef3d604adde 100644
--- a/sound/soc/msm/qdsp6v2/q6afe.c
+++ b/sound/soc/msm/qdsp6v2/q6afe.c
@@ -4009,6 +4009,14 @@ int afe_cmd_memory_map(phys_addr_t dma_addr_p, u32 dma_buf_sz)
}
rtac_set_afe_handle(this_afe.apr);
}
+ if (dma_buf_sz % SZ_4K != 0) {
+ /*
+ * The memory allocated by msm_audio_ion_alloc is always 4kB
+ * aligned, ADSP expects the size to be 4kB aligned as well
+ * so re-adjusts the buffer size before passing to ADSP.
+ */
+ dma_buf_sz = PAGE_ALIGN(dma_buf_sz);
+ }
cmd_size = sizeof(struct afe_service_cmd_shared_mem_map_regions) \
+ sizeof(struct afe_service_shared_map_region_payload);