summaryrefslogtreecommitdiffstats
path: root/sound/soc/amd
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2022-04-11 08:45:32 -0500
committerMark Brown <broonie@kernel.org>2022-04-11 19:18:06 +0100
commit5426f506b58424f8ab2cd741bacf4b18b5fe578e (patch)
tree7b86c2433c2dd4546fb3c87fb865df030ce54873 /sound/soc/amd
parente521f087780d07731e8c950f2f34d08358c86bc9 (diff)
downloadlinux-5426f506b58424f8ab2cd741bacf4b18b5fe578e.tar.gz
linux-5426f506b58424f8ab2cd741bacf4b18b5fe578e.tar.bz2
linux-5426f506b58424f8ab2cd741bacf4b18b5fe578e.zip
ASoC: amd: Add support for enabling DMIC on acp6x via _DSD
Currently the acp6x machine driver requires a hardcoded list of systems that physically have DMIC connected. To avoid having to continually add to an evergrowing list of systems add support for a _DSD that can advertise this. OEMs can add this _DSD to their BIOS under the ACP device to automatically add the device to this driver without requiring any driver modifications. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20220411134532.13538-3-mario.limonciello@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd')
-rw-r--r--sound/soc/amd/yc/acp6x-mach.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c
index 959b70e8baf2..f06e6c1a7799 100644
--- a/sound/soc/amd/yc/acp6x-mach.c
+++ b/sound/soc/amd/yc/acp6x-mach.c
@@ -12,6 +12,7 @@
#include <sound/pcm_params.h>
#include <linux/io.h>
#include <linux/dmi.h>
+#include <linux/acpi.h>
#include "acp6x.h"
@@ -178,8 +179,19 @@ static int acp6x_probe(struct platform_device *pdev)
const struct dmi_system_id *dmi_id;
struct acp6x_pdm *machine = NULL;
struct snd_soc_card *card;
+ struct acpi_device *adev;
int ret;
+ /* check the parent device's firmware node has _DSD or not */
+ adev = ACPI_COMPANION(pdev->dev.parent);
+ if (adev) {
+ const union acpi_object *obj;
+
+ if (!acpi_dev_get_property(adev, "AcpDmicConnected", ACPI_TYPE_INTEGER, &obj) &&
+ obj->integer.value == 1)
+ platform_set_drvdata(pdev, &acp6x_card);
+ }
+
/* check for any DMI overrides */
dmi_id = dmi_first_match(yc_acp_quirk_table);
if (dmi_id)
@@ -188,6 +200,7 @@ static int acp6x_probe(struct platform_device *pdev)
card = platform_get_drvdata(pdev);
if (!card)
return -ENODEV;
+ dev_info(&pdev->dev, "Enabling ACP DMIC support via %s", dmi_id ? "DMI" : "ACPI");
acp6x_card.dev = &pdev->dev;
snd_soc_card_set_drvdata(card, machine);