Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] ASoC: amd: yc: Fix for enabling DMIC on acp6x via _DSD entry
@ 2024-11-27 11:22 Venkata Prasad Potturu
  2024-11-27 12:13 ` Mark Brown
  2024-11-27 12:36 ` Jaroslav Kysela
  0 siblings, 2 replies; 6+ messages in thread
From: Venkata Prasad Potturu @ 2024-11-27 11:22 UTC (permalink / raw)
  To: broonie, alsa-devel
  Cc: Vijendar.Mukunda, Basavaraj.Hiregoudar, Sunil-kumar.Dommati,
	syed.sabakareem, mario.limonciello, Venkata Prasad Potturu,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Tim Crawford,
	Attila Tőkés, Techno Mooney, Jeremy Soller,
	Malcolm Hart,
	open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	open list

Add condition check to register ACP PDM sound card by reading
_WOV acpi entry.

Fixes: 5426f506b584 ("ASoC: amd: Add support for enabling DMIC on acp6x via _DSD")

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
---
 sound/soc/amd/yc/acp6x-mach.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c
index 438865d5e376..c301dac8b979 100644
--- a/sound/soc/amd/yc/acp6x-mach.c
+++ b/sound/soc/amd/yc/acp6x-mach.c
@@ -523,8 +523,14 @@ static int acp6x_probe(struct platform_device *pdev)
 	struct acp6x_pdm *machine = NULL;
 	struct snd_soc_card *card;
 	struct acpi_device *adev;
+	acpi_handle handle;
+	acpi_integer dmic_status;
 	int ret;
+	bool is_dmic_enable, wov_en;
 
+	/* IF WOV entry not found, enable dmic based on AcpDmicConnected entry*/
+	is_dmic_enable = false;
+	wov_en = true;
 	/* check the parent device's firmware node has _DSD or not */
 	adev = ACPI_COMPANION(pdev->dev.parent);
 	if (adev) {
@@ -532,9 +538,19 @@ static int acp6x_probe(struct platform_device *pdev)
 
 		if (!acpi_dev_get_property(adev, "AcpDmicConnected", ACPI_TYPE_INTEGER, &obj) &&
 		    obj->integer.value == 1)
-			platform_set_drvdata(pdev, &acp6x_card);
+			is_dmic_enable = true;
 	}
 
+	handle = ACPI_HANDLE(pdev->dev.parent);
+	ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
+	if (!ACPI_FAILURE(ret))
+		wov_en = dmic_status;
+
+	if (is_dmic_enable && wov_en)
+		platform_set_drvdata(pdev, &acp6x_card);
+	else
+		return 0;
+
 	/* check for any DMI overrides */
 	dmi_id = dmi_first_match(yc_acp_quirk_table);
 	if (dmi_id)
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: amd: yc: Fix for enabling DMIC on acp6x via _DSD entry
  2024-11-27 11:22 [PATCH] ASoC: amd: yc: Fix for enabling DMIC on acp6x via _DSD entry Venkata Prasad Potturu
@ 2024-11-27 12:13 ` Mark Brown
  2024-11-27 12:36 ` Jaroslav Kysela
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Brown @ 2024-11-27 12:13 UTC (permalink / raw)
  To: alsa-devel, Venkata Prasad Potturu
  Cc: Vijendar.Mukunda, Basavaraj.Hiregoudar, Sunil-kumar.Dommati,
	syed.sabakareem, mario.limonciello, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, Tim Crawford,
	Attila Tőkés, Techno Mooney, Jeremy Soller,
	Malcolm Hart,
	open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	open list

