Commit cababecb authored by Samuel Holland's avatar Samuel Holland Committed by Mark Brown

ASoC: sun50i-codec-analog: Group and sort mixer routes

Sort the controls in the same order as the bits in the register. Then
group the routes by sink, and sort them in the same order as the
controls. This makes it much easier to verify that all mixer inputs are
accounted for.
Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
Acked-by: default avatarChen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20200726025334.59931-4-samuel@sholland.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9b7612bb
...@@ -121,50 +121,50 @@ ...@@ -121,50 +121,50 @@
/* mixer controls */ /* mixer controls */
static const struct snd_kcontrol_new sun50i_a64_codec_mixer_controls[] = { static const struct snd_kcontrol_new sun50i_a64_codec_mixer_controls[] = {
SOC_DAPM_DOUBLE_R("DAC Playback Switch", SOC_DAPM_DOUBLE_R("Mic1 Playback Switch",
SUN50I_ADDA_OL_MIX_CTRL, SUN50I_ADDA_OL_MIX_CTRL,
SUN50I_ADDA_OR_MIX_CTRL, SUN50I_ADDA_OR_MIX_CTRL,
SUN50I_ADDA_OL_MIX_CTRL_DACL, 1, 0), SUN50I_ADDA_OL_MIX_CTRL_MIC1, 1, 0),
SOC_DAPM_DOUBLE_R("DAC Reversed Playback Switch", SOC_DAPM_DOUBLE_R("Mic2 Playback Switch",
SUN50I_ADDA_OL_MIX_CTRL, SUN50I_ADDA_OL_MIX_CTRL,
SUN50I_ADDA_OR_MIX_CTRL, SUN50I_ADDA_OR_MIX_CTRL,
SUN50I_ADDA_OL_MIX_CTRL_DACR, 1, 0), SUN50I_ADDA_OL_MIX_CTRL_MIC2, 1, 0),
SOC_DAPM_DOUBLE_R("Line In Playback Switch", SOC_DAPM_DOUBLE_R("Line In Playback Switch",
SUN50I_ADDA_OL_MIX_CTRL, SUN50I_ADDA_OL_MIX_CTRL,
SUN50I_ADDA_OR_MIX_CTRL, SUN50I_ADDA_OR_MIX_CTRL,
SUN50I_ADDA_OL_MIX_CTRL_LINEINL, 1, 0), SUN50I_ADDA_OL_MIX_CTRL_LINEINL, 1, 0),
SOC_DAPM_DOUBLE_R("Mic1 Playback Switch", SOC_DAPM_DOUBLE_R("DAC Playback Switch",
SUN50I_ADDA_OL_MIX_CTRL, SUN50I_ADDA_OL_MIX_CTRL,
SUN50I_ADDA_OR_MIX_CTRL, SUN50I_ADDA_OR_MIX_CTRL,
SUN50I_ADDA_OL_MIX_CTRL_MIC1, 1, 0), SUN50I_ADDA_OL_MIX_CTRL_DACL, 1, 0),
SOC_DAPM_DOUBLE_R("Mic2 Playback Switch", SOC_DAPM_DOUBLE_R("DAC Reversed Playback Switch",
SUN50I_ADDA_OL_MIX_CTRL, SUN50I_ADDA_OL_MIX_CTRL,
SUN50I_ADDA_OR_MIX_CTRL, SUN50I_ADDA_OR_MIX_CTRL,
SUN50I_ADDA_OL_MIX_CTRL_MIC2, 1, 0), SUN50I_ADDA_OL_MIX_CTRL_DACR, 1, 0),
}; };
/* ADC mixer controls */ /* ADC mixer controls */
static const struct snd_kcontrol_new sun50i_codec_adc_mixer_controls[] = { static const struct snd_kcontrol_new sun50i_codec_adc_mixer_controls[] = {
SOC_DAPM_DOUBLE_R("Mixer Capture Switch", SOC_DAPM_DOUBLE_R("Mic1 Capture Switch",
SUN50I_ADDA_L_ADCMIX_SRC, SUN50I_ADDA_L_ADCMIX_SRC,
SUN50I_ADDA_R_ADCMIX_SRC, SUN50I_ADDA_R_ADCMIX_SRC,
SUN50I_ADDA_L_ADCMIX_SRC_OMIXRL, 1, 0), SUN50I_ADDA_L_ADCMIX_SRC_MIC1, 1, 0),
SOC_DAPM_DOUBLE_R("Mixer Reversed Capture Switch", SOC_DAPM_DOUBLE_R("Mic2 Capture Switch",
SUN50I_ADDA_L_ADCMIX_SRC, SUN50I_ADDA_L_ADCMIX_SRC,
SUN50I_ADDA_R_ADCMIX_SRC, SUN50I_ADDA_R_ADCMIX_SRC,
SUN50I_ADDA_L_ADCMIX_SRC_OMIXRR, 1, 0), SUN50I_ADDA_L_ADCMIX_SRC_MIC2, 1, 0),
SOC_DAPM_DOUBLE_R("Line In Capture Switch", SOC_DAPM_DOUBLE_R("Line In Capture Switch",
SUN50I_ADDA_L_ADCMIX_SRC, SUN50I_ADDA_L_ADCMIX_SRC,
SUN50I_ADDA_R_ADCMIX_SRC, SUN50I_ADDA_R_ADCMIX_SRC,
SUN50I_ADDA_L_ADCMIX_SRC_LINEINL, 1, 0), SUN50I_ADDA_L_ADCMIX_SRC_LINEINL, 1, 0),
SOC_DAPM_DOUBLE_R("Mic1 Capture Switch", SOC_DAPM_DOUBLE_R("Mixer Capture Switch",
SUN50I_ADDA_L_ADCMIX_SRC, SUN50I_ADDA_L_ADCMIX_SRC,
SUN50I_ADDA_R_ADCMIX_SRC, SUN50I_ADDA_R_ADCMIX_SRC,
SUN50I_ADDA_L_ADCMIX_SRC_MIC1, 1, 0), SUN50I_ADDA_L_ADCMIX_SRC_OMIXRL, 1, 0),
SOC_DAPM_DOUBLE_R("Mic2 Capture Switch", SOC_DAPM_DOUBLE_R("Mixer Reversed Capture Switch",
SUN50I_ADDA_L_ADCMIX_SRC, SUN50I_ADDA_L_ADCMIX_SRC,
SUN50I_ADDA_R_ADCMIX_SRC, SUN50I_ADDA_R_ADCMIX_SRC,
SUN50I_ADDA_L_ADCMIX_SRC_MIC2, 1, 0), SUN50I_ADDA_L_ADCMIX_SRC_OMIXRR, 1, 0),
}; };
static const DECLARE_TLV_DB_SCALE(sun50i_codec_out_mixer_pregain_scale, static const DECLARE_TLV_DB_SCALE(sun50i_codec_out_mixer_pregain_scale,
...@@ -373,24 +373,32 @@ static const struct snd_soc_dapm_widget sun50i_a64_codec_widgets[] = { ...@@ -373,24 +373,32 @@ static const struct snd_soc_dapm_widget sun50i_a64_codec_widgets[] = {
static const struct snd_soc_dapm_route sun50i_a64_codec_routes[] = { static const struct snd_soc_dapm_route sun50i_a64_codec_routes[] = {
/* Left Mixer Routes */ /* Left Mixer Routes */
{ "Left Mixer", "Mic1 Playback Switch", "Mic1 Amplifier" },
{ "Left Mixer", "Mic2 Playback Switch", "Mic2 Amplifier" },
{ "Left Mixer", "Line In Playback Switch", "LINEIN" },
{ "Left Mixer", "DAC Playback Switch", "Left DAC" }, { "Left Mixer", "DAC Playback Switch", "Left DAC" },
{ "Left Mixer", "DAC Reversed Playback Switch", "Right DAC" }, { "Left Mixer", "DAC Reversed Playback Switch", "Right DAC" },
{ "Left Mixer", "Mic1 Playback Switch", "Mic1 Amplifier" },
/* Right Mixer Routes */ /* Right Mixer Routes */
{ "Right Mixer", "Mic1 Playback Switch", "Mic1 Amplifier" },
{ "Right Mixer", "Mic2 Playback Switch", "Mic2 Amplifier" },
{ "Right Mixer", "Line In Playback Switch", "LINEIN" },
{ "Right Mixer", "DAC Playback Switch", "Right DAC" }, { "Right Mixer", "DAC Playback Switch", "Right DAC" },
{ "Right Mixer", "DAC Reversed Playback Switch", "Left DAC" }, { "Right Mixer", "DAC Reversed Playback Switch", "Left DAC" },
{ "Right Mixer", "Mic1 Playback Switch", "Mic1 Amplifier" },
/* Left ADC Mixer Routes */ /* Left ADC Mixer Routes */
{ "Left ADC Mixer", "Mic1 Capture Switch", "Mic1 Amplifier" },
{ "Left ADC Mixer", "Mic2 Capture Switch", "Mic2 Amplifier" },
{ "Left ADC Mixer", "Line In Capture Switch", "LINEIN" },
{ "Left ADC Mixer", "Mixer Capture Switch", "Left Mixer" }, { "Left ADC Mixer", "Mixer Capture Switch", "Left Mixer" },
{ "Left ADC Mixer", "Mixer Reversed Capture Switch", "Right Mixer" }, { "Left ADC Mixer", "Mixer Reversed Capture Switch", "Right Mixer" },
{ "Left ADC Mixer", "Mic1 Capture Switch", "Mic1 Amplifier" },
/* Right ADC Mixer Routes */ /* Right ADC Mixer Routes */
{ "Right ADC Mixer", "Mic1 Capture Switch", "Mic1 Amplifier" },
{ "Right ADC Mixer", "Mic2 Capture Switch", "Mic2 Amplifier" },
{ "Right ADC Mixer", "Line In Capture Switch", "LINEIN" },
{ "Right ADC Mixer", "Mixer Capture Switch", "Right Mixer" }, { "Right ADC Mixer", "Mixer Capture Switch", "Right Mixer" },
{ "Right ADC Mixer", "Mixer Reversed Capture Switch", "Left Mixer" }, { "Right ADC Mixer", "Mixer Reversed Capture Switch", "Left Mixer" },
{ "Right ADC Mixer", "Mic1 Capture Switch", "Mic1 Amplifier" },
/* ADC Routes */ /* ADC Routes */
{ "Left ADC", NULL, "Left ADC Mixer" }, { "Left ADC", NULL, "Left ADC Mixer" },
...@@ -410,16 +418,6 @@ static const struct snd_soc_dapm_route sun50i_a64_codec_routes[] = { ...@@ -410,16 +418,6 @@ static const struct snd_soc_dapm_route sun50i_a64_codec_routes[] = {
/* Microphone Routes */ /* Microphone Routes */
{ "Mic2 Amplifier", NULL, "MIC2"}, { "Mic2 Amplifier", NULL, "MIC2"},
{ "Left Mixer", "Mic2 Playback Switch", "Mic2 Amplifier" },
{ "Right Mixer", "Mic2 Playback Switch", "Mic2 Amplifier" },
{ "Left ADC Mixer", "Mic2 Capture Switch", "Mic2 Amplifier" },
{ "Right ADC Mixer", "Mic2 Capture Switch", "Mic2 Amplifier" },
/* Line-in Routes */
{ "Left Mixer", "Line In Playback Switch", "LINEIN" },
{ "Right Mixer", "Line In Playback Switch", "LINEIN" },
{ "Left ADC Mixer", "Line In Capture Switch", "LINEIN" },
{ "Right ADC Mixer", "Line In Capture Switch", "LINEIN" },
/* Line-out Routes */ /* Line-out Routes */
{ "Line Out Source Playback Route", "Stereo", "Left Mixer" }, { "Line Out Source Playback Route", "Stereo", "Left Mixer" },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment