diff mbox series

[v2,3/4] ASoC: qdsp6: q6afe-dai: Update max rate for slim and tdm dais

Message ID 20190822095653.7200-4-srinivas.kandagatla@linaro.org
State New
Headers show
Series ALSA: pcm: add support for 352.8KHz and 384KHz sample rate | expand

Commit Message

Srinivas Kandagatla Aug. 22, 2019, 9:56 a.m. UTC
QDSP supports up to 384000 rates on SLIM dais and 352800 rate on TDM dais.
Add this missing rates.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

---
 sound/soc/qcom/qdsp6/q6afe-dai.c | 92 +++++++++++---------------------
 1 file changed, 32 insertions(+), 60 deletions(-)

-- 
2.21.0

Comments

Takashi Iwai Aug. 22, 2019, 10:09 a.m. UTC | #1
On Thu, 22 Aug 2019 11:56:52 +0200,
Srinivas Kandagatla wrote:
> 

> QDSP supports up to 384000 rates on SLIM dais and 352800 rate on TDM dais.

> Add this missing rates.

> 

> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

> ---

>  sound/soc/qcom/qdsp6/q6afe-dai.c | 92 +++++++++++---------------------

>  1 file changed, 32 insertions(+), 60 deletions(-)

> 

> diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-dai.c

> index c1a7624eaf17..ae2baefdb6e2 100644

> --- a/sound/soc/qcom/qdsp6/q6afe-dai.c

> +++ b/sound/soc/qcom/qdsp6/q6afe-dai.c

> @@ -18,14 +18,14 @@

>  			.stream_name = pre" TDM"#num" Playback",	\

>  			.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\

>  				SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\

> -				SNDRV_PCM_RATE_176400,			\

> +				SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_352800,\


This will support a lot more than advertised, e.g. it contains 64000Hz
or 22050Hz.  Is this supposed?  If yes, mention it clearly in the
changelog, too.


thanks,

Takashi
Srinivas Kandagatla Aug. 22, 2019, 10:45 a.m. UTC | #2
On 22/08/2019 11:09, Takashi Iwai wrote:
> On Thu, 22 Aug 2019 11:56:52 +0200,

> Srinivas Kandagatla wrote:

>>

>> QDSP supports up to 384000 rates on SLIM dais and 352800 rate on TDM dais.

>> Add this missing rates.

>>

>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

>> ---

>>   sound/soc/qcom/qdsp6/q6afe-dai.c | 92 +++++++++++---------------------

>>   1 file changed, 32 insertions(+), 60 deletions(-)

>>

>> diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-dai.c

>> index c1a7624eaf17..ae2baefdb6e2 100644

>> --- a/sound/soc/qcom/qdsp6/q6afe-dai.c

>> +++ b/sound/soc/qcom/qdsp6/q6afe-dai.c

>> @@ -18,14 +18,14 @@

>>   			.stream_name = pre" TDM"#num" Playback",	\

>>   			.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\

>>   				SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\

>> -				SNDRV_PCM_RATE_176400,			\

>> +				SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_352800,\

> 

> This will support a lot more than advertised, e.g. it contains 64000Hz

> or 22050Hz.  Is this supposed?  If yes, mention it clearly in the

> changelog, too.


Some of the rates inbetween are not in the DSP supported rate list for TDM.

DSP should return error if we try to set any unsupported rate!

--srini
> 

> thanks,

> 

> Takashi

>
Mark Brown Aug. 22, 2019, 10:53 a.m. UTC | #3
On Thu, Aug 22, 2019 at 11:45:48AM +0100, Srinivas Kandagatla wrote:
> On 22/08/2019 11:09, Takashi Iwai wrote:


> > This will support a lot more than advertised, e.g. it contains 64000Hz

> > or 22050Hz.  Is this supposed?  If yes, mention it clearly in the

> > changelog, too.


> Some of the rates inbetween are not in the DSP supported rate list for TDM.


> DSP should return error if we try to set any unsupported rate!


The goal with the capabilities is that we should never get as far as
trying to actually set an unsupported rate, we should figure out earlier
on that it won't work and never even try.
diff mbox series

Patch

diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-dai.c
index c1a7624eaf17..ae2baefdb6e2 100644
--- a/sound/soc/qcom/qdsp6/q6afe-dai.c
+++ b/sound/soc/qcom/qdsp6/q6afe-dai.c
@@ -18,14 +18,14 @@ 
 			.stream_name = pre" TDM"#num" Playback",	\
 			.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\
 				SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\
-				SNDRV_PCM_RATE_176400,			\
+				SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_352800,\
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |		\
 				   SNDRV_PCM_FMTBIT_S24_LE |		\
 				   SNDRV_PCM_FMTBIT_S32_LE,		\
 			.channels_min = 1,				\
 			.channels_max = 8,				\
 			.rate_min = 8000,				\