On Wed, 27 Nov 2024 16:52:25 +0530, Venkata Prasad Potturu wrote:
> Add condition check to register ACP PDM sound card by reading
> _WOV acpi entry.
> 
> Fixes: 5426f506b584 ("ASoC: amd: Add support for enabling DMIC on acp6x via _DSD")
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: amd: yc: Fix for enabling DMIC on acp6x via _DSD entry
      commit: 4095cf872084ecfdfdb0e681f3e9ff9745acfa75

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: amd: yc: Fix for enabling DMIC on acp6x via _DSD entry
  2024-11-27 11:22 [PATCH] ASoC: amd: yc: Fix for enabling DMIC on acp6x via _DSD entry Venkata Prasad Potturu
  2024-11-27 12:13 ` Mark Brown
@ 2024-11-27 12:36 ` Jaroslav Kysela
  2024-11-27 17:04   ` potturu venkata prasad
  1 sibling, 1 reply; 6+ messages in thread
From: Jaroslav Kysela @ 2024-11-27 12:36 UTC (permalink / raw)
  To: Venkata Prasad Potturu, broonie, alsa-devel
  Cc: Vijendar.Mukunda, Basavaraj.Hiregoudar, Sunil-kumar.Dommati,
	syed.sabakareem, mario.limonciello, Liam Girdwood, Takashi Iwai,
	Tim Crawford, Attila Tőkés, Techno Mooney,
	Jeremy Soller, Malcolm Hart,
	open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	open list

On 27. 11. 24 12:22, Venkata Prasad Potturu wrote:
> Add condition check to register ACP PDM sound card by reading
> _WOV acpi entry.
> 
> Fixes: 5426f506b584 ("ASoC: amd: Add support for enabling DMIC on acp6x via _DSD")
> 
> Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
> ---
>   sound/soc/amd/yc/acp6x-mach.c | 18 +++++++++++++++++-
>   1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c
> index 438865d5e376..c301dac8b979 100644
> --- a/sound/soc/amd/yc/acp6x-mach.c
> +++ b/sound/soc/amd/yc/acp6x-mach.c
> @@ -523,8 +523,14 @@ static int acp6x_probe(struct platform_device *pdev)
>   	struct acp6x_pdm *machine = NULL;
>   	struct snd_soc_card *card;
>   	struct acpi_device *adev;
> +	acpi_handle handle;
> +	acpi_integer dmic_status;
>   	int ret;
> +	bool is_dmic_enable, wov_en;
>   
> +	/* IF WOV entry not found, enable dmic based on AcpDmicConnected entry*/
> +	is_dmic_enable = false;
> +	wov_en = true;
>   	/* check the parent device's firmware node has _DSD or not */
>   	adev = ACPI_COMPANION(pdev->dev.parent);
>   	if (adev) {
> @@ -532,9 +538,19 @@ static int acp6x_probe(struct platform_device *pdev)
>   
>   		if (!acpi_dev_get_property(adev, "AcpDmicConnected", ACPI_TYPE_INTEGER, &obj) &&
>   		    obj->integer.value == 1)
> -			platform_set_drvdata(pdev, &acp6x_card);
> +			is_dmic_enable = true;
>   	}
>   
> +	handle = ACPI_HANDLE(pdev->dev.parent);
> +	ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
> +	if (!ACPI_FAILURE(ret))
> +		wov_en = dmic_status;
> +
> +	if (is_dmic_enable && wov_en)
> +		platform_set_drvdata(pdev, &acp6x_card);
> +	else
> +		return 0;

The logic seems wrong. The overrides code bellow won't be executed when ACPI 
_WOV data are not set. I think that it may cause regressions for some BIOS 
versions.

Also, the return code should be probably -ENODEV.

					Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: amd: yc: Fix for enabling DMIC on acp6x via _DSD entry
  2024-11-27 12:36 ` Jaroslav Kysela
@ 2024-11-27 17:04   ` potturu venkata prasad
  2024-11-27 17:33     ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: potturu venkata prasad @ 2024-11-27 17:04 UTC (permalink / raw)
  To: Jaroslav Kysela, broonie, alsa-devel
  Cc: Vijendar.Mukunda, Basavaraj.Hiregoudar, Sunil-kumar.Dommati,
	syed.sabakareem, mario.limonciello, Liam Girdwood, Takashi Iwai,
	Tim Crawford, Attila Tőkés, Techno Mooney,
	Jeremy Soller, Malcolm Hart,
	open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	open list


On 11/27/24 18:06, Jaroslav Kysela wrote:
> On 27. 11. 24 12:22, Venkata Prasad Potturu wrote:
>> Add condition check to register ACP PDM sound card by reading
>> _WOV acpi entry.
>>
>> Fixes: 5426f506b584 ("ASoC: amd: Add support for enabling DMIC on 
>> acp6x via _DSD")
>>
>> Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
>> ---
>>   sound/soc/amd/yc/acp6x-mach.c | 18 +++++++++++++++++-
>>   1 file changed, 17 insertions(+), 1 deletion(-)
>>
>> diff --git a/sound/soc/amd/yc/acp6x-mach.c 
>> b/sound/soc/amd/yc/acp6x-mach.c
>> index 438865d5e376..c301dac8b979 100644
>> --- a/sound/soc/amd/yc/acp6x-mach.c
>> +++ b/sound/soc/amd/yc/acp6x-mach.c
>> @@ -523,8 +523,14 @@ static int acp6x_probe(struct platform_device 
>> *pdev)
>>       struct acp6x_pdm *machine = NULL;
>>       struct snd_soc_card *card;
>>       struct acpi_device *adev;
>> +    acpi_handle handle;
>> +    acpi_integer dmic_status;
>>       int ret;
>> +    bool is_dmic_enable, wov_en;
>>   +    /* IF WOV entry not found, enable dmic based on 
>> AcpDmicConnected entry*/
>> +    is_dmic_enable = false;
>> +    wov_en = true;
>>       /* check the parent device's firmware node has _DSD or not */
>>       adev = ACPI_COMPANION(pdev->dev.parent);
>>       if (adev) {
>> @@ -532,9 +538,19 @@ static int acp6x_probe(struct platform_device 
>> *pdev)
>>             if (!acpi_dev_get_property(adev, "AcpDmicConnected", 
>> ACPI_TYPE_INTEGER, &obj) &&
>>               obj->integer.value == 1)
>> -            platform_set_drvdata(pdev, &acp6x_card);
>> +            is_dmic_enable = true;
>>       }
>>   +    handle = ACPI_HANDLE(pdev->dev.parent);
>> +    ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
>> +    if (!ACPI_FAILURE(ret))
>> +        wov_en = dmic_status;
>> +
>> +    if (is_dmic_enable && wov_en)
>> +        platform_set_drvdata(pdev, &acp6x_card);
>> +    else
>> +        return 0;
>
> The logic seems wrong. The overrides code bellow won't be executed 
> when ACPI _WOV data are not set. I think that it may cause regressions 
> for some BIOS versions.
>
> Also, the return code should be probably -ENODEV.
>
>                     Jaroslav
Okay Jaroslav,

We will correct it and resend v2 patch.
Thanks.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: amd: yc: Fix for enabling DMIC on acp6x via _DSD entry
  2024-11-27 17:04   ` potturu venkata prasad
