Commit 0a3dcb50 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

ASoC: Use params_width() at appropriate places

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent bc0195aa
...@@ -432,7 +432,7 @@ static int max98925_dai_hw_params(struct snd_pcm_substream *substream, ...@@ -432,7 +432,7 @@ static int max98925_dai_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_codec *codec = dai->codec; struct snd_soc_codec *codec = dai->codec;
struct max98925_priv *max98925 = snd_soc_codec_get_drvdata(codec); struct max98925_priv *max98925 = snd_soc_codec_get_drvdata(codec);
switch (snd_pcm_format_width(params_format(params))) { switch (params_width(params)) {
case 16: case 16:
regmap_update_bits(max98925->regmap, regmap_update_bits(max98925->regmap,
MAX98925_FORMAT, MAX98925_FORMAT,
......
...@@ -1117,7 +1117,7 @@ static int pcm512x_hw_params(struct snd_pcm_substream *substream, ...@@ -1117,7 +1117,7 @@ static int pcm512x_hw_params(struct snd_pcm_substream *substream,
params_rate(params), params_rate(params),
params_channels(params)); params_channels(params));
switch (snd_pcm_format_width(params_format(params))) { switch (params_width(params)) {
case 16: case 16:
alen = PCM512x_ALEN_16; alen = PCM512x_ALEN_16;
break; break;
...@@ -1132,7 +1132,7 @@ static int pcm512x_hw_params(struct snd_pcm_substream *substream, ...@@ -1132,7 +1132,7 @@ static int pcm512x_hw_params(struct snd_pcm_substream *substream,
break; break;
default: default:
dev_err(codec->dev, "Bad frame size: %d\n", dev_err(codec->dev, "Bad frame size: %d\n",
snd_pcm_format_width(params_format(params))); params_width(params));
return -EINVAL; return -EINVAL;
} }
......
...@@ -1702,7 +1702,7 @@ static int wm2200_hw_params(struct snd_pcm_substream *substream, ...@@ -1702,7 +1702,7 @@ static int wm2200_hw_params(struct snd_pcm_substream *substream,
int *bclk_rates; int *bclk_rates;
/* Data sizes if not using TDM */ /* Data sizes if not using TDM */
wl = snd_pcm_format_width(params_format(params)); wl = params_width(params);
if (wl < 0) if (wl < 0)
return wl; return wl;
fl = snd_soc_params_to_frame_size(params); fl = snd_soc_params_to_frame_size(params);
......
...@@ -1408,7 +1408,7 @@ static int wm5100_hw_params(struct snd_pcm_substream *substream, ...@@ -1408,7 +1408,7 @@ static int wm5100_hw_params(struct snd_pcm_substream *substream,
base = dai->driver->base; base = dai->driver->base;
/* Data sizes if not using TDM */ /* Data sizes if not using TDM */
wl = snd_pcm_format_width(params_format(params)); wl = params_width(params);
if (wl < 0) if (wl < 0)
return wl; return wl;
fl = snd_soc_params_to_frame_size(params); fl = snd_soc_params_to_frame_size(params);
......
...@@ -265,7 +265,7 @@ static int wm8776_hw_params(struct snd_pcm_substream *substream, ...@@ -265,7 +265,7 @@ static int wm8776_hw_params(struct snd_pcm_substream *substream,
} }
/* Set word length */ /* Set word length */
switch (snd_pcm_format_width(params_format(params))) { switch (params_width(params)) {
case 16: case 16:
iface = 0; iface = 0;
break; break;
...@@ -280,7 +280,7 @@ static int wm8776_hw_params(struct snd_pcm_substream *substream, ...@@ -280,7 +280,7 @@ static int wm8776_hw_params(struct snd_pcm_substream *substream,
break; break;
default: default:
dev_err(codec->dev, "Unsupported sample size: %i\n", dev_err(codec->dev, "Unsupported sample size: %i\n",
snd_pcm_format_width(params_format(params))); params_width(params));
return -EINVAL; return -EINVAL;
} }
......
...@@ -1780,7 +1780,7 @@ static int wm8996_hw_params(struct snd_pcm_substream *substream, ...@@ -1780,7 +1780,7 @@ static int wm8996_hw_params(struct snd_pcm_substream *substream,
wm8996->rx_rate[dai->id] = params_rate(params); wm8996->rx_rate[dai->id] = params_rate(params);
/* Needs looking at for TDM */ /* Needs looking at for TDM */
bits = snd_pcm_format_width(params_format(params)); bits = params_width(params);
if (bits < 0) if (bits < 0)
return bits; return bits;
aifdata |= (bits << WM8996_AIF1TX_WL_SHIFT) | bits; aifdata |= (bits << WM8996_AIF1TX_WL_SHIFT) | bits;
......
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