]> www.infradead.org Git - users/dwmw2/linux.git/commit
ASoC: amd: acp: fix for acp platform device creation failure
authorVijendar Mukunda <Vijendar.Mukunda@amd.com>
Thu, 2 May 2024 14:03:25 +0000 (19:33 +0530)
committerMark Brown <broonie@kernel.org>
Fri, 3 May 2024 02:07:36 +0000 (11:07 +0900)
commit09068d624c490c0e89f33f963c402f1859964467
tree00095044214e3cdcbbef7d2a2e012a095a40f8c6
parentc5782bb5468acf86d8ca8e161267e8d055fb4161
ASoC: amd: acp: fix for acp platform device creation failure

ACP pin configuration varies based on acp version.
ACP PCI driver should read the ACP PIN config value and based on config
value, it has to create a platform device in below two conditions.
1) If ACP PDM configuration is selected from BIOS and ACP PDM controller
exists.
2) If ACP I2S configuration is selected from BIOS.

Other than above scenarios, ACP PCI driver should skip the platform
device creation logic, i.e. ACP PCI driver probe sequence should never
fail if other acp pin configuration is selected. It should skip platform
device creation logic.

check_acp_pdm() function was implemented for ACP6.x platforms to check
ACP PDM configuration. Previously, this code was safe guarded by
FLAG_AMD_LEGACY_ONLY_DMIC flag check.

This implementation breaks audio use cases for Huawei Matebooks which are
based on ACP3.x varaint uses I2S configuration.
In current scenario, check_acp_pdm() function returns -ENODEV value
which results in ACP PCI driver probe failure without creating a platform
device even in case of valid ACP pin configuration.

Implement check_acp_config() as a common function which invokes platform
specific acp pin configuration check functions for ACP3.x, ACP6.0 & ACP6.3
& ACP7.0 variants and checks for ACP PDM controller.

Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218780
Fixes: 4af565de9f8c ("ASoC: amd: acp: fix for acp pdm configuration check")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20240502140340.4049021-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/amd/acp/acp-legacy-common.c
sound/soc/amd/acp/acp-pci.c
sound/soc/amd/acp/amd.h
sound/soc/amd/acp/chip_offset_byte.h