linux/sound/soc/amd
Yu Zhao b4ba1c27a0 ASoC: use dma_ops of parent device for acp_audio_dma
[ Upstream commit 23aa128bb2 ]

AMD platform device acp_audio_dma can only be created by parent PCI
device driver (drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c). 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.

Though platform device inherits some dma related fields during its
creation in mfd_add_device(), we can't simply pass its struct device
to snd_pcm_lib_preallocate_pages() because dma_ops is not among the
inherited fields. Even it were, drivers/iommu/amd_iommu.c would
ignore it because get_device_id() doesn't handle platform device.

This change shouldn't give us any trouble even struct device of the
parent becomes null or represents some non PCI device in the future,
because get_dma_ops() correctly handles null struct device or uses
the default dma_ops if struct device doesn't have it set.

Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2019-01-26 09:20:44 +01:00
..
include ASoC: AMD : add ACP 2.2 register headers 2016-01-10 12:44:10 +00:00
acp-da7219-max98357a.c ASoC: AMD: Add SND_JACK_LINEOUT jack type 2018-10-15 12:01:32 +01:00
acp-pcm-dma.c ASoC: use dma_ops of parent device for acp_audio_dma 2019-01-26 09:20:44 +01:00
acp-rt5645.c ASoC: rt5645/rt5677: replace codec to component 2018-02-12 11:18:44 +00:00
acp.h ASoC: AMD: Fix simultaneous playback and capture on different channel 2018-09-10 18:46:09 +01:00
Kconfig ASoC: AMD: Add a fix voltage regulator for DA7219 and ADAU7002 2018-07-26 14:07:47 +01:00
Makefile ASoC: AMD: Add machine driver for ST DA7219 MAX98357 2018-02-16 16:03:46 +00:00