summaryrefslogtreecommitdiff
path: root/sound/soc/amd/acp
diff options
context:
space:
mode:
authorVenkata Prasad Potturu <venkataprasad.potturu@amd.com>2023-01-30 15:31:00 +0530
committerMark Brown <broonie@kernel.org>2023-01-30 13:35:00 +0000
commit55e681c950d89bcc9dc13bc15f5b64393ef58897 (patch)
tree95b3ea86ef688f880560785e4af19458e6759112 /sound/soc/amd/acp
parentffe4c0f0bfaa571a676a0e946d4a6a0607f94294 (diff)
ASoC: amd: acp: Refactor bit width calculation
Refactor bit width calculation using params_physical_width() instead hard-code values. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20230130100104.4076640-1-venkataprasad.potturu@amd.com Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd/acp')
-rw-r--r--sound/soc/amd/acp/acp-mach-common.c8
1 files 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;