Commit e61a35b7 authored by Takashi Iwai's avatar Takashi Iwai Committed by Mark Brown

ASoC: wm8994: Fix the wrong number of enum items

wm8994 codec driver has a few places wrongly defining the number of
enum items.

Use SOC_ENUM_SINGLE_DECL() macro and they are automatically fixed.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Acked-by: default avatarLiam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 38dbfb59
...@@ -265,21 +265,21 @@ static const char *sidetone_hpf_text[] = { ...@@ -265,21 +265,21 @@ static const char *sidetone_hpf_text[] = {
"2.7kHz", "1.35kHz", "675Hz", "370Hz", "180Hz", "90Hz", "45Hz" "2.7kHz", "1.35kHz", "675Hz", "370Hz", "180Hz", "90Hz", "45Hz"
}; };
static const struct soc_enum sidetone_hpf = static SOC_ENUM_SINGLE_DECL(sidetone_hpf,
SOC_ENUM_SINGLE(WM8994_SIDETONE, 7, 7, sidetone_hpf_text); WM8994_SIDETONE, 7, sidetone_hpf_text);
static const char *adc_hpf_text[] = { static const char *adc_hpf_text[] = {
"HiFi", "Voice 1", "Voice 2", "Voice 3" "HiFi", "Voice 1", "Voice 2", "Voice 3"
}; };
static const struct soc_enum aif1adc1_hpf = static SOC_ENUM_SINGLE_DECL(aif1adc1_hpf,
SOC_ENUM_SINGLE(WM8994_AIF1_ADC1_FILTERS, 13, 4, adc_hpf_text); WM8994_AIF1_ADC1_FILTERS, 13, adc_hpf_text);
static const struct soc_enum aif1adc2_hpf = static SOC_ENUM_SINGLE_DECL(aif1adc2_hpf,
SOC_ENUM_SINGLE(WM8994_AIF1_ADC2_FILTERS, 13, 4, adc_hpf_text); WM8994_AIF1_ADC2_FILTERS, 13, adc_hpf_text);
static const struct soc_enum aif2adc_hpf = static SOC_ENUM_SINGLE_DECL(aif2adc_hpf,
SOC_ENUM_SINGLE(WM8994_AIF2_ADC_FILTERS, 13, 4, adc_hpf_text); WM8994_AIF2_ADC_FILTERS, 13, adc_hpf_text);
static const DECLARE_TLV_DB_SCALE(aif_tlv, 0, 600, 0); static const DECLARE_TLV_DB_SCALE(aif_tlv, 0, 600, 0);
static const DECLARE_TLV_DB_SCALE(digital_tlv, -7200, 75, 1); static const DECLARE_TLV_DB_SCALE(digital_tlv, -7200, 75, 1);
...@@ -501,39 +501,39 @@ static const char *aif_chan_src_text[] = { ...@@ -501,39 +501,39 @@ static const char *aif_chan_src_text[] = {
"Left", "Right" "Left", "Right"
}; };
static const struct soc_enum aif1adcl_src = static SOC_ENUM_SINGLE_DECL(aif1adcl_src,
SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_1, 15, 2, aif_chan_src_text); WM8994_AIF1_CONTROL_1, 15, aif_chan_src_text);
static const struct soc_enum aif1adcr_src = static SOC_ENUM_SINGLE_DECL(aif1adcr_src,
SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_1, 14, 2, aif_chan_src_text); WM8994_AIF1_CONTROL_1, 14, aif_chan_src_text);
static const struct soc_enum aif2adcl_src = static SOC_ENUM_SINGLE_DECL(aif2adcl_src,
SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_1, 15, 2, aif_chan_src_text); WM8994_AIF2_CONTROL_1, 15, aif_chan_src_text);
static const struct soc_enum aif2adcr_src = static SOC_ENUM_SINGLE_DECL(aif2adcr_src,
SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_1, 14, 2, aif_chan_src_text); WM8994_AIF2_CONTROL_1, 14, aif_chan_src_text);
static const struct soc_enum aif1dacl_src = static SOC_ENUM_SINGLE_DECL(aif1dacl_src,
SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, 15, 2, aif_chan_src_text); WM8994_AIF1_CONTROL_2, 15, aif_chan_src_text);
static const struct soc_enum aif1dacr_src = static SOC_ENUM_SINGLE_DECL(aif1dacr_src,
SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, 14, 2, aif_chan_src_text); WM8994_AIF1_CONTROL_2, 14, aif_chan_src_text);
static const struct soc_enum aif2dacl_src = static SOC_ENUM_SINGLE_DECL(aif2dacl_src,
SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, 15, 2, aif_chan_src_text); WM8994_AIF2_CONTROL_2, 15, aif_chan_src_text);
static const struct soc_enum aif2dacr_src = static SOC_ENUM_SINGLE_DECL(aif2dacr_src,
SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, 14, 2, aif_chan_src_text); WM8994_AIF2_CONTROL_2, 14, aif_chan_src_text);
static const char *osr_text[] = { static const char *osr_text[] = {
"Low Power", "High Performance", "Low Power", "High Performance",
}; };
static const struct soc_enum dac_osr = static SOC_ENUM_SINGLE_DECL(dac_osr,
SOC_ENUM_SINGLE(WM8994_OVERSAMPLING, 0, 2, osr_text); WM8994_OVERSAMPLING, 0, osr_text);
static const struct soc_enum adc_osr = static SOC_ENUM_SINGLE_DECL(adc_osr,
SOC_ENUM_SINGLE(WM8994_OVERSAMPLING, 1, 2, osr_text); WM8994_OVERSAMPLING, 1, osr_text);
static const struct snd_kcontrol_new wm8994_snd_controls[] = { static const struct snd_kcontrol_new wm8994_snd_controls[] = {
SOC_DOUBLE_R_TLV("AIF1ADC1 Volume", WM8994_AIF1_ADC1_LEFT_VOLUME, SOC_DOUBLE_R_TLV("AIF1ADC1 Volume", WM8994_AIF1_ADC1_LEFT_VOLUME,
...@@ -690,17 +690,20 @@ static const char *wm8958_ng_text[] = { ...@@ -690,17 +690,20 @@ static const char *wm8958_ng_text[] = {
"30ms", "125ms", "250ms", "500ms", "30ms", "125ms", "250ms", "500ms",
}; };
static const struct soc_enum wm8958_aif1dac1_ng_hold = static SOC_ENUM_SINGLE_DECL(wm8958_aif1dac1_ng_hold,
SOC_ENUM_SINGLE(WM8958_AIF1_DAC1_NOISE_GATE, WM8958_AIF1_DAC1_NOISE_GATE,
WM8958_AIF1DAC1_NG_THR_SHIFT, 4, wm8958_ng_text); WM8958_AIF1DAC1_NG_THR_SHIFT,
wm8958_ng_text);
static const struct soc_enum wm8958_aif1dac2_ng_hold = static SOC_ENUM_SINGLE_DECL(wm8958_aif1dac2_ng_hold,
SOC_ENUM_SINGLE(WM8958_AIF1_DAC2_NOISE_GATE, WM8958_AIF1_DAC2_NOISE_GATE,
WM8958_AIF1DAC2_NG_THR_SHIFT, 4, wm8958_ng_text); WM8958_AIF1DAC2_NG_THR_SHIFT,
wm8958_ng_text);
static const struct soc_enum wm8958_aif2dac_ng_hold = static SOC_ENUM_SINGLE_DECL(wm8958_aif2dac_ng_hold,
SOC_ENUM_SINGLE(WM8958_AIF2_DAC_NOISE_GATE, WM8958_AIF2_DAC_NOISE_GATE,
WM8958_AIF2DAC_NG_THR_SHIFT, 4, wm8958_ng_text); WM8958_AIF2DAC_NG_THR_SHIFT,
wm8958_ng_text);
static const struct snd_kcontrol_new wm8958_snd_controls[] = { static const struct snd_kcontrol_new wm8958_snd_controls[] = {
SOC_SINGLE_TLV("AIF3 Boost Volume", WM8958_AIF3_CONTROL_2, 10, 3, 0, aif_tlv), SOC_SINGLE_TLV("AIF3 Boost Volume", WM8958_AIF3_CONTROL_2, 10, 3, 0, aif_tlv),
...@@ -1341,8 +1344,8 @@ static const char *adc_mux_text[] = { ...@@ -1341,8 +1344,8 @@ static const char *adc_mux_text[] = {
"DMIC", "DMIC",
}; };
static const struct soc_enum adc_enum = static SOC_ENUM_SINGLE_DECL(adc_enum,
SOC_ENUM_SINGLE(0, 0, 2, adc_mux_text); 0, 0, adc_mux_text);
static const struct snd_kcontrol_new adcl_mux = static const struct snd_kcontrol_new adcl_mux =
SOC_DAPM_ENUM_VIRT("ADCL Mux", adc_enum); SOC_DAPM_ENUM_VIRT("ADCL Mux", adc_enum);
...@@ -1478,14 +1481,14 @@ static const char *sidetone_text[] = { ...@@ -1478,14 +1481,14 @@ static const char *sidetone_text[] = {
"ADC/DMIC1", "DMIC2", "ADC/DMIC1", "DMIC2",
}; };
static const struct soc_enum sidetone1_enum = static SOC_ENUM_SINGLE_DECL(sidetone1_enum,
SOC_ENUM_SINGLE(WM8994_SIDETONE, 0, 2, sidetone_text); WM8994_SIDETONE, 0, sidetone_text);
static const struct snd_kcontrol_new sidetone1_mux = static const struct snd_kcontrol_new sidetone1_mux =
SOC_DAPM_ENUM("Left Sidetone Mux", sidetone1_enum); SOC_DAPM_ENUM("Left Sidetone Mux", sidetone1_enum);
static const struct soc_enum sidetone2_enum = static SOC_ENUM_SINGLE_DECL(sidetone2_enum,
SOC_ENUM_SINGLE(WM8994_SIDETONE, 1, 2, sidetone_text); WM8994_SIDETONE, 1, sidetone_text);
static const struct snd_kcontrol_new sidetone2_mux = static const struct snd_kcontrol_new sidetone2_mux =
SOC_DAPM_ENUM("Right Sidetone Mux", sidetone2_enum); SOC_DAPM_ENUM("Right Sidetone Mux", sidetone2_enum);
...@@ -1498,22 +1501,24 @@ static const char *loopback_text[] = { ...@@ -1498,22 +1501,24 @@ static const char *loopback_text[] = {
"None", "ADCDAT", "None", "ADCDAT",
}; };
static const struct soc_enum aif1_loopback_enum = static SOC_ENUM_SINGLE_DECL(aif1_loopback_enum,
SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, WM8994_AIF1_LOOPBACK_SHIFT, 2, WM8994_AIF1_CONTROL_2,
WM8994_AIF1_LOOPBACK_SHIFT,
loopback_text); loopback_text);
static const struct snd_kcontrol_new aif1_loopback = static const struct snd_kcontrol_new aif1_loopback =
SOC_DAPM_ENUM("AIF1 Loopback", aif1_loopback_enum); SOC_DAPM_ENUM("AIF1 Loopback", aif1_loopback_enum);
static const struct soc_enum aif2_loopback_enum = static SOC_ENUM_SINGLE_DECL(aif2_loopback_enum,
SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, WM8994_AIF2_LOOPBACK_SHIFT, 2, WM8994_AIF2_CONTROL_2,
WM8994_AIF2_LOOPBACK_SHIFT,
loopback_text); loopback_text);
static const struct snd_kcontrol_new aif2_loopback = static const struct snd_kcontrol_new aif2_loopback =
SOC_DAPM_ENUM("AIF2 Loopback", aif2_loopback_enum); SOC_DAPM_ENUM("AIF2 Loopback", aif2_loopback_enum);
static const struct soc_enum aif1dac_enum = static SOC_ENUM_SINGLE_DECL(aif1dac_enum,
SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 0, 2, aif1dac_text); WM8994_POWER_MANAGEMENT_6, 0, aif1dac_text);
static const struct snd_kcontrol_new aif1dac_mux = static const struct snd_kcontrol_new aif1dac_mux =
SOC_DAPM_ENUM("AIF1DAC Mux", aif1dac_enum); SOC_DAPM_ENUM("AIF1DAC Mux", aif1dac_enum);
...@@ -1522,8 +1527,8 @@ static const char *aif2dac_text[] = { ...@@ -1522,8 +1527,8 @@ static const char *aif2dac_text[] = {
"AIF2DACDAT", "AIF3DACDAT", "AIF2DACDAT", "AIF3DACDAT",
}; };
static const struct soc_enum aif2dac_enum = static SOC_ENUM_SINGLE_DECL(aif2dac_enum,
SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 1, 2, aif2dac_text); WM8994_POWER_MANAGEMENT_6, 1, aif2dac_text);
static const struct snd_kcontrol_new aif2dac_mux = static const struct snd_kcontrol_new aif2dac_mux =
SOC_DAPM_ENUM("AIF2DAC Mux", aif2dac_enum); SOC_DAPM_ENUM("AIF2DAC Mux", aif2dac_enum);
...@@ -1532,8 +1537,8 @@ static const char *aif2adc_text[] = { ...@@ -1532,8 +1537,8 @@ static const char *aif2adc_text[] = {
"AIF2ADCDAT", "AIF3DACDAT", "AIF2ADCDAT", "AIF3DACDAT",
}; };
static const struct soc_enum aif2adc_enum = static SOC_ENUM_SINGLE_DECL(aif2adc_enum,
SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 2, 2, aif2adc_text); WM8994_POWER_MANAGEMENT_6, 2, aif2adc_text);
static const struct snd_kcontrol_new aif2adc_mux = static const struct snd_kcontrol_new aif2adc_mux =
SOC_DAPM_ENUM("AIF2ADC Mux", aif2adc_enum); SOC_DAPM_ENUM("AIF2ADC Mux", aif2adc_enum);
...@@ -1542,14 +1547,14 @@ static const char *aif3adc_text[] = { ...@@ -1542,14 +1547,14 @@ static const char *aif3adc_text[] = {
"AIF1ADCDAT", "AIF2ADCDAT", "AIF2DACDAT", "Mono PCM", "AIF1ADCDAT", "AIF2ADCDAT", "AIF2DACDAT", "Mono PCM",
}; };
static const struct soc_enum wm8994_aif3adc_enum = static SOC_ENUM_SINGLE_DECL(wm8994_aif3adc_enum,
SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 3, 3, aif3adc_text); WM8994_POWER_MANAGEMENT_6, 3, aif3adc_text);
static const struct snd_kcontrol_new wm8994_aif3adc_mux = static const struct snd_kcontrol_new wm8994_aif3adc_mux =
SOC_DAPM_ENUM("AIF3ADC Mux", wm8994_aif3adc_enum); SOC_DAPM_ENUM("AIF3ADC Mux", wm8994_aif3adc_enum);
static const struct soc_enum wm8958_aif3adc_enum = static SOC_ENUM_SINGLE_DECL(wm8958_aif3adc_enum,
SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 3, 4, aif3adc_text); WM8994_POWER_MANAGEMENT_6, 3, aif3adc_text);
static const struct snd_kcontrol_new wm8958_aif3adc_mux = static const struct snd_kcontrol_new wm8958_aif3adc_mux =
SOC_DAPM_ENUM("AIF3ADC Mux", wm8958_aif3adc_enum); SOC_DAPM_ENUM("AIF3ADC Mux", wm8958_aif3adc_enum);
...@@ -1558,8 +1563,8 @@ static const char *mono_pcm_out_text[] = { ...@@ -1558,8 +1563,8 @@ static const char *mono_pcm_out_text[] = {
"None", "AIF2ADCL", "AIF2ADCR", "None", "AIF2ADCL", "AIF2ADCR",
}; };
static const struct soc_enum mono_pcm_out_enum = static SOC_ENUM_SINGLE_DECL(mono_pcm_out_enum,
SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 9, 3, mono_pcm_out_text); WM8994_POWER_MANAGEMENT_6, 9, mono_pcm_out_text);
static const struct snd_kcontrol_new mono_pcm_out_mux = static const struct snd_kcontrol_new mono_pcm_out_mux =
SOC_DAPM_ENUM("Mono PCM Out Mux", mono_pcm_out_enum); SOC_DAPM_ENUM("Mono PCM Out Mux", mono_pcm_out_enum);
...@@ -1569,14 +1574,14 @@ static const char *aif2dac_src_text[] = { ...@@ -1569,14 +1574,14 @@ static const char *aif2dac_src_text[] = {
}; };
/* Note that these two control shouldn't be simultaneously switched to AIF3 */ /* Note that these two control shouldn't be simultaneously switched to AIF3 */
static const struct soc_enum aif2dacl_src_enum = static SOC_ENUM_SINGLE_DECL(aif2dacl_src_enum,
SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 7, 2, aif2dac_src_text); WM8994_POWER_MANAGEMENT_6, 7, aif2dac_src_text);
static const struct snd_kcontrol_new aif2dacl_src_mux = static const struct snd_kcontrol_new aif2dacl_src_mux =
SOC_DAPM_ENUM("AIF2DACL Mux", aif2dacl_src_enum); SOC_DAPM_ENUM("AIF2DACL Mux", aif2dacl_src_enum);
static const struct soc_enum aif2dacr_src_enum = static SOC_ENUM_SINGLE_DECL(aif2dacr_src_enum,
SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 8, 2, aif2dac_src_text); WM8994_POWER_MANAGEMENT_6, 8, aif2dac_src_text);
static const struct snd_kcontrol_new aif2dacr_src_mux = static const struct snd_kcontrol_new aif2dacr_src_mux =
SOC_DAPM_ENUM("AIF2DACR Mux", aif2dacr_src_enum); SOC_DAPM_ENUM("AIF2DACR Mux", aif2dacr_src_enum);
......
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