From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB5F8C3A59D for ; Thu, 22 Aug 2019 10:12:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B28872053B for ; Thu, 22 Aug 2019 10:12:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387511AbfHVKM5 (ORCPT ); Thu, 22 Aug 2019 06:12:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:54322 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725856AbfHVKM5 (ORCPT ); Thu, 22 Aug 2019 06:12:57 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D9906B606; Thu, 22 Aug 2019 10:12:36 +0000 (UTC) Date: Thu, 22 Aug 2019 12:12:36 +0200 Message-ID: From: Takashi Iwai To: Srinivas Kandagatla Cc: broonie@kernel.org, spapothi@codeaurora.org, bgoswami@codeaurora.org, plai@codeaurora.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, Vidyakumar Athota Subject: Re: [PATCH v2 1/4] ALSA: pcm: add support for 352.8KHz and 384KHz sample rate In-Reply-To: <20190822095653.7200-2-srinivas.kandagatla@linaro.org> References: <20190822095653.7200-1-srinivas.kandagatla@linaro.org> <20190822095653.7200-2-srinivas.kandagatla@linaro.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 22 Aug 2019 11:56:50 +0200, Srinivas Kandagatla wrote: > > From: Vidyakumar Athota > > Most of the modern codecs supports 352.8KHz and 384KHz sample rates. > Currenlty HW params fails to set 352.8Kz and 384KHz sample rate > as these are not in known rates list. > Add these new rates to known list to allow them. > > This patch also adds defines in pcm.h so that drivers can use it. > > Signed-off-by: Vidyakumar Athota > Signed-off-by: Banajit Goswami > Signed-off-by: Srinivas Kandagatla About this API change: Reviewed-by: Takashi Iwai thanks, Takashi > --- > include/sound/pcm.h | 5 +++++ > sound/core/pcm_native.c | 2 +- > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/include/sound/pcm.h b/include/sound/pcm.h > index 1e9bb1c91770..bbe6eb1ff5d2 100644 > --- a/include/sound/pcm.h > +++ b/include/sound/pcm.h > @@ -117,6 +117,8 @@ struct snd_pcm_ops { > #define SNDRV_PCM_RATE_96000 (1<<10) /* 96000Hz */ > #define SNDRV_PCM_RATE_176400 (1<<11) /* 176400Hz */ > #define SNDRV_PCM_RATE_192000 (1<<12) /* 192000Hz */ > +#define SNDRV_PCM_RATE_352800 (1<<13) /* 352800Hz */ > +#define SNDRV_PCM_RATE_384000 (1<<14) /* 384000Hz */ > > #define SNDRV_PCM_RATE_CONTINUOUS (1<<30) /* continuous range */ > #define SNDRV_PCM_RATE_KNOT (1<<31) /* supports more non-continuos rates */ > @@ -129,6 +131,9 @@ struct snd_pcm_ops { > SNDRV_PCM_RATE_88200|SNDRV_PCM_RATE_96000) > #define SNDRV_PCM_RATE_8000_192000 (SNDRV_PCM_RATE_8000_96000|SNDRV_PCM_RATE_176400|\ > SNDRV_PCM_RATE_192000) > +#define SNDRV_PCM_RATE_8000_384000 (SNDRV_PCM_RATE_8000_192000|\ > + SNDRV_PCM_RATE_352800|\ > + SNDRV_PCM_RATE_384000) > #define _SNDRV_PCM_FMTBIT(fmt) (1ULL << (__force int)SNDRV_PCM_FORMAT_##fmt) > #define SNDRV_PCM_FMTBIT_S8 _SNDRV_PCM_FMTBIT(S8) > #define SNDRV_PCM_FMTBIT_U8 _SNDRV_PCM_FMTBIT(U8) > diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c > index 703857aab00f..11e653c8aa0e 100644 > --- a/sound/core/pcm_native.c > +++ b/sound/core/pcm_native.c > @@ -2170,7 +2170,7 @@ static int snd_pcm_hw_rule_sample_bits(struct snd_pcm_hw_params *params, > > static const unsigned int rates[] = { > 5512, 8000, 11025, 16000, 22050, 32000, 44100, > - 48000, 64000, 88200, 96000, 176400, 192000 > + 48000, 64000, 88200, 96000, 176400, 192000, 352800, 384000 > }; > > const struct snd_pcm_hw_constraint_list snd_pcm_known_rates = { > -- > 2.21.0 >