Commit deeed338 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'asoc/topic/wm8996', 'asoc/topic/wm9081' and...

Merge remote-tracking branches 'asoc/topic/wm8996', 'asoc/topic/wm9081' and 'asoc/topic/wm9705' into asoc-next
...@@ -311,28 +311,28 @@ static const char *sidetone_hpf_text[] = { ...@@ -311,28 +311,28 @@ static const char *sidetone_hpf_text[] = {
"2.9kHz", "1.5kHz", "735Hz", "403Hz", "196Hz", "98Hz", "49Hz" "2.9kHz", "1.5kHz", "735Hz", "403Hz", "196Hz", "98Hz", "49Hz"
}; };
static const struct soc_enum sidetone_hpf = static SOC_ENUM_SINGLE_DECL(sidetone_hpf,
SOC_ENUM_SINGLE(WM8996_SIDETONE, 7, 7, sidetone_hpf_text); WM8996_SIDETONE, 7, sidetone_hpf_text);
static const char *hpf_mode_text[] = { static const char *hpf_mode_text[] = {
"HiFi", "Custom", "Voice" "HiFi", "Custom", "Voice"
}; };
static const struct soc_enum dsp1tx_hpf_mode = static SOC_ENUM_SINGLE_DECL(dsp1tx_hpf_mode,
SOC_ENUM_SINGLE(WM8996_DSP1_TX_FILTERS, 3, 3, hpf_mode_text); WM8996_DSP1_TX_FILTERS, 3, hpf_mode_text);
static const struct soc_enum dsp2tx_hpf_mode = static SOC_ENUM_SINGLE_DECL(dsp2tx_hpf_mode,
SOC_ENUM_SINGLE(WM8996_DSP2_TX_FILTERS, 3, 3, hpf_mode_text); WM8996_DSP2_TX_FILTERS, 3, hpf_mode_text);
static const char *hpf_cutoff_text[] = { static const char *hpf_cutoff_text[] = {
"50Hz", "75Hz", "100Hz", "150Hz", "200Hz", "300Hz", "400Hz" "50Hz", "75Hz", "100Hz", "150Hz", "200Hz", "300Hz", "400Hz"
}; };
static const struct soc_enum dsp1tx_hpf_cutoff = static SOC_ENUM_SINGLE_DECL(dsp1tx_hpf_cutoff,
SOC_ENUM_SINGLE(WM8996_DSP1_TX_FILTERS, 0, 7, hpf_cutoff_text); WM8996_DSP1_TX_FILTERS, 0, hpf_cutoff_text);
static const struct soc_enum dsp2tx_hpf_cutoff = static SOC_ENUM_SINGLE_DECL(dsp2tx_hpf_cutoff,
SOC_ENUM_SINGLE(WM8996_DSP2_TX_FILTERS, 0, 7, hpf_cutoff_text); WM8996_DSP2_TX_FILTERS, 0, hpf_cutoff_text);
static void wm8996_set_retune_mobile(struct snd_soc_codec *codec, int block) static void wm8996_set_retune_mobile(struct snd_soc_codec *codec, int block)
{ {
...@@ -780,14 +780,14 @@ static const char *sidetone_text[] = { ...@@ -780,14 +780,14 @@ static const char *sidetone_text[] = {
"IN1", "IN2", "IN1", "IN2",
}; };
static const struct soc_enum left_sidetone_enum = static SOC_ENUM_SINGLE_DECL(left_sidetone_enum,
SOC_ENUM_SINGLE(WM8996_SIDETONE, 0, 2, sidetone_text); WM8996_SIDETONE, 0, sidetone_text);
static const struct snd_kcontrol_new left_sidetone = static const struct snd_kcontrol_new left_sidetone =
SOC_DAPM_ENUM("Left Sidetone", left_sidetone_enum); SOC_DAPM_ENUM("Left Sidetone", left_sidetone_enum);
static const struct soc_enum right_sidetone_enum = static SOC_ENUM_SINGLE_DECL(right_sidetone_enum,
SOC_ENUM_SINGLE(WM8996_SIDETONE, 1, 2, sidetone_text); WM8996_SIDETONE, 1, sidetone_text);
static const struct snd_kcontrol_new right_sidetone = static const struct snd_kcontrol_new right_sidetone =
SOC_DAPM_ENUM("Right Sidetone", right_sidetone_enum); SOC_DAPM_ENUM("Right Sidetone", right_sidetone_enum);
...@@ -796,14 +796,14 @@ static const char *spk_text[] = { ...@@ -796,14 +796,14 @@ static const char *spk_text[] = {
"DAC1L", "DAC1R", "DAC2L", "DAC2R" "DAC1L", "DAC1R", "DAC2L", "DAC2R"
}; };
static const struct soc_enum spkl_enum = static SOC_ENUM_SINGLE_DECL(spkl_enum,
SOC_ENUM_SINGLE(WM8996_LEFT_PDM_SPEAKER, 0, 4, spk_text); WM8996_LEFT_PDM_SPEAKER, 0, spk_text);
static const struct snd_kcontrol_new spkl_mux = static const struct snd_kcontrol_new spkl_mux =
SOC_DAPM_ENUM("SPKL", spkl_enum); SOC_DAPM_ENUM("SPKL", spkl_enum);
static const struct soc_enum spkr_enum = static SOC_ENUM_SINGLE_DECL(spkr_enum,
SOC_ENUM_SINGLE(WM8996_RIGHT_PDM_SPEAKER, 0, 4, spk_text); WM8996_RIGHT_PDM_SPEAKER, 0, spk_text);
static const struct snd_kcontrol_new spkr_mux = static const struct snd_kcontrol_new spkr_mux =
SOC_DAPM_ENUM("SPKR", spkr_enum); SOC_DAPM_ENUM("SPKR", spkr_enum);
...@@ -812,8 +812,8 @@ static const char *dsp1rx_text[] = { ...@@ -812,8 +812,8 @@ static const char *dsp1rx_text[] = {
"AIF1", "AIF2" "AIF1", "AIF2"
}; };
static const struct soc_enum dsp1rx_enum = static SOC_ENUM_SINGLE_DECL(dsp1rx_enum,
SOC_ENUM_SINGLE(WM8996_POWER_MANAGEMENT_8, 0, 2, dsp1rx_text); WM8996_POWER_MANAGEMENT_8, 0, dsp1rx_text);
static const struct snd_kcontrol_new dsp1rx = static const struct snd_kcontrol_new dsp1rx =
SOC_DAPM_ENUM("DSP1RX", dsp1rx_enum); SOC_DAPM_ENUM("DSP1RX", dsp1rx_enum);
...@@ -822,8 +822,8 @@ static const char *dsp2rx_text[] = { ...@@ -822,8 +822,8 @@ static const char *dsp2rx_text[] = {
"AIF2", "AIF1" "AIF2", "AIF1"
}; };
static const struct soc_enum dsp2rx_enum = static SOC_ENUM_SINGLE_DECL(dsp2rx_enum,
SOC_ENUM_SINGLE(WM8996_POWER_MANAGEMENT_8, 4, 2, dsp2rx_text); WM8996_POWER_MANAGEMENT_8, 4, dsp2rx_text);
static const struct snd_kcontrol_new dsp2rx = static const struct snd_kcontrol_new dsp2rx =
SOC_DAPM_ENUM("DSP2RX", dsp2rx_enum); SOC_DAPM_ENUM("DSP2RX", dsp2rx_enum);
...@@ -832,8 +832,8 @@ static const char *aif2tx_text[] = { ...@@ -832,8 +832,8 @@ static const char *aif2tx_text[] = {
"DSP2", "DSP1", "AIF1" "DSP2", "DSP1", "AIF1"
}; };
static const struct soc_enum aif2tx_enum = static SOC_ENUM_SINGLE_DECL(aif2tx_enum,
SOC_ENUM_SINGLE(WM8996_POWER_MANAGEMENT_8, 6, 3, aif2tx_text); WM8996_POWER_MANAGEMENT_8, 6, aif2tx_text);
static const struct snd_kcontrol_new aif2tx = static const struct snd_kcontrol_new aif2tx =
SOC_DAPM_ENUM("AIF2TX", aif2tx_enum); SOC_DAPM_ENUM("AIF2TX", aif2tx_enum);
...@@ -842,14 +842,14 @@ static const char *inmux_text[] = { ...@@ -842,14 +842,14 @@ static const char *inmux_text[] = {
"ADC", "DMIC1", "DMIC2" "ADC", "DMIC1", "DMIC2"
}; };
static const struct soc_enum in1_enum = static SOC_ENUM_SINGLE_DECL(in1_enum,
SOC_ENUM_SINGLE(WM8996_POWER_MANAGEMENT_7, 0, 3, inmux_text); WM8996_POWER_MANAGEMENT_7, 0, inmux_text);
static const struct snd_kcontrol_new in1_mux = static const struct snd_kcontrol_new in1_mux =
SOC_DAPM_ENUM("IN1 Mux", in1_enum); SOC_DAPM_ENUM("IN1 Mux", in1_enum);
static const struct soc_enum in2_enum = static SOC_ENUM_SINGLE_DECL(in2_enum,
SOC_ENUM_SINGLE(WM8996_POWER_MANAGEMENT_7, 4, 3, inmux_text); WM8996_POWER_MANAGEMENT_7, 4, inmux_text);
static const struct snd_kcontrol_new in2_mux = static const struct snd_kcontrol_new in2_mux =
SOC_DAPM_ENUM("IN2 Mux", in2_enum); SOC_DAPM_ENUM("IN2 Mux", in2_enum);
...@@ -1608,8 +1608,8 @@ static int wm8996_set_bias_level(struct snd_soc_codec *codec, ...@@ -1608,8 +1608,8 @@ static int wm8996_set_bias_level(struct snd_soc_codec *codec,
msleep(5); msleep(5);
} }
regcache_cache_only(codec->control_data, false); regcache_cache_only(wm8996->regmap, false);
regcache_sync(codec->control_data); regcache_sync(wm8996->regmap);
} }
/* Bypass the MICBIASes for lowest power */ /* Bypass the MICBIASes for lowest power */
...@@ -1620,10 +1620,10 @@ static int wm8996_set_bias_level(struct snd_soc_codec *codec, ...@@ -1620,10 +1620,10 @@ static int wm8996_set_bias_level(struct snd_soc_codec *codec,
break; break;
case SND_SOC_BIAS_OFF: case SND_SOC_BIAS_OFF:
regcache_cache_only(codec->control_data, true); regcache_cache_only(wm8996->regmap, true);
if (wm8996->pdata.ldo_ena >= 0) { if (wm8996->pdata.ldo_ena >= 0) {
gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0); gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0);
regcache_cache_only(codec->control_data, true); regcache_cache_only(wm8996->regmap, true);
} }
regulator_bulk_disable(ARRAY_SIZE(wm8996->supplies), regulator_bulk_disable(ARRAY_SIZE(wm8996->supplies),
wm8996->supplies); wm8996->supplies);
......
...@@ -268,8 +268,7 @@ static const char *drc_high_text[] = { ...@@ -268,8 +268,7 @@ static const char *drc_high_text[] = {
"0", "0",
}; };
static const struct soc_enum drc_high = static SOC_ENUM_SINGLE_DECL(drc_high, WM9081_DRC_3, 3, drc_high_text);
SOC_ENUM_SINGLE(WM9081_DRC_3, 3, 6, drc_high_text);
static const char *drc_low_text[] = { static const char *drc_low_text[] = {
"1", "1",
...@@ -279,8 +278,7 @@ static const char *drc_low_text[] = { ...@@ -279,8 +278,7 @@ static const char *drc_low_text[] = {
"0", "0",
}; };
static const struct soc_enum drc_low = static SOC_ENUM_SINGLE_DECL(drc_low, WM9081_DRC_3, 0, drc_low_text);
SOC_ENUM_SINGLE(WM9081_DRC_3, 0, 5, drc_low_text);
static const char *drc_atk_text[] = { static const char *drc_atk_text[] = {
"181us", "181us",
...@@ -297,8 +295,7 @@ static const char *drc_atk_text[] = { ...@@ -297,8 +295,7 @@ static const char *drc_atk_text[] = {
"185.6ms", "185.6ms",
}; };
static const struct soc_enum drc_atk = static SOC_ENUM_SINGLE_DECL(drc_atk, WM9081_DRC_2, 12, drc_atk_text);
SOC_ENUM_SINGLE(WM9081_DRC_2, 12, 12, drc_atk_text);
static const char *drc_dcy_text[] = { static const char *drc_dcy_text[] = {
"186ms", "186ms",
...@@ -312,8 +309,7 @@ static const char *drc_dcy_text[] = { ...@@ -312,8 +309,7 @@ static const char *drc_dcy_text[] = {
"47.56s", "47.56s",
}; };
static const struct soc_enum drc_dcy = static SOC_ENUM_SINGLE_DECL(drc_dcy, WM9081_DRC_2, 8, drc_dcy_text);
SOC_ENUM_SINGLE(WM9081_DRC_2, 8, 9, drc_dcy_text);
static const char *drc_qr_dcy_text[] = { static const char *drc_qr_dcy_text[] = {
"0.725ms", "0.725ms",
...@@ -321,8 +317,7 @@ static const char *drc_qr_dcy_text[] = { ...@@ -321,8 +317,7 @@ static const char *drc_qr_dcy_text[] = {
"5.8ms", "5.8ms",
}; };
static const struct soc_enum drc_qr_dcy = static SOC_ENUM_SINGLE_DECL(drc_qr_dcy, WM9081_DRC_2, 4, drc_qr_dcy_text);
SOC_ENUM_SINGLE(WM9081_DRC_2, 4, 3, drc_qr_dcy_text);
static const char *dac_deemph_text[] = { static const char *dac_deemph_text[] = {
"None", "None",
...@@ -331,16 +326,16 @@ static const char *dac_deemph_text[] = { ...@@ -331,16 +326,16 @@ static const char *dac_deemph_text[] = {
"48kHz", "48kHz",
}; };
static const struct soc_enum dac_deemph = static SOC_ENUM_SINGLE_DECL(dac_deemph, WM9081_DAC_DIGITAL_2, 1,
SOC_ENUM_SINGLE(WM9081_DAC_DIGITAL_2, 1, 4, dac_deemph_text); dac_deemph_text);
static const char *speaker_mode_text[] = { static const char *speaker_mode_text[] = {
"Class D", "Class D",
"Class AB", "Class AB",
}; };
static const struct soc_enum speaker_mode = static SOC_ENUM_SINGLE_DECL(speaker_mode, WM9081_ANALOGUE_SPEAKER_2, 6,
SOC_ENUM_SINGLE(WM9081_ANALOGUE_SPEAKER_2, 6, 2, speaker_mode_text); speaker_mode_text);
static int speaker_mode_get(struct snd_kcontrol *kcontrol, static int speaker_mode_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
......
...@@ -67,12 +67,12 @@ static const char *wm9705_mic[] = {"Mic 1", "Mic 2"}; ...@@ -67,12 +67,12 @@ static const char *wm9705_mic[] = {"Mic 1", "Mic 2"};
static const char *wm9705_rec_sel[] = {"Mic", "CD", "NC", "NC", static const char *wm9705_rec_sel[] = {"Mic", "CD", "NC", "NC",
"Line", "Stereo Mix", "Mono Mix", "Phone"}; "Line", "Stereo Mix", "Mono Mix", "Phone"};
static const struct soc_enum wm9705_enum_mic = static SOC_ENUM_SINGLE_DECL(wm9705_enum_mic,
SOC_ENUM_SINGLE(AC97_GENERAL_PURPOSE, 8, 2, wm9705_mic); AC97_GENERAL_PURPOSE, 8, wm9705_mic);
static const struct soc_enum wm9705_enum_rec_l = static SOC_ENUM_SINGLE_DECL(wm9705_enum_rec_l,
SOC_ENUM_SINGLE(AC97_REC_SEL, 8, 8, wm9705_rec_sel); AC97_REC_SEL, 8, wm9705_rec_sel);
static const struct soc_enum wm9705_enum_rec_r = static SOC_ENUM_SINGLE_DECL(wm9705_enum_rec_r,
SOC_ENUM_SINGLE(AC97_REC_SEL, 0, 8, wm9705_rec_sel); AC97_REC_SEL, 0, wm9705_rec_sel);
/* Headphone Mixer */ /* Headphone Mixer */
static const struct snd_kcontrol_new wm9705_hp_mixer_controls[] = { static const struct snd_kcontrol_new wm9705_hp_mixer_controls[] = {
......
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