linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: pcm: add support for 352.8KHz and 384KHz sample rate
@ 2019-08-21 10:27 Srinivas Kandagatla
  2019-08-21 17:44 ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Srinivas Kandagatla @ 2019-08-21 10:27 UTC (permalink / raw)
  To: broonie, tiwai
  Cc: bgoswami, plai, alsa-devel, linux-kernel, lgirdwood,
	Vidyakumar Athota, Srinivas Kandagatla

From: Vidyakumar Athota <vathota@codeaurora.org>

Most of the modern codecs supports 352.8KHz and 384KHz sample rates.
Currently 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 <vathota@codeaurora.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ALSA: pcm: add support for 352.8KHz and 384KHz sample rate
  2019-08-21 10:27 [PATCH] ALSA: pcm: add support for 352.8KHz and 384KHz sample rate Srinivas Kandagatla
@ 2019-08-21 17:44 ` Takashi Iwai
  2019-08-22  9:18   ` Srinivas Kandagatla
  0 siblings, 1 reply; 3+ messages in thread
From: Takashi Iwai @ 2019-08-21 17:44 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: broonie, bgoswami, plai, alsa-devel, linux-kernel, lgirdwood,
	Vidyakumar Athota

On Wed, 21 Aug 2019 12:27:05 +0200,
Srinivas Kandagatla wrote:
> 
> From: Vidyakumar Athota <vathota@codeaurora.org>
> 
> Most of the modern codecs supports 352.8KHz and 384KHz sample rates.
> Currently 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 <vathota@codeaurora.org>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

As I repeatedly write for this kind of request, please submit always
with the user of the API, not only the API change itself.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ALSA: pcm: add support for 352.8KHz and 384KHz sample rate
  2019-08-21 17:44 ` Takashi Iwai
@ 2019-08-22  9:18   ` Srinivas Kandagatla
  0 siblings, 0 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2019-08-22  9:18 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: broonie, bgoswami, plai, alsa-devel, linux-kernel, lgirdwood,
	Vidyakumar Athota

Thanks for taking time to review,

On 21/08/2019 18:44, Takashi Iwai wrote:
> On Wed, 21 Aug 2019 12:27:05 +0200,
> Srinivas Kandagatla wrote:
>>
>> From: Vidyakumar Athota <vathota@codeaurora.org>
>>
>> Most of the modern codecs supports 352.8KHz and 384KHz sample rates.
>> Currently 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 <vathota@codeaurora.org>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> 
> As I repeatedly write for this kind of request, please submit always
> with the user of the API, not only the API change itself.
> 
I totally agree with you.

I will respin the patchset with wcd9335 and QDSP6 patches.


thanks,
srini


> 
> thanks,
> 
> Takashi
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-22  9:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-21 10:27 [PATCH] ALSA: pcm: add support for 352.8KHz and 384KHz sample rate Srinivas Kandagatla
2019-08-21 17:44 ` Takashi Iwai
2019-08-22  9:18   ` Srinivas Kandagatla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).