-			.rate_max = 176400,				\
+			.rate_max = 352800,				\
 		},							\
 		.name = #did,						\
 		.ops = &q6tdm_ops,					\
@@ -39,14 +39,14 @@ 
 			.stream_name = pre" TDM"#num" Capture",		\
 			.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\
 				SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\
-				SNDRV_PCM_RATE_176400,			\
+				SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_352800,\
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |		\
 				   SNDRV_PCM_FMTBIT_S24_LE |		\
 				   SNDRV_PCM_FMTBIT_S32_LE,		\
 			.channels_min = 1,				\
 			.channels_max = 8,				\
 			.rate_min = 8000,				\
-			.rate_max = 176400,				\
+			.rate_max = 352800,				\
 		},							\
 		.name = #did,						\
 		.ops = &q6tdm_ops,					\
@@ -646,15 +646,13 @@  static struct snd_soc_dai_driver q6afe_dais[] = {
 		.remove = msm_dai_q6_dai_remove,
 		.playback = {
 			.stream_name = "Slimbus Playback",
-			.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 |
-				 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 |
-				 SNDRV_PCM_RATE_192000,
+			.rates = SNDRV_PCM_RATE_8000_384000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
 				   SNDRV_PCM_FMTBIT_S24_LE,
 			.channels_min = 1,
 			.channels_max = 8,
 			.rate_min = 8000,
-			.rate_max = 192000,
+			.rate_max = 384000,
 		},
 	}, {
 		.name = "SLIMBUS_0_TX",
@@ -664,28 +662,24 @@  static struct snd_soc_dai_driver q6afe_dais[] = {
 		.remove = msm_dai_q6_dai_remove,
 		.capture = {
 			.stream_name = "Slimbus Capture",
-			.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 |
-				 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 |
-				 SNDRV_PCM_RATE_192000,
+			.rates = SNDRV_PCM_RATE_8000_384000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
 				   SNDRV_PCM_FMTBIT_S24_LE,
 			.channels_min = 1,
 			.channels_max = 8,
 			.rate_min = 8000,
-			.rate_max = 192000,
+			.rate_max = 384000,
 		},
 	}, {
 		.playback = {
 			.stream_name = "Slimbus1 Playback",
-			.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |
-				 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |
-				 SNDRV_PCM_RATE_192000,
+			.rates = SNDRV_PCM_RATE_8000_384000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
 				   SNDRV_PCM_FMTBIT_S24_LE,
 			.channels_min = 1,
 			.channels_max = 2,
 			.rate_min = 8000,
-			.rate_max = 192000,
+			.rate_max = 384000,
 		},
 		.name = "SLIMBUS_1_RX",
 		.ops = &q6slim_ops,
@@ -700,28 +694,24 @@  static struct snd_soc_dai_driver q6afe_dais[] = {
 		.remove = msm_dai_q6_dai_remove,
 		.capture = {
 			.stream_name = "Slimbus1 Capture",
-			.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 |
-				 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 |
-				 SNDRV_PCM_RATE_192000,
+			.rates = SNDRV_PCM_RATE_8000_384000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
 				   SNDRV_PCM_FMTBIT_S24_LE,
 			.channels_min = 1,
 			.channels_max = 8,
 			.rate_min = 8000,
-			.rate_max = 192000,
+			.rate_max = 384000,
 		},
 	}, {
 		.playback = {
 			.stream_name = "Slimbus2 Playback",
-			.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 |
-				 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 |
-				 SNDRV_PCM_RATE_192000,
+			.rates = SNDRV_PCM_RATE_8000_384000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
 				   SNDRV_PCM_FMTBIT_S24_LE,
 			.channels_min = 1,
 			.channels_max = 8,
 			.rate_min = 8000,
-			.rate_max = 192000,
+			.rate_max = 384000,
 		},
 		.name = "SLIMBUS_2_RX",
 		.ops = &q6slim_ops,
@@ -737,28 +727,24 @@  static struct snd_soc_dai_driver q6afe_dais[] = {
 		.remove = msm_dai_q6_dai_remove,
 		.capture = {
 			.stream_name = "Slimbus2 Capture",
-			.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 |
-				 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 |
-				 SNDRV_PCM_RATE_192000,
+			.rates = SNDRV_PCM_RATE_8000_384000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
 				   SNDRV_PCM_FMTBIT_S24_LE,
 			.channels_min = 1,
 			.channels_max = 8,
 			.rate_min = 8000,
-			.rate_max = 192000,
+			.rate_max = 384000,
 		},
 	}, {
 		.playback = {
 			.stream_name = "Slimbus3 Playback",
-			.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |
-				 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |
-				 SNDRV_PCM_RATE_192000,
+			.rates = SNDRV_PCM_RATE_8000_384000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
 				   SNDRV_PCM_FMTBIT_S24_LE,
 			.channels_min = 1,
 			.channels_max = 2,
 			.rate_min = 8000,
-			.rate_max = 192000,
+			.rate_max = 384000,
 		},
 		.name = "SLIMBUS_3_RX",
 		.ops = &q6slim_ops,
@@ -774,28 +760,24 @@  static struct snd_soc_dai_driver q6afe_dais[] = {
 		.remove = msm_dai_q6_dai_remove,
 		.capture = {
 			.stream_name = "Slimbus3 Capture",
-			.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 |
-				 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 |
-				 SNDRV_PCM_RATE_192000,
+			.rates = SNDRV_PCM_RATE_8000_384000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
 				   SNDRV_PCM_FMTBIT_S24_LE,
 			.channels_min = 1,
 			.channels_max = 8,
 			.rate_min = 8000,
-			.rate_max = 192000,
+			.rate_max = 384000,
 		},
 	}, {
 		.playback = {
 			.stream_name = "Slimbus4 Playback",
-			.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |
-				 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |
-				 SNDRV_PCM_RATE_192000,
+			.rates = SNDRV_PCM_RATE_8000_384000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
 				   SNDRV_PCM_FMTBIT_S24_LE,
 			.channels_min = 1,
 			.channels_max = 2,
 			.rate_min = 8000,
-			.rate_max = 192000,
+			.rate_max = 384000,
 		},
 		.name = "SLIMBUS_4_RX",
 		.ops = &q6slim_ops,
@@ -811,28 +793,24 @@  static struct snd_soc_dai_driver q6afe_dais[] = {
 		.remove = msm_dai_q6_dai_remove,
 		.capture = {
 			.stream_name = "Slimbus4 Capture",
-			.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 |
-				 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 |
-				 SNDRV_PCM_RATE_192000,
+			.rates = SNDRV_PCM_RATE_8000_384000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
 				   SNDRV_PCM_FMTBIT_S24_LE,
 			.channels_min = 1,
 			.channels_max = 8,
 			.rate_min = 8000,
-			.rate_max = 192000,
+			.rate_max = 384000,
 		},
 	}, {
 		.playback = {
 			.stream_name = "Slimbus5 Playback",
-			.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |
-				 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |
-				 SNDRV_PCM_RATE_192000,
+			.rates = SNDRV_PCM_RATE_8000_384000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
 				   SNDRV_PCM_FMTBIT_S24_LE,
 			.channels_min = 1,
 			.channels_max = 2,
 			.rate_min = 8000,
-			.rate_max = 192000,
+			.rate_max = 384000,
 		},
 		.name = "SLIMBUS_5_RX",
 		.ops = &q6slim_ops,
@@ -848,28 +826,24 @@  static struct snd_soc_dai_driver q6afe_dais[] = {
 		.remove = msm_dai_q6_dai_remove,
 		.capture = {
 			.stream_name = "Slimbus5 Capture",
-			.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 |
-				 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 |
-				 SNDRV_PCM_RATE_192000,
+			.rates = SNDRV_PCM_RATE_8000_384000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
 				   SNDRV_PCM_FMTBIT_S24_LE,
 			.channels_min = 1,
 			.channels_max = 8,
 			.rate_min = 8000,
-			.rate_max = 192000,
+			.rate_max = 384000,
 		},
 	}, {
 		.playback = {
 			.stream_name = "Slimbus6 Playback",
-			.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |
-				 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |
-				 SNDRV_PCM_RATE_192000,
+			.rates = SNDRV_PCM_RATE_8000_384000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
 				   SNDRV_PCM_FMTBIT_S24_LE,
 			.channels_min = 1,
 			.channels_max = 2,
 			.rate_min = 8000,
-			.rate_max = 192000,
+			.rate_max = 384000,
 		},
 		.ops = &q6slim_ops,
 		.name = "SLIMBUS_6_RX",
@@ -885,15 +859,13 @@  static struct snd_soc_dai_driver q6afe_dais[] = {
 		.remove = msm_dai_q6_dai_remove,
 		.capture = {
 			.stream_name = "Slimbus6 Capture",
-			.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 |
-				 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 |
-				 SNDRV_PCM_RATE_192000,
+			.rates = SNDRV_PCM_RATE_8000_384000,
 			.formats = SNDRV_PCM_FMTBIT_S16_LE |
 				   SNDRV_PCM_FMTBIT_S24_LE,
 			.channels_min = 1,
 			.channels_max = 8,
 			.rate_min = 8000,
-			.rate_max = 192000,
+			.rate_max = 384000,
 		},
 	}, {
 		.playback = {