Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolin Chen <nicoleotsuka@gmail.com>
To: Zidan Wang <zidan.wang@freescale.com>
Cc: alsa-devel@alsa-project.org, broonie@kernel.org, timur@tabi.org,
	Xiubo.Lee@gmail.com
Subject: Re: [PATCH 2/2] ASoC: fsl: using params_width function to simplify code
Date: Tue, 24 Nov 2015 00:52:29 -0800	[thread overview]
Message-ID: <20151124085229.GC14109@Asurada-CZ80> (raw)
In-Reply-To: <61c4bd3dd82c40b59d1d2570a400321027ae6abc.1448350220.git.zidan.wang@freescale.com>

On Tue, Nov 24, 2015 at 03:32:09PM +0800, Zidan Wang wrote:
> using params_width function to simplify code.
> 
> Signed-off-by: Zidan Wang <zidan.wang@freescale.com>

Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>

> ---
>  sound/soc/fsl/fsl_asrc.c | 2 +-
>  sound/soc/fsl/fsl_esai.c | 2 +-
>  sound/soc/fsl/fsl_sai.c  | 2 +-
>  sound/soc/fsl/fsl_ssi.c  | 3 +--
>  4 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
> index 9f087d4..6d06366 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,
>  				  struct snd_soc_dai *dai)
>  {
>  	struct fsl_asrc *asrc_priv = snd_soc_dai_get_drvdata(dai);
> -	int width = snd_pcm_format_width(params_format(params));
> +	int width = params_width(params);
>  	struct snd_pcm_runtime *runtime = substream->runtime;
>  	struct fsl_asrc_pair *pair = runtime->private_data;
>  	unsigned int channels = params_channels(params);
> diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
> index 504e731..45d4319 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,
>  {
>  	struct fsl_esai *esai_priv = snd_soc_dai_get_drvdata(dai);
>  	bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
> -	u32 width = snd_pcm_format_width(params_format(params));
> +	u32 width = params_width(params);
>  	u32 channels = params_channels(params);
>  	u32 pins = DIV_ROUND_UP(channels, esai_priv->slots);
>  	u32 slot_width = width;
> diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
> index c01322c..8832901 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,
>  	struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
>  	bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
>  	unsigned int channels = params_channels(params);
> -	u32 word_width = snd_pcm_format_width(params_format(params));
> +	u32 word_width = params_width(params);
>  	u32 val_cr4 = 0, val_cr5 = 0;
>  	u32 slots = (channels == 1) ? 2 : channels;
>  	u32 slot_width = word_width;
> diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
> index 674abf7..e3abad5 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,
>  	struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(cpu_dai);
>  	struct regmap *regs = ssi_private->regs;
>  	unsigned int channels = params_channels(hw_params);
> -	unsigned int sample_size =
> -		snd_pcm_format_width(params_format(hw_params));
> +	unsigned int sample_size = params_width(hw_params);
>  	u32 wl = CCSR_SSI_SxCCR_WL(sample_size);
>  	int ret;
>  	u32 scr_val;
> -- 
> 1.9.1
> 

  reply	other threads:[~2015-11-24  8:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24  7:31 [PATCH 1/2] ASoC: fsl_sai: add tdm slots operation support Zidan Wang
2015-11-24  7:32 ` [PATCH 2/2] ASoC: fsl: using params_width function to simplify code Zidan Wang
2015-11-24  8:52   ` Nicolin Chen [this message]
2015-11-25 13:00   ` Applied "ASoC: fsl: using params_width function to simplify code" to the asoc tree Mark Brown
2015-11-29 14:35   ` [PATCH 2/2] ASoC: fsl: using params_width function to simplify code Timur Tabi
2015-11-24  8:50 ` [PATCH 1/2] ASoC: fsl_sai: add tdm slots operation support Nicolin Chen
2015-11-25 12:11 ` Applied "ASoC: fsl_sai: add tdm slots operation support" to the asoc tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151124085229.GC14109@Asurada-CZ80 \
    --to=nicoleotsuka@gmail.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=timur@tabi.org \
    --cc=zidan.wang@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox