All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: ssm2602: add 16kHz sampling rate support
@ 2014-01-07 21:34 Andreas Pretzsch
  2014-01-07 21:43 ` Lars-Peter Clausen
  2014-01-08 12:51 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Pretzsch @ 2014-01-07 21:34 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Lars-Peter Clausen

SSM260x also supports 16kHz with external master clocks of 12.000MHz,
12.288MHz and 18.432MHz.
Add matching coefficients, update constraints and announced rates.

Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
---
patch against topic/ssm2602 of kernel.org/.../broonie/sound.git
Values taken from SSM2603 datasheet (2602/2603/2604 identical here).
Tested on real hardware with 12.288MHz master clock.
Useful e.g. for wideband codecs like G.722.

 sound/soc/codecs/ssm2602.c |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
index c6dd485..af76bbd 100644
--- a/sound/soc/codecs/ssm2602.c
+++ b/sound/soc/codecs/ssm2602.c
@@ -194,7 +194,7 @@ static const struct snd_soc_dapm_route ssm2604_routes[] = {
 };
 
 static const unsigned int ssm2602_rates_12288000[] = {
-	8000, 32000, 48000, 96000,
+	8000, 16000, 32000, 48000, 96000,
 };
 
 static struct snd_pcm_hw_constraint_list ssm2602_constraints_12288000 = {
@@ -231,6 +231,11 @@ static const struct ssm2602_coeff ssm2602_coeff_table[] = {
 	{18432000, 32000, SSM2602_COEFF_SRATE(0x6, 0x1, 0x0)},
 	{12000000, 32000, SSM2602_COEFF_SRATE(0x6, 0x0, 0x1)},
 
+	/* 16k */
+	{12288000, 16000, SSM2602_COEFF_SRATE(0x5, 0x0, 0x0)},
+	{18432000, 16000, SSM2602_COEFF_SRATE(0x5, 0x1, 0x0)},
+	{12000000, 16000, SSM2602_COEFF_SRATE(0xa, 0x0, 0x1)},
+
 	/* 8k */
 	{12288000, 8000, SSM2602_COEFF_SRATE(0x3, 0x0, 0x0)},
 	{18432000, 8000, SSM2602_COEFF_SRATE(0x3, 0x1, 0x0)},
@@ -473,9 +478,10 @@ static int ssm2602_set_bias_level(struct snd_soc_codec *codec,
 	return 0;
 }
 
-#define SSM2602_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_32000 |\
-		SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |\
-		SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
+#define SSM2602_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\
+		SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
+		SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
+		SNDRV_PCM_RATE_96000)
 
 #define SSM2602_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
 		SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
-- 
1.7.10.4

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

* Re: [PATCH] ASoC: ssm2602: add 16kHz sampling rate support
  2014-01-07 21:34 [PATCH] ASoC: ssm2602: add 16kHz sampling rate support Andreas Pretzsch
@ 2014-01-07 21:43 ` Lars-Peter Clausen
  2014-01-08 12:51 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Lars-Peter Clausen @ 2014-01-07 21:43 UTC (permalink / raw)
  To: Andreas Pretzsch; +Cc: alsa-devel, Mark Brown

On 01/07/2014 10:34 PM, Andreas Pretzsch wrote:
> SSM260x also supports 16kHz with external master clocks of 12.000MHz,
> 12.288MHz and 18.432MHz.
> Add matching coefficients, update constraints and announced rates.
> 
> Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>

Looks good, thanks.

Acked-by: Lars-Peter Clausen <lars@metafoo.de>

> ---
> patch against topic/ssm2602 of kernel.org/.../broonie/sound.git
> Values taken from SSM2603 datasheet (2602/2603/2604 identical here).
> Tested on real hardware with 12.288MHz master clock.
> Useful e.g. for wideband codecs like G.722.
> 
>  sound/soc/codecs/ssm2602.c |   14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
> index c6dd485..af76bbd 100644
> --- a/sound/soc/codecs/ssm2602.c
> +++ b/sound/soc/codecs/ssm2602.c
> @@ -194,7 +194,7 @@ static const struct snd_soc_dapm_route ssm2604_routes[] = {
>  };
>  
>  static const unsigned int ssm2602_rates_12288000[] = {
> -	8000, 32000, 48000, 96000,
> +	8000, 16000, 32000, 48000, 96000,
>  };
>  
>  static struct snd_pcm_hw_constraint_list ssm2602_constraints_12288000 = {
> @@ -231,6 +231,11 @@ static const struct ssm2602_coeff ssm2602_coeff_table[] = {
>  	{18432000, 32000, SSM2602_COEFF_SRATE(0x6, 0x1, 0x0)},
>  	{12000000, 32000, SSM2602_COEFF_SRATE(0x6, 0x0, 0x1)},
>  
> +	/* 16k */
> +	{12288000, 16000, SSM2602_COEFF_SRATE(0x5, 0x0, 0x0)},
> +	{18432000, 16000, SSM2602_COEFF_SRATE(0x5, 0x1, 0x0)},
> +	{12000000, 16000, SSM2602_COEFF_SRATE(0xa, 0x0, 0x1)},
> +
>  	/* 8k */
>  	{12288000, 8000, SSM2602_COEFF_SRATE(0x3, 0x0, 0x0)},
>  	{18432000, 8000, SSM2602_COEFF_SRATE(0x3, 0x1, 0x0)},
> @@ -473,9 +478,10 @@ static int ssm2602_set_bias_level(struct snd_soc_codec *codec,
>  	return 0;
>  }
>  
> -#define SSM2602_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_32000 |\
> -		SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |\
> -		SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
> +#define SSM2602_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\
> +		SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
> +		SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
> +		SNDRV_PCM_RATE_96000)
>  
>  #define SSM2602_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
>  		SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
> 

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

* Re: [PATCH] ASoC: ssm2602: add 16kHz sampling rate support
  2014-01-07 21:34 [PATCH] ASoC: ssm2602: add 16kHz sampling rate support Andreas Pretzsch
  2014-01-07 21:43 ` Lars-Peter Clausen
@ 2014-01-08 12:51 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2014-01-08 12:51 UTC (permalink / raw)
  To: Andreas Pretzsch; +Cc: alsa-devel, Lars-Peter Clausen


[-- Attachment #1.1: Type: text/plain, Size: 252 bytes --]

On Tue, Jan 07, 2014 at 10:34:41PM +0100, Andreas Pretzsch wrote:
> SSM260x also supports 16kHz with external master clocks of 12.000MHz,
> 12.288MHz and 18.432MHz.
> Add matching coefficients, update constraints and announced rates.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

end of thread, other threads:[~2014-01-08 12:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-07 21:34 [PATCH] ASoC: ssm2602: add 16kHz sampling rate support Andreas Pretzsch
2014-01-07 21:43 ` Lars-Peter Clausen
2014-01-08 12:51 ` Mark Brown

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.