aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl
diff options
context:
space:
mode:
authorZidan Wang <zidan.wang@freescale.com>2015-11-24 02:32:09 -0500
committerMark Brown <broonie@kernel.org>2015-11-25 07:12:57 -0500
commit4ca730436a676afebbe6b77d65b5b4c4d7d38b9c (patch)
tree8862f24e6c00d293501f79a4308e666bbc8ae5dd /sound/soc/fsl
parent3d8d0bd07816b2dbb06014a98ab3d6599ae3566a (diff)
ASoC: fsl: using params_width function to simplify code
using params_width function to simplify code. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r--sound/soc/fsl/fsl_asrc.c2
-rw-r--r--sound/soc/fsl/fsl_esai.c2
-rw-r--r--sound/soc/fsl/fsl_sai.c2
-rw-r--r--sound/soc/fsl/fsl_ssi.c3
4 files changed, 4 insertions, 5 deletions
diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index 9f087d4f73ed..6d0636605ed2 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -447,7 +447,7 @@ static int fsl_asrc_dai_hw_params(struct snd_pcm_substream *substream,
447 struct snd_soc_dai *dai) 447 struct snd_soc_dai *dai)
448{ 448{
449 struct fsl_asrc *asrc_priv = snd_soc_dai_get_drvdata(dai); 449 struct fsl_asrc *asrc_priv = snd_soc_dai_get_drvdata(dai);
450 int width = snd_pcm_format_width(params_format(params)); 450 int width = params_width(params);
451 struct snd_pcm_runtime *runtime = substream->runtime; 451 struct snd_pcm_runtime *runtime = substream->runtime;
452 struct fsl_asrc_pair *pair = runtime->private_data; 452 struct fsl_asrc_pair *pair = runtime->private_data;
453 unsigned int channels = params_channels(params); 453 unsigned int channels = params_channels(params);
diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index 504e7318f225..45d4319b2079 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -510,7 +510,7 @@ static int fsl_esai_hw_params(struct snd_pcm_substream *substream,
510{ 510{
511 struct fsl_esai *esai_priv = snd_soc_dai_get_drvdata(dai); 511 struct fsl_esai *esai_priv = snd_soc_dai_get_drvdata(dai);
512 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; 512 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
513 u32 width = snd_pcm_format_width(params_format(params)); 513 u32 width = params_width(params);
514 u32 channels = params_channels(params); 514 u32 channels = params_channels(params);
515 u32 pins = DIV_ROUND_UP(channels, esai_priv->slots); 515 u32 pins = DIV_ROUND_UP(channels, esai_priv->slots);
516 u32 slot_width = width; 516 u32 slot_width = width;
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index dc0cc65406f5..3da278313591 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -404,7 +404,7 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream,
404 struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); 404 struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
405 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; 405 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
406 unsigned int channels = params_channels(params); 406 unsigned int channels = params_channels(params);
407 u32 word_width = snd_pcm_format_width(params_format(params)); 407 u32 word_width = params_width(params);
408 u32 val_cr4 = 0, val_cr5 = 0; 408 u32 val_cr4 = 0, val_cr5 = 0;
409 u32 slots = (channels == 1) ? 2 : channels; 409 u32 slots = (channels == 1) ? 2 : channels;
410 u32 slot_width = word_width; 410 u32 slot_width = word_width;
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 674abf778715..e3abad5f980a 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -767,8 +767,7 @@ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream,
767 struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(cpu_dai); 767 struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(cpu_dai);
768 struct regmap *regs = ssi_private->regs; 768 struct regmap *regs = ssi_private->regs;
769 unsigned int channels = params_channels(hw_params); 769 unsigned int channels = params_channels(hw_params);
770 unsigned int sample_size = 770 unsigned int sample_size = params_width(hw_params);
771 snd_pcm_format_width(params_format(hw_params));
772 u32 wl = CCSR_SSI_SxCCR_WL(sample_size); 771 u32 wl = CCSR_SSI_SxCCR_WL(sample_size);
773 int ret; 772 int ret;
774 u32 scr_val; 773 u32 scr_val;