summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUday Gupta <udayg@nvidia.com>2017-05-04 04:00:22 -0400
committerSameer Pujar <spujar@nvidia.com>2017-07-11 05:55:37 -0400
commite6f3995488db7e4d682f547d6f49f74da476183e (patch)
tree72b376e5401aea2e63e6c3b606b6960203ff49e9
parent05fc501374d118320062cf93c0034e4e050c1ff6 (diff)
ASoC: tegra-virt-alt: Add 24 kHz support
Use SNDRV_PCM_RATE_KNOT instead of SNDRV_PCM_RATE_8000_192000 to support 24 Khz Sampling rate Jira EMA-412 Change-Id: I05375f8203411d0366b7c0b5e2b4dca35d70342c Signed-off-by: Uday Gupta <udayg@nvidia.com> Reviewed-on: http://git-master/r/1475235 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--sound/soc/tegra-alt/tegra210_adsp_alt.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sound/soc/tegra-alt/tegra210_adsp_alt.c b/sound/soc/tegra-alt/tegra210_adsp_alt.c
index 8145eb3f6..dd9848644 100644
--- a/sound/soc/tegra-alt/tegra210_adsp_alt.c
+++ b/sound/soc/tegra-alt/tegra210_adsp_alt.c
@@ -69,6 +69,17 @@
69#define PLUGIN_SET_PARAMS_IDX 1 69#define PLUGIN_SET_PARAMS_IDX 1
70#define PLUGIN_SEND_BYTES_IDX 11 70#define PLUGIN_SEND_BYTES_IDX 11
71 71
72static const unsigned int tegra210_adsp_rates[] = {
73 8000, 11025, 12000, 16000, 22050,
74 24000, 32000, 44100, 48000
75};
76
77static const struct snd_pcm_hw_constraint_list
78 tegra210_adsp_rate_constraints = {
79 .count = ARRAY_SIZE(tegra210_adsp_rates),
80 .list = tegra210_adsp_rates,
81};
82
72static struct tegra210_adsp_app_desc { 83static struct tegra210_adsp_app_desc {
73 const char *name; 84 const char *name;
74 const char *fw_name; 85 const char *fw_name;
@@ -2234,6 +2245,15 @@ static int tegra210_adsp_admaif_hv_hw_params(
2234 return ret; 2245 return ret;
2235} 2246}
2236#endif 2247#endif
2248
2249static int tegra210_adsp_fe_startup(struct snd_pcm_substream *substream,
2250 struct snd_soc_dai *cpu_dai)
2251{
2252 return snd_pcm_hw_constraint_list(substream->runtime, 0,
2253 SNDRV_PCM_HW_PARAM_RATE,
2254 &tegra210_adsp_rate_constraints);
2255}
2256
2237static int tegra210_adsp_fe_hw_params(struct snd_pcm_substream *substream, 2257static int tegra210_adsp_fe_hw_params(struct snd_pcm_substream *substream,
2238 struct snd_pcm_hw_params *params, 2258 struct snd_pcm_hw_params *params,
2239 struct snd_soc_dai *dai) 2259 struct snd_soc_dai *dai)
@@ -2853,6 +2873,7 @@ static int tegra210_adsp_widget_event(struct snd_soc_dapm_widget *w,
2853} 2873}
2854static struct snd_soc_dai_ops tegra210_adsp_fe_dai_ops = { 2874static struct snd_soc_dai_ops tegra210_adsp_fe_dai_ops = {
2855 .hw_params = tegra210_adsp_fe_hw_params, 2875 .hw_params = tegra210_adsp_fe_hw_params,
2876 .startup = tegra210_adsp_fe_startup,
2856}; 2877};
2857 2878
2858static struct snd_soc_dai_ops tegra210_adsp_admaif_dai_ops = { 2879static struct snd_soc_dai_ops tegra210_adsp_admaif_dai_ops = {