diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2016-08-12 17:27:48 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-08-15 10:14:57 -0400 |
commit | 3d240d73df4e3a21d9c2cdc378c192760adcba13 (patch) | |
tree | 7d32b92ebf833b70af5d22b45b527da80375ec47 /sound | |
parent | a68bc0d43e1b96c374c4b03eb9baa662778357b3 (diff) |
ASoC: Intel: Atom: add definitions for modem/SSP0 interface
The Atom DPCM driver only allowed for the SSP2 interface, add
definitions for modem/SSP0.
These definitions might be used to route audio to a codec
connected to SSP0 (instead of a modem in traditional usages),
but there is a restriction to 2ch I2S. SSP2 is capable of
handling up to 4 slot TDM.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/intel/atom/sst-atom-controls.c | 17 | ||||
-rw-r--r-- | sound/soc/intel/atom/sst-atom-controls.h | 6 |
2 files changed, 22 insertions, 1 deletions
diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c index 98720a93de8a..28eea127ec33 100644 --- a/sound/soc/intel/atom/sst-atom-controls.c +++ b/sound/soc/intel/atom/sst-atom-controls.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * sst-atom-controls.c - Intel MID Platform driver DPCM ALSA controls for Mrfld | 2 | * sst-atom-controls.c - Intel MID Platform driver DPCM ALSA controls for Mrfld |
3 | * | 3 | * |
4 | * Copyright (C) 2013-14 Intel Corp | 4 | * Copyright (C) 2013-14 Intel Corp |
@@ -534,6 +534,7 @@ static const DECLARE_TLV_DB_SCALE(sst_gain_tlv_common, SST_GAIN_MIN_VALUE * 10, | |||
534 | 534 | ||
535 | /* Look up table to convert MIXER SW bit regs to SWM inputs */ | 535 | /* Look up table to convert MIXER SW bit regs to SWM inputs */ |
536 | static const uint swm_mixer_input_ids[SST_SWM_INPUT_COUNT] = { | 536 | static const uint swm_mixer_input_ids[SST_SWM_INPUT_COUNT] = { |
537 | [SST_IP_MODEM] = SST_SWM_IN_MODEM, | ||
537 | [SST_IP_CODEC0] = SST_SWM_IN_CODEC0, | 538 | [SST_IP_CODEC0] = SST_SWM_IN_CODEC0, |
538 | [SST_IP_CODEC1] = SST_SWM_IN_CODEC1, | 539 | [SST_IP_CODEC1] = SST_SWM_IN_CODEC1, |
539 | [SST_IP_LOOP0] = SST_SWM_IN_SPROT_LOOP, | 540 | [SST_IP_LOOP0] = SST_SWM_IN_SPROT_LOOP, |
@@ -674,6 +675,7 @@ static int sst_swm_mixer_event(struct snd_soc_dapm_widget *w, | |||
674 | /* SBA mixers - 16 inputs */ | 675 | /* SBA mixers - 16 inputs */ |
675 | #define SST_SBA_DECLARE_MIX_CONTROLS(kctl_name) \ | 676 | #define SST_SBA_DECLARE_MIX_CONTROLS(kctl_name) \ |
676 | static const struct snd_kcontrol_new kctl_name[] = { \ | 677 | static const struct snd_kcontrol_new kctl_name[] = { \ |
678 | SOC_DAPM_SINGLE("modem_in Switch", SND_SOC_NOPM, SST_IP_MODEM, 1, 0), \ | ||
677 | SOC_DAPM_SINGLE("codec_in0 Switch", SND_SOC_NOPM, SST_IP_CODEC0, 1, 0), \ | 679 | SOC_DAPM_SINGLE("codec_in0 Switch", SND_SOC_NOPM, SST_IP_CODEC0, 1, 0), \ |
678 | SOC_DAPM_SINGLE("codec_in1 Switch", SND_SOC_NOPM, SST_IP_CODEC1, 1, 0), \ | 680 | SOC_DAPM_SINGLE("codec_in1 Switch", SND_SOC_NOPM, SST_IP_CODEC1, 1, 0), \ |
679 | SOC_DAPM_SINGLE("sprot_loop_in Switch", SND_SOC_NOPM, SST_IP_LOOP0, 1, 0), \ | 681 | SOC_DAPM_SINGLE("sprot_loop_in Switch", SND_SOC_NOPM, SST_IP_LOOP0, 1, 0), \ |
@@ -684,6 +686,7 @@ static int sst_swm_mixer_event(struct snd_soc_dapm_widget *w, | |||
684 | } | 686 | } |
685 | 687 | ||
686 | #define SST_SBA_MIXER_GRAPH_MAP(mix_name) \ | 688 | #define SST_SBA_MIXER_GRAPH_MAP(mix_name) \ |
689 | { mix_name, "modem_in Switch", "modem_in" }, \ | ||
687 | { mix_name, "codec_in0 Switch", "codec_in0" }, \ | 690 | { mix_name, "codec_in0 Switch", "codec_in0" }, \ |
688 | { mix_name, "codec_in1 Switch", "codec_in1" }, \ | 691 | { mix_name, "codec_in1 Switch", "codec_in1" }, \ |
689 | { mix_name, "sprot_loop_in Switch", "sprot_loop_in" }, \ | 692 | { mix_name, "sprot_loop_in Switch", "sprot_loop_in" }, \ |
@@ -713,6 +716,7 @@ SST_SBA_DECLARE_MIX_CONTROLS(sst_mix_media_l2_controls); | |||
713 | SST_SBA_DECLARE_MIX_CONTROLS(sst_mix_voip_controls); | 716 | SST_SBA_DECLARE_MIX_CONTROLS(sst_mix_voip_controls); |
714 | SST_SBA_DECLARE_MIX_CONTROLS(sst_mix_codec0_controls); | 717 | SST_SBA_DECLARE_MIX_CONTROLS(sst_mix_codec0_controls); |
715 | SST_SBA_DECLARE_MIX_CONTROLS(sst_mix_codec1_controls); | 718 | SST_SBA_DECLARE_MIX_CONTROLS(sst_mix_codec1_controls); |
719 | SST_SBA_DECLARE_MIX_CONTROLS(sst_mix_modem_controls); | ||
716 | 720 | ||
717 | /* | 721 | /* |
718 | * sst_handle_vb_timer - Start/Stop the DSP scheduler | 722 | * sst_handle_vb_timer - Start/Stop the DSP scheduler |
@@ -1047,8 +1051,10 @@ static int sst_set_media_loop(struct snd_soc_dapm_widget *w, | |||
1047 | } | 1051 | } |
1048 | 1052 | ||
1049 | static const struct snd_soc_dapm_widget sst_dapm_widgets[] = { | 1053 | static const struct snd_soc_dapm_widget sst_dapm_widgets[] = { |
1054 | SST_AIF_IN("modem_in", sst_set_be_modules), | ||
1050 | SST_AIF_IN("codec_in0", sst_set_be_modules), | 1055 | SST_AIF_IN("codec_in0", sst_set_be_modules), |
1051 | SST_AIF_IN("codec_in1", sst_set_be_modules), | 1056 | SST_AIF_IN("codec_in1", sst_set_be_modules), |
1057 | SST_AIF_OUT("modem_out", sst_set_be_modules), | ||
1052 | SST_AIF_OUT("codec_out0", sst_set_be_modules), | 1058 | SST_AIF_OUT("codec_out0", sst_set_be_modules), |
1053 | SST_AIF_OUT("codec_out1", sst_set_be_modules), | 1059 | SST_AIF_OUT("codec_out1", sst_set_be_modules), |
1054 | 1060 | ||
@@ -1103,6 +1109,9 @@ static const struct snd_soc_dapm_widget sst_dapm_widgets[] = { | |||
1103 | sst_mix_codec0_controls, sst_swm_mixer_event), | 1109 | sst_mix_codec0_controls, sst_swm_mixer_event), |
1104 | SST_SWM_MIXER("codec_out1 mix 0", SND_SOC_NOPM, SST_TASK_SBA, SST_SWM_OUT_CODEC1, | 1110 | SST_SWM_MIXER("codec_out1 mix 0", SND_SOC_NOPM, SST_TASK_SBA, SST_SWM_OUT_CODEC1, |
1105 | sst_mix_codec1_controls, sst_swm_mixer_event), | 1111 | sst_mix_codec1_controls, sst_swm_mixer_event), |
1112 | SST_SWM_MIXER("modem_out mix 0", SND_SOC_NOPM, SST_TASK_SBA, SST_SWM_OUT_MODEM, | ||
1113 | sst_mix_modem_controls, sst_swm_mixer_event), | ||
1114 | |||
1106 | }; | 1115 | }; |
1107 | 1116 | ||
1108 | static const struct snd_soc_dapm_route intercon[] = { | 1117 | static const struct snd_soc_dapm_route intercon[] = { |
@@ -1148,6 +1157,9 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
1148 | SST_SBA_MIXER_GRAPH_MAP("codec_out0 mix 0"), | 1157 | SST_SBA_MIXER_GRAPH_MAP("codec_out0 mix 0"), |
1149 | {"codec_out1", NULL, "codec_out1 mix 0"}, | 1158 | {"codec_out1", NULL, "codec_out1 mix 0"}, |
1150 | SST_SBA_MIXER_GRAPH_MAP("codec_out1 mix 0"), | 1159 | SST_SBA_MIXER_GRAPH_MAP("codec_out1 mix 0"), |
1160 | {"modem_out", NULL, "modem_out mix 0"}, | ||
1161 | SST_SBA_MIXER_GRAPH_MAP("modem_out mix 0"), | ||
1162 | |||
1151 | 1163 | ||
1152 | }; | 1164 | }; |
1153 | static const char * const slot_names[] = { | 1165 | static const char * const slot_names[] = { |
@@ -1217,6 +1229,9 @@ static const struct snd_kcontrol_new sst_gain_controls[] = { | |||
1217 | SST_GAIN("media_loop2_out", SST_PATH_INDEX_MEDIA_LOOP2_OUT, SST_TASK_SBA, 0, &sst_gains[13]), | 1229 | SST_GAIN("media_loop2_out", SST_PATH_INDEX_MEDIA_LOOP2_OUT, SST_TASK_SBA, 0, &sst_gains[13]), |
1218 | SST_GAIN("sprot_loop_out", SST_PATH_INDEX_SPROT_LOOP_OUT, SST_TASK_SBA, 0, &sst_gains[14]), | 1230 | SST_GAIN("sprot_loop_out", SST_PATH_INDEX_SPROT_LOOP_OUT, SST_TASK_SBA, 0, &sst_gains[14]), |
1219 | SST_VOLUME("media0_in", SST_PATH_INDEX_MEDIA0_IN, SST_TASK_MMX, 0, &sst_gains[15]), | 1231 | SST_VOLUME("media0_in", SST_PATH_INDEX_MEDIA0_IN, SST_TASK_MMX, 0, &sst_gains[15]), |
1232 | SST_GAIN("modem_in", SST_PATH_INDEX_MODEM_IN, SST_TASK_SBA, 0, &sst_gains[16]), | ||
1233 | SST_GAIN("modem_out", SST_PATH_INDEX_MODEM_OUT, SST_TASK_SBA, 0, &sst_gains[17]), | ||
1234 | |||
1220 | }; | 1235 | }; |
1221 | 1236 | ||
1222 | #define SST_GAIN_NUM_CONTROLS 3 | 1237 | #define SST_GAIN_NUM_CONTROLS 3 |
diff --git a/sound/soc/intel/atom/sst-atom-controls.h b/sound/soc/intel/atom/sst-atom-controls.h index e0113112f668..351d81469685 100644 --- a/sound/soc/intel/atom/sst-atom-controls.h +++ b/sound/soc/intel/atom/sst-atom-controls.h | |||
@@ -35,6 +35,8 @@ enum { | |||
35 | /* define a bit for each mixer input */ | 35 | /* define a bit for each mixer input */ |
36 | #define SST_MIX_IP(x) (x) | 36 | #define SST_MIX_IP(x) (x) |
37 | 37 | ||
38 | #define SST_IP_MODEM SST_MIX_IP(0) | ||
39 | #define SST_IP_BT SST_MIX_IP(1) | ||
38 | #define SST_IP_CODEC0 SST_MIX_IP(2) | 40 | #define SST_IP_CODEC0 SST_MIX_IP(2) |
39 | #define SST_IP_CODEC1 SST_MIX_IP(3) | 41 | #define SST_IP_CODEC1 SST_MIX_IP(3) |
40 | #define SST_IP_LOOP0 SST_MIX_IP(4) | 42 | #define SST_IP_LOOP0 SST_MIX_IP(4) |
@@ -63,6 +65,7 @@ enum { | |||
63 | * Audio DSP Path Ids. Specified by the audio DSP FW | 65 | * Audio DSP Path Ids. Specified by the audio DSP FW |
64 | */ | 66 | */ |
65 | enum sst_path_index { | 67 | enum sst_path_index { |
68 | SST_PATH_INDEX_MODEM_OUT = (0x00 << SST_PATH_ID_SHIFT), | ||
66 | SST_PATH_INDEX_CODEC_OUT0 = (0x02 << SST_PATH_ID_SHIFT), | 69 | SST_PATH_INDEX_CODEC_OUT0 = (0x02 << SST_PATH_ID_SHIFT), |
67 | SST_PATH_INDEX_CODEC_OUT1 = (0x03 << SST_PATH_ID_SHIFT), | 70 | SST_PATH_INDEX_CODEC_OUT1 = (0x03 << SST_PATH_ID_SHIFT), |
68 | 71 | ||
@@ -80,6 +83,7 @@ enum sst_path_index { | |||
80 | 83 | ||
81 | 84 | ||
82 | /* Start of input paths */ | 85 | /* Start of input paths */ |
86 | SST_PATH_INDEX_MODEM_IN = (0x80 << SST_PATH_ID_SHIFT), | ||
83 | SST_PATH_INDEX_CODEC_IN0 = (0x82 << SST_PATH_ID_SHIFT), | 87 | SST_PATH_INDEX_CODEC_IN0 = (0x82 << SST_PATH_ID_SHIFT), |
84 | SST_PATH_INDEX_CODEC_IN1 = (0x83 << SST_PATH_ID_SHIFT), | 88 | SST_PATH_INDEX_CODEC_IN1 = (0x83 << SST_PATH_ID_SHIFT), |
85 | 89 | ||
@@ -105,6 +109,7 @@ enum sst_path_index { | |||
105 | * path IDs | 109 | * path IDs |
106 | */ | 110 | */ |
107 | enum sst_swm_inputs { | 111 | enum sst_swm_inputs { |
112 | SST_SWM_IN_MODEM = (SST_PATH_INDEX_MODEM_IN | SST_DEFAULT_CELL_NBR), | ||
108 | SST_SWM_IN_CODEC0 = (SST_PATH_INDEX_CODEC_IN0 | SST_DEFAULT_CELL_NBR), | 113 | SST_SWM_IN_CODEC0 = (SST_PATH_INDEX_CODEC_IN0 | SST_DEFAULT_CELL_NBR), |
109 | SST_SWM_IN_CODEC1 = (SST_PATH_INDEX_CODEC_IN1 | SST_DEFAULT_CELL_NBR), | 114 | SST_SWM_IN_CODEC1 = (SST_PATH_INDEX_CODEC_IN1 | SST_DEFAULT_CELL_NBR), |
110 | SST_SWM_IN_SPROT_LOOP = (SST_PATH_INDEX_SPROT_LOOP_IN | SST_DEFAULT_CELL_NBR), | 115 | SST_SWM_IN_SPROT_LOOP = (SST_PATH_INDEX_SPROT_LOOP_IN | SST_DEFAULT_CELL_NBR), |
@@ -124,6 +129,7 @@ enum sst_swm_inputs { | |||
124 | * path IDs | 129 | * path IDs |
125 | */ | 130 | */ |
126 | enum sst_swm_outputs { | 131 | enum sst_swm_outputs { |
132 | SST_SWM_OUT_MODEM = (SST_PATH_INDEX_MODEM_OUT | SST_DEFAULT_CELL_NBR), | ||
127 | SST_SWM_OUT_CODEC0 = (SST_PATH_INDEX_CODEC_OUT0 | SST_DEFAULT_CELL_NBR), | 133 | SST_SWM_OUT_CODEC0 = (SST_PATH_INDEX_CODEC_OUT0 | SST_DEFAULT_CELL_NBR), |
128 | SST_SWM_OUT_CODEC1 = (SST_PATH_INDEX_CODEC_OUT1 | SST_DEFAULT_CELL_NBR), | 134 | SST_SWM_OUT_CODEC1 = (SST_PATH_INDEX_CODEC_OUT1 | SST_DEFAULT_CELL_NBR), |
129 | SST_SWM_OUT_SPROT_LOOP = (SST_PATH_INDEX_SPROT_LOOP_OUT | SST_DEFAULT_CELL_NBR), | 135 | SST_SWM_OUT_SPROT_LOOP = (SST_PATH_INDEX_SPROT_LOOP_OUT | SST_DEFAULT_CELL_NBR), |