linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: amd: acp: Refactor bit width calculation
@ 2023-01-30 10:01 Venkata Prasad Potturu
  2023-01-30 13:28 ` Péter Ujfalusi
  2023-01-30 21:00 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Venkata Prasad Potturu @ 2023-01-30 10:01 UTC (permalink / raw)
  To: broonie, alsa-devel
  Cc: vsujithkumar.reddy, Vijendar.Mukunda, Basavaraj.Hiregoudar,
	Sunil-kumar.Dommati, ssabakar, Venkata Prasad Potturu,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	V sujith kumar Reddy, Akihiko Odaki, Ajit Kumar Pandey,
	Jia-Ju Bai, ye xingchen, open list

Refactor bit width calculation using params_physical_width()
instead hard-code values.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
---
 sound/soc/amd/acp/acp-mach-common.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c
index b83ae946b3e4..b4dcce4fbae9 100644
--- a/sound/soc/amd/acp/acp-mach-common.c
+++ b/sound/soc/amd/acp/acp-mach-common.c
@@ -186,7 +186,7 @@ static int acp_card_rt5682_hw_params(struct snd_pcm_substream *substream,
 
 	srate = params_rate(params);
 	ch = params_channels(params);
-	format = 8 * params_format(params);
+	format = params_physical_width(params);
 
 	if (drvdata->tdm_mode)
 		fmt = SND_SOC_DAIFMT_DSP_A;
@@ -330,7 +330,7 @@ static int acp_card_rt5682s_hw_params(struct snd_pcm_substream *substream,
 
 	srate = params_rate(params);
 	ch = params_channels(params);
-	format = 8 * params_format(params);
+	format = params_physical_width(params);
 
 	if (drvdata->tdm_mode)
 		fmt = SND_SOC_DAIFMT_DSP_A;
@@ -475,7 +475,7 @@ static int acp_card_rt1019_hw_params(struct snd_pcm_substream *substream,
 
 	srate = params_rate(params);
 	ch = params_channels(params);
-	format = 8 * params_format(params);
+	format = params_physical_width(params);
 
 	if (drvdata->amp_codec_id != RT1019)
 		return -EINVAL;
@@ -616,7 +616,7 @@ static int acp_card_maxim_hw_params(struct snd_pcm_substream *substream,
 
 	srate = params_rate(params);
 	ch = params_channels(params);
-	format = 8 * params_format(params);
+	format = params_physical_width(params);
 
 	if (drvdata->tdm_mode)
 		fmt = SND_SOC_DAIFMT_DSP_A;
-- 
2.25.1


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

* Re: [PATCH] ASoC: amd: acp: Refactor bit width calculation
  2023-01-30 10:01 [PATCH] ASoC: amd: acp: Refactor bit width calculation Venkata Prasad Potturu
@ 2023-01-30 13:28 ` Péter Ujfalusi
  2023-01-30 21:00 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Péter Ujfalusi @ 2023-01-30 13:28 UTC (permalink / raw)
  To: Venkata Prasad Potturu, broonie, alsa-devel
  Cc: Sunil-kumar.Dommati, ssabakar, Ajit Kumar Pandey, ye xingchen,
	Basavaraj.Hiregoudar, Takashi Iwai, Liam Girdwood, Jia-Ju Bai,
	Akihiko Odaki, Vijendar.Mukunda, V sujith kumar Reddy, open list



On 30/01/2023 12:01, Venkata Prasad Potturu wrote:
> Refactor bit width calculation using params_physical_width()
> instead hard-code values.

I would have added a Reported-by tag for Pierre...
A Fixes tag might also help this patch to follow
ca9d237994db ("ASoC: amd: acp: Refactor i2s clocks programming sequence")

Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>

> Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
> ---
>  sound/soc/amd/acp/acp-mach-common.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c
> index b83ae946b3e4..b4dcce4fbae9 100644
> --- a/sound/soc/amd/acp/acp-mach-common.c
> +++ b/sound/soc/amd/acp/acp-mach-common.c
> @@ -186,7 +186,7 @@ static int acp_card_rt5682_hw_params(struct snd_pcm_substream *substream,
>  
>  	srate = params_rate(params);
>  	ch = params_channels(params);
> -	format = 8 * params_format(params);
> +	format = params_physical_width(params);
>  
>  	if (drvdata->tdm_mode)
>  		fmt = SND_SOC_DAIFMT_DSP_A;
> @@ -330,7 +330,7 @@ static int acp_card_rt5682s_hw_params(struct snd_pcm_substream *substream,
>  
>  	srate = params_rate(params);
>  	ch = params_channels(params);
> -	format = 8 * params_format(params);
> +	format = params_physical_width(params);
>  
>  	if (drvdata->tdm_mode)
>  		fmt = SND_SOC_DAIFMT_DSP_A;
> @@ -475,7 +475,7 @@ static int acp_card_rt1019_hw_params(struct snd_pcm_substream *substream,
>  
>  	srate = params_rate(params);
>  	ch = params_channels(params);
> -	format = 8 * params_format(params);
> +	format = params_physical_width(params);
>  
>  	if (drvdata->amp_codec_id != RT1019)
>  		return -EINVAL;
> @@ -616,7 +616,7 @@ static int acp_card_maxim_hw_params(struct snd_pcm_substream *substream,
>  
>  	srate = params_rate(params);
>  	ch = params_channels(params);
> -	format = 8 * params_format(params);
> +	format = params_physical_width(params);
>  
>  	if (drvdata->tdm_mode)
>  		fmt = SND_SOC_DAIFMT_DSP_A;

-- 
Péter

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

* Re: [PATCH] ASoC: amd: acp: Refactor bit width calculation
  2023-01-30 10:01 [PATCH] ASoC: amd: acp: Refactor bit width calculation Venkata Prasad Potturu
  2023-01-30 13:28 ` Péter Ujfalusi
@ 2023-01-30 21:00 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2023-01-30 21:00 UTC (permalink / raw)
  To: alsa-devel, Venkata Prasad Potturu
  Cc: vsujithkumar.reddy, Vijendar.Mukunda, Basavaraj.Hiregoudar,
	Sunil-kumar.Dommati, ssabakar, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, V sujith kumar Reddy, Akihiko Odaki,
	Ajit Kumar Pandey, Jia-Ju Bai, ye xingchen, open list

On Mon, 30 Jan 2023 15:31:00 +0530, Venkata Prasad Potturu wrote:
> Refactor bit width calculation using params_physical_width()
> instead hard-code values.
> 
> 

Applied to

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

Thanks!

[1/1] ASoC: amd: acp: Refactor bit width calculation
      commit: 55e681c950d89bcc9dc13bc15f5b64393ef58897

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] 3+ messages in thread

end of thread, other threads:[~2023-01-30 21:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-30 10:01 [PATCH] ASoC: amd: acp: Refactor bit width calculation Venkata Prasad Potturu
2023-01-30 13:28 ` Péter Ujfalusi
2023-01-30 21:00 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).