Skip to content

Commit 8863905

Browse files
vijendarmukundabroonie
authored andcommitted
ASoC: amd: acp3x: use dma_ops of parent device for acp3x dma driver
AMD platform device acp3x_rv_i2s created by parent PCI device driver. Pass struct device of the parent to snd_pcm_lib_preallocate_pages() so dma_alloc_coherent() can use correct dma_ops. Otherwise, it will use default dma_ops which is nommu_dma_ops on x86_64 even when IOMMU is enabled and set to non passthrough mode. Signed-off-by: Vijendar Mukunda <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent b9da500 commit 8863905

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sound/soc/amd/raven/acp3x-pcm-dma.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,11 @@ static snd_pcm_uframes_t acp3x_dma_pointer(struct snd_pcm_substream *substream)
385385

386386
static int acp3x_dma_new(struct snd_soc_pcm_runtime *rtd)
387387
{
388+
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd,
389+
DRV_NAME);
390+
struct device *parent = component->dev->parent;
388391
snd_pcm_lib_preallocate_pages_for_all(rtd->pcm, SNDRV_DMA_TYPE_DEV,
389-
rtd->pcm->card->dev,
390-
MIN_BUFFER, MAX_BUFFER);
392+
parent, MIN_BUFFER, MAX_BUFFER);
391393
return 0;
392394
}
393395

0 commit comments

Comments
 (0)