Skip to content

Commit 4095cf8

Browse files
Venkata-Prasad-Potturubroonie
authored andcommitted
ASoC: amd: yc: Fix for enabling DMIC on acp6x via _DSD entry
Add condition check to register ACP PDM sound card by reading _WOV acpi entry. Fixes: 5426f50 ("ASoC: amd: Add support for enabling DMIC on acp6x via _DSD") Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://patch.msgid.link/20241127112227.227106-1-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent cbc86dd commit 4095cf8

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

sound/soc/amd/yc/acp6x-mach.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,18 +551,34 @@ static int acp6x_probe(struct platform_device *pdev)
551551
struct acp6x_pdm *machine = NULL;
552552
struct snd_soc_card *card;
553553
struct acpi_device *adev;
554+
acpi_handle handle;
555+
acpi_integer dmic_status;
554556
int ret;
557+
bool is_dmic_enable, wov_en;
555558

559+
/* IF WOV entry not found, enable dmic based on AcpDmicConnected entry*/
560+
is_dmic_enable = false;
561+
wov_en = true;
556562
/* check the parent device's firmware node has _DSD or not */
557563
adev = ACPI_COMPANION(pdev->dev.parent);
558564
if (adev) {
559565
const union acpi_object *obj;
560566

561567
if (!acpi_dev_get_property(adev, "AcpDmicConnected", ACPI_TYPE_INTEGER, &obj) &&
562568
obj->integer.value == 1)
563-
platform_set_drvdata(pdev, &acp6x_card);
569+
is_dmic_enable = true;
564570
}
565571

572+
handle = ACPI_HANDLE(pdev->dev.parent);
573+
ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
574+
if (!ACPI_FAILURE(ret))
575+
wov_en = dmic_status;
576+
577+
if (is_dmic_enable && wov_en)
578+
platform_set_drvdata(pdev, &acp6x_card);
579+
else
580+
return 0;
581+
566582
/* check for any DMI overrides */
567583
dmi_id = dmi_first_match(yc_acp_quirk_table);
568584
if (dmi_id)

0 commit comments

Comments
 (0)