All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: tegra: Fix DSPK 16-bit playback
@ 2024-03-25 10:49 Sameer Pujar
  2024-03-25 13:41 ` Thierry Reding
  0 siblings, 1 reply; 3+ messages in thread
From: Sameer Pujar @ 2024-03-25 10:49 UTC (permalink / raw
  To: broonie, linux-sound
  Cc: linux-tegra, linux-kernel, lgirdwood, thierry.reding, jonathanh,
	mkumard, Sameer Pujar, stable

DSPK configuration is wrong for 16-bit playback and this happens because
the client config is always fixed at 24-bit in hw_params(). Fix this by
updating the client config to 16-bit for the respective playback.

Fixes: 327ef6470266 ("ASoC: tegra: Add Tegra186 based DSPK driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
---
 sound/soc/tegra/tegra186_dspk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/tegra/tegra186_dspk.c b/sound/soc/tegra/tegra186_dspk.c
index aa37c4ab0adb..3a152e76122b 100644
--- a/sound/soc/tegra/tegra186_dspk.c
+++ b/sound/soc/tegra/tegra186_dspk.c
@@ -1,8 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 //
 // tegra186_dspk.c - Tegra186 DSPK driver
-//
-// Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved.
 
 #include <linux/clk.h>
 #include <linux/device.h>
@@ -246,6 +245,7 @@ static int tegra186_dspk_hw_params(struct snd_pcm_substream *substream,
 	switch (params_format(params)) {
 	case SNDRV_PCM_FORMAT_S16_LE:
 		cif_conf.audio_bits = TEGRA_ACIF_BITS_16;
+		cif_conf.client_bits = TEGRA_ACIF_BITS_16;
 		break;
 	case SNDRV_PCM_FORMAT_S32_LE:
 		cif_conf.audio_bits = TEGRA_ACIF_BITS_32;
-- 
2.25.1


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

* Re: [PATCH] ASoC: tegra: Fix DSPK 16-bit playback
  2024-03-25 10:49 [PATCH] ASoC: tegra: Fix DSPK 16-bit playback Sameer Pujar
@ 2024-03-25 13:41 ` Thierry Reding
  2024-03-26  5:21   ` Sameer Pujar
  0 siblings, 1 reply; 3+ messages in thread
From: Thierry Reding @ 2024-03-25 13:41 UTC (permalink / raw
  To: Sameer Pujar, broonie, linux-sound
  Cc: linux-tegra, linux-kernel, lgirdwood, jonathanh, mkumard, stable

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

On Mon Mar 25, 2024 at 11:49 AM CET, Sameer Pujar wrote:
> DSPK configuration is wrong for 16-bit playback and this happens because
> the client config is always fixed at 24-bit in hw_params(). Fix this by
> updating the client config to 16-bit for the respective playback.
>
> Fixes: 327ef6470266 ("ASoC: tegra: Add Tegra186 based DSPK driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
> ---
>  sound/soc/tegra/tegra186_dspk.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/tegra/tegra186_dspk.c b/sound/soc/tegra/tegra186_dspk.c
> index aa37c4ab0adb..3a152e76122b 100644
> --- a/sound/soc/tegra/tegra186_dspk.c
> +++ b/sound/soc/tegra/tegra186_dspk.c
> @@ -1,8 +1,7 @@
>  // SPDX-License-Identifier: GPL-2.0-only
> +// SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
>  //
>  // tegra186_dspk.c - Tegra186 DSPK driver
> -//
> -// Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved.
>  
>  #include <linux/clk.h>
>  #include <linux/device.h>
> @@ -246,6 +245,7 @@ static int tegra186_dspk_hw_params(struct snd_pcm_substream *substream,
>  	switch (params_format(params)) {
>  	case SNDRV_PCM_FORMAT_S16_LE:
>  		cif_conf.audio_bits = TEGRA_ACIF_BITS_16;
> +		cif_conf.client_bits = TEGRA_ACIF_BITS_16;

Do we perhaps want to move the common cif_conf.client_bits assignment
into the S32_LE case now? It doesn't make much sense to have a common
assignment that's overridden for the S16_LE case and only kept for the
only other alternative (S32_LE).

Thierry

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

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

* Re: [PATCH] ASoC: tegra: Fix DSPK 16-bit playback
  2024-03-25 13:41 ` Thierry Reding
@ 2024-03-26  5:21   ` Sameer Pujar
  0 siblings, 0 replies; 3+ messages in thread
From: Sameer Pujar @ 2024-03-26  5:21 UTC (permalink / raw
  To: Thierry Reding, broonie, linux-sound
  Cc: linux-tegra, linux-kernel, lgirdwood, jonathanh, mkumard, stable



On 25-03-2024 19:11, Thierry Reding wrote:
> On Mon Mar 25, 2024 at 11:49 AM CET, Sameer Pujar wrote:
>> DSPK configuration is wrong for 16-bit playback and this happens because
>> the client config is always fixed at 24-bit in hw_params(). Fix this by
>> updating the client config to 16-bit for the respective playback.
>>
>> Fixes: 327ef6470266 ("ASoC: tegra: Add Tegra186 based DSPK driver")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
>> ---
>>   sound/soc/tegra/tegra186_dspk.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/sound/soc/tegra/tegra186_dspk.c b/sound/soc/tegra/tegra186_dspk.c
>> index aa37c4ab0adb..3a152e76122b 100644
>> --- a/sound/soc/tegra/tegra186_dspk.c
>> +++ b/sound/soc/tegra/tegra186_dspk.c
>> @@ -1,8 +1,7 @@
>>   // SPDX-License-Identifier: GPL-2.0-only
>> +// SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
>>   //
>>   // tegra186_dspk.c - Tegra186 DSPK driver
>> -//
>> -// Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved.
>>   
>>   #include <linux/clk.h>
>>   #include <linux/device.h>
>> @@ -246,6 +245,7 @@ static int tegra186_dspk_hw_params(struct snd_pcm_substream *substream,
>>   	switch (params_format(params)) {
>>   	case SNDRV_PCM_FORMAT_S16_LE:
>>   		cif_conf.audio_bits = TEGRA_ACIF_BITS_16;
>> +		cif_conf.client_bits = TEGRA_ACIF_BITS_16;
> Do we perhaps want to move the common cif_conf.client_bits assignment
> into the S32_LE case now? It doesn't make much sense to have a common
> assignment that's overridden for the S16_LE case and only kept for the
> only other alternative (S32_LE).

Yes, it makes sense to do so. Will send v2. Thanks.

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

end of thread, other threads:[~2024-03-26  5:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-25 10:49 [PATCH] ASoC: tegra: Fix DSPK 16-bit playback Sameer Pujar
2024-03-25 13:41 ` Thierry Reding
2024-03-26  5:21   ` Sameer Pujar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.