Commit 55e681c9 authored by Venkata Prasad Potturu's avatar Venkata Prasad Potturu Committed by Mark Brown

ASoC: amd: acp: Refactor bit width calculation

Refactor bit width calculation using params_physical_width()
instead hard-code values.
Signed-off-by: default avatarVenkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230130100104.4076640-1-venkataprasad.potturu@amd.comReviewed-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ffe4c0f0
...@@ -186,7 +186,7 @@ static int acp_card_rt5682_hw_params(struct snd_pcm_substream *substream, ...@@ -186,7 +186,7 @@ static int acp_card_rt5682_hw_params(struct snd_pcm_substream *substream,
srate = params_rate(params); srate = params_rate(params);
ch = params_channels(params); ch = params_channels(params);
format = 8 * params_format(params); format = params_physical_width(params);
if (drvdata->tdm_mode) if (drvdata->tdm_mode)
fmt = SND_SOC_DAIFMT_DSP_A; fmt = SND_SOC_DAIFMT_DSP_A;
...@@ -330,7 +330,7 @@ static int acp_card_rt5682s_hw_params(struct snd_pcm_substream *substream, ...@@ -330,7 +330,7 @@ static int acp_card_rt5682s_hw_params(struct snd_pcm_substream *substream,
srate = params_rate(params); srate = params_rate(params);
ch = params_channels(params); ch = params_channels(params);
format = 8 * params_format(params); format = params_physical_width(params);
if (drvdata->tdm_mode) if (drvdata->tdm_mode)
fmt = SND_SOC_DAIFMT_DSP_A; fmt = SND_SOC_DAIFMT_DSP_A;
...@@ -475,7 +475,7 @@ static int acp_card_rt1019_hw_params(struct snd_pcm_substream *substream, ...@@ -475,7 +475,7 @@ static int acp_card_rt1019_hw_params(struct snd_pcm_substream *substream,
srate = params_rate(params); srate = params_rate(params);
ch = params_channels(params); ch = params_channels(params);
format = 8 * params_format(params); format = params_physical_width(params);
if (drvdata->amp_codec_id != RT1019) if (drvdata->amp_codec_id != RT1019)
return -EINVAL; return -EINVAL;
...@@ -616,7 +616,7 @@ static int acp_card_maxim_hw_params(struct snd_pcm_substream *substream, ...@@ -616,7 +616,7 @@ static int acp_card_maxim_hw_params(struct snd_pcm_substream *substream,
srate = params_rate(params); srate = params_rate(params);
ch = params_channels(params); ch = params_channels(params);
format = 8 * params_format(params); format = params_physical_width(params);
if (drvdata->tdm_mode) if (drvdata->tdm_mode)
fmt = SND_SOC_DAIFMT_DSP_A; fmt = SND_SOC_DAIFMT_DSP_A;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment