From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH 1/3] ALSA: Fix handling of multiple msbits constraints on the same runtime Date: Tue, 30 Dec 2014 16:48:22 +0100 Message-ID: References: <1419875018-30812-1-git-send-email-lars@metafoo.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id B9001260698 for ; Tue, 30 Dec 2014 16:48:22 +0100 (CET) In-Reply-To: <1419875018-30812-1-git-send-email-lars@metafoo.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Lars-Peter Clausen Cc: alsa-devel@alsa-project.org, Mark Brown , Liam Girdwood List-Id: alsa-devel@alsa-project.org At Mon, 29 Dec 2014 18:43:36 +0100, Lars-Peter Clausen wrote: > > If the sound card is made up of discrete components, each with their own > driver (e.g. like in the ASoC case), we might end up with multiple msbits > constraint rules installed. Currently this will result in msbits being set > to whatever the last rule set it to. > > This patch updates the behavior of the rule to choose the minimum (other > than zero) of all the installed rules. > > Signed-off-by: Lars-Peter Clausen Thanks, applied all three patches now. They were applied to topic/msbits branch so that Mark can merge these more easily. Takashi > --- > sound/core/pcm_lib.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c > index ec9e786..b0c1535 100644 > --- a/sound/core/pcm_lib.c > +++ b/sound/core/pcm_lib.c > @@ -1300,7 +1300,7 @@ static int snd_pcm_hw_rule_msbits(struct snd_pcm_hw_params *params, > unsigned int msbits = l >> 16; > struct snd_interval *i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS); > if (snd_interval_single(i) && snd_interval_value(i) == width) > - params->msbits = msbits; > + params->msbits = min_not_zero(params->msbits, msbits); > return 0; > } > > -- > 1.8.0 >