All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Lars-Peter Clausen <lars@metafoo.de>,
	Takashi Iwai <tiwai@suse.com>, Jaroslav Kysela <perex@perex.cz>,
	Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>
Cc: alsa-devel@alsa-project.org, Vinod Koul <vinod.koul@intel.com>,
	Mengdong Lin <mengdong.lin@intel.com>,
	Yang A Fang <yang.a.fang@intel.com>,
	Jarkko Nikula <jarkko.nikula@bitmer.com>
Subject: Re: [PATCH 08/18] ASoC: twl4030: Use snd_pcm_hw_constraint_single()
Date: Mon, 19 Oct 2015 15:05:14 +0300	[thread overview]
Message-ID: <5624DC7A.6070709@ti.com> (raw)
In-Reply-To: <1445175573-11784-9-git-send-email-lars@metafoo.de>

On 10/18/2015 04:39 PM, Lars-Peter Clausen wrote:
> Use the new snd_pcm_hw_constraint_single() helper function instead of
> calling snd_pcm_hw_constraint_minmax() with the same value for min and max
> to install a constraint that limits the possible configuration values to a
> single value. Using snd_pcm_hw_constraint_single() makes the indented
> result clearer and is slightly shorter.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> ---
>  sound/soc/codecs/twl4030.c | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
> index 2713e18..a5a4e9f 100644
> --- a/sound/soc/codecs/twl4030.c
> +++ b/sound/soc/codecs/twl4030.c
> @@ -1612,19 +1612,16 @@ static void twl4030_constraints(struct twl4030_priv *twl4030,
>  		return;
>  
>  	/* Set the constraints according to the already configured stream */
> -	snd_pcm_hw_constraint_minmax(slv_substream->runtime,
> +	snd_pcm_hw_constraint_single(slv_substream->runtime,
>  				SNDRV_PCM_HW_PARAM_RATE,
> -				twl4030->rate,
>  				twl4030->rate);
>  
> -	snd_pcm_hw_constraint_minmax(slv_substream->runtime,
> +	snd_pcm_hw_constraint_single(slv_substream->runtime,
>  				SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
> -				twl4030->sample_bits,
>  				twl4030->sample_bits);
>  
> -	snd_pcm_hw_constraint_minmax(slv_substream->runtime,
> +	snd_pcm_hw_constraint_single(slv_substream->runtime,
>  				SNDRV_PCM_HW_PARAM_CHANNELS,
> -				twl4030->channels,
>  				twl4030->channels);
>  }
>  
> @@ -1669,9 +1666,9 @@ static int twl4030_startup(struct snd_pcm_substream *substream,
>  			/* In option2 4 channel is not supported, set the
>  			 * constraint for the first stream for channels, the
>  			 * second stream will 'inherit' this cosntraint */
> -			snd_pcm_hw_constraint_minmax(substream->runtime,
> +			snd_pcm_hw_constraint_single(substream->runtime,
>  						     SNDRV_PCM_HW_PARAM_CHANNELS,
> -						     2, 2);
> +						     2);
>  		}
>  		twl4030->master_substream = substream;
>  	}
> 


-- 
Péter

  reply	other threads:[~2015-10-19 12:05 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-18 13:39 [PATCH 00/18] ALSA: Add helper function to add single value constraint Lars-Peter Clausen
2015-10-18 13:39 ` [PATCH 01/18] " Lars-Peter Clausen
2015-10-18 13:39 ` [PATCH 02/18] ALSA: korg1212: Use snd_pcm_hw_constraint_single() Lars-Peter Clausen
2015-10-18 13:39 ` [PATCH 03/18] ALSA: lx6464es: " Lars-Peter Clausen
2015-10-18 13:39 ` [PATCH 04/18] ALSA: rme32: " Lars-Peter Clausen
2015-10-18 13:39 ` [PATCH 05/18] ALSA: rme96: " Lars-Peter Clausen
2015-10-18 13:39 ` [PATCH 06/18] ALSA: rme9652: " Lars-Peter Clausen
2015-10-18 13:39 ` [PATCH 07/18] ASoC: adav80x: " Lars-Peter Clausen
2015-10-18 13:39 ` [PATCH 08/18] ASoC: twl4030: " Lars-Peter Clausen
2015-10-19 12:05   ` Peter Ujfalusi [this message]
2015-10-18 13:39 ` [PATCH 09/18] ASoC: uda134x: " Lars-Peter Clausen
2015-10-18 13:39 ` [PATCH 10/18] ASoC: wl1273: " Lars-Peter Clausen
2015-10-18 13:39 ` [PATCH 11/18] ASoC: n810: " Lars-Peter Clausen
2015-10-18 17:18   ` Jarkko Nikula
2015-10-18 13:39 ` [PATCH 12/18] ASoC: rx51: " Lars-Peter Clausen
2015-10-18 17:19   ` Jarkko Nikula
2015-10-18 13:39 ` [PATCH 13/18] ASoC: pcm: " Lars-Peter Clausen
2015-10-18 13:39 ` [PATCH 14/18] ASoC: ux500: " Lars-Peter Clausen
2015-10-18 13:39 ` [PATCH 15/18] ASoC: bytcr_rt5640: " Lars-Peter Clausen
2015-10-18 13:39 ` [PATCH 16/18] ASoC: cht_bsw_max98090: " Lars-Peter Clausen
2015-10-18 13:39 ` [PATCH 17/18] ASoC: cht_bsw_rt5645: " Lars-Peter Clausen
2015-10-18 13:39 ` [PATCH 18/18] ASoC: cht_bsw_rt5672: " Lars-Peter Clausen
2015-10-19  5:37 ` [PATCH 00/18] ALSA: Add helper function to add single value constraint Takashi Iwai
2015-10-20  9:00   ` Takashi Iwai
2015-10-21 12:16     ` 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=5624DC7A.6070709@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jarkko.nikula@bitmer.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=mengdong.lin@intel.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=vinod.koul@intel.com \
    --cc=yang.a.fang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.