@ 2024-11-27 17:33     ` Mark Brown
  2024-11-27 17:37       ` potturu venkata prasad
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2024-11-27 17:33 UTC (permalink / raw)
  To: potturu venkata prasad
  Cc: Jaroslav Kysela, alsa-devel, Vijendar.Mukunda,
	Basavaraj.Hiregoudar, Sunil-kumar.Dommati, syed.sabakareem,
	mario.limonciello, Liam Girdwood, Takashi Iwai, Tim Crawford,
	Attila Tőkés, Techno Mooney, Jeremy Soller,
	Malcolm Hart,
	open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	open list

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

On Wed, Nov 27, 2024 at 10:34:32PM +0530, potturu venkata prasad wrote:
> On 11/27/24 18:06, Jaroslav Kysela wrote:

> > The logic seems wrong. The overrides code bellow won't be executed when
> > ACPI _WOV data are not set. I think that it may cause regressions for
> > some BIOS versions.

> > Also, the return code should be probably -ENODEV.

> Okay Jaroslav,

> We will correct it and resend v2 patch.

Given that I applied this before Jaroslav's review please send an
incremental patch that fixes the issue.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: amd: yc: Fix for enabling DMIC on acp6x via _DSD entry
  2024-11-27 17:33     ` Mark Brown
@ 2024-11-27 17:37       ` potturu venkata prasad
  0 siblings, 0 replies; 6+ messages in thread
From: potturu venkata prasad @ 2024-11-27 17:37 UTC (permalink / raw)
  To: Mark Brown
  Cc: Jaroslav Kysela, alsa-devel, Vijendar.Mukunda,
	Basavaraj.Hiregoudar, Sunil-kumar.Dommati, syed.sabakareem,
	mario.limonciello, Liam Girdwood, Takashi Iwai, Tim Crawford,
	Attila Tőkés, Techno Mooney, Jeremy Soller,
	Malcolm Hart,
	open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	open list


On 11/27/24 23:03, Mark Brown wrote:
> On Wed, Nov 27, 2024 at 10:34:32PM +0530, potturu venkata prasad wrote:
>> On 11/27/24 18:06, Jaroslav Kysela wrote:
>>> The logic seems wrong. The overrides code bellow won't be executed when
>>> ACPI _WOV data are not set. I think that it may cause regressions for
>>> some BIOS versions.
>>> Also, the return code should be probably -ENODEV.
>> Okay Jaroslav,
>> We will correct it and resend v2 patch.
> Given that I applied this before Jaroslav's review please send an
> incremental patch that fixes the issue.
Sorry, I missed it, will send incremental patch.

Thanks.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-11-27 17:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-27 11:22 [PATCH] ASoC: amd: yc: Fix for enabling DMIC on acp6x via _DSD entry Venkata Prasad Potturu
2024-11-27 12:13 ` Mark Brown
2024-11-27 12:36 ` Jaroslav Kysela
2024-11-27 17:04   ` potturu venkata prasad
2024-11-27 17:33     ` Mark Brown
2024-11-27 17:37       ` potturu venkata prasad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox