Merge "asoc: codecs: wcd938x: Remove hifi modes for wcd9380"

This commit is contained in:
qctecmdr 2019-07-24 00:38:14 -07:00 • committed by Gerrit - the friendly Code Review server
commit 2bb74b807e

View file

@ -1935,11 +1935,19 @@ static int wcd938x_rx_hph_mode_put(struct snd_kcontrol *kcontrol,
dev_dbg(component->dev, "%s: mode: %d\n", __func__, mode_val);
if (mode_val == 0) {
if (wcd938x->variant == WCD9380) {
if (mode_val == CLS_H_HIFI || mode_val == CLS_AB_HIFI) {
dev_info(component->dev,
"%s:Invalid HPH Mode, default to CLS_H_ULP\n",
__func__);
mode_val = CLS_H_ULP;
}
}
if (mode_val == CLS_H_NORMAL) {
dev_info(component->dev,
"%s:Invalid HPH Mode, default to class_AB\n",
__func__);
mode_val = 3; /* enum will be updated later */
mode_val = CLS_H_ULP;
}
wcd938x->hph_mode = mode_val;
return 0;
@ -2000,6 +2008,16 @@ static const struct soc_enum tx_mode_mux_enum =
SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(tx_mode_mux_text),
tx_mode_mux_text);
static const char * const rx_hph_mode_mux_text_wcd9380[] = {
"CLS_H_INVALID", "CLS_H_INVALID_1", "CLS_H_LP", "CLS_AB",
"CLS_H_LOHIFI", "CLS_H_ULP", "CLS_H_INVALID_2", "CLS_AB_LP",
"CLS_AB_LOHIFI",
};
static const struct soc_enum rx_hph_mode_mux_enum_wcd9380 =
SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(rx_hph_mode_mux_text_wcd9380),
rx_hph_mode_mux_text_wcd9380);
static const char * const rx_hph_mode_mux_text[] = {
"CLS_H_INVALID", "CLS_H_HIFI", "CLS_H_LP", "CLS_AB", "CLS_H_LOHIFI",
"CLS_H_ULP", "CLS_AB_HIFI", "CLS_AB_LP", "CLS_AB_LOHIFI",
@ -2010,6 +2028,9 @@ static const struct soc_enum rx_hph_mode_mux_enum =
rx_hph_mode_mux_text);
static const struct snd_kcontrol_new wcd9380_snd_controls[] = {
SOC_ENUM_EXT("RX HPH Mode", rx_hph_mode_mux_enum_wcd9380,
wcd938x_rx_hph_mode_get, wcd938x_rx_hph_mode_put),
SOC_ENUM_EXT("TX0 MODE", tx_mode_mux_enum_wcd9380,
wcd938x_tx_mode_get, wcd938x_tx_mode_put),
SOC_ENUM_EXT("TX1 MODE", tx_mode_mux_enum_wcd9380,
@ -2021,6 +2042,9 @@ static const struct snd_kcontrol_new wcd9380_snd_controls[] = {
};
static const struct snd_kcontrol_new wcd9385_snd_controls[] = {
SOC_ENUM_EXT("RX HPH Mode", rx_hph_mode_mux_enum,
wcd938x_rx_hph_mode_get, wcd938x_rx_hph_mode_put),
SOC_ENUM_EXT("TX0 MODE", tx_mode_mux_enum,
wcd938x_tx_mode_get, wcd938x_tx_mode_put),
SOC_ENUM_EXT("TX1 MODE", tx_mode_mux_enum,
@ -2032,9 +2056,6 @@ static const struct snd_kcontrol_new wcd9385_snd_controls[] = {
};
static const struct snd_kcontrol_new wcd938x_snd_controls[] = {
SOC_ENUM_EXT("RX HPH Mode", rx_hph_mode_mux_enum,
wcd938x_rx_hph_mode_get, wcd938x_rx_hph_mode_put),
SOC_SINGLE_EXT("HPHL_COMP Switch", SND_SOC_NOPM, 0, 1, 0,
wcd938x_get_compander, wcd938x_set_compander),
SOC_SINGLE_EXT("HPHR_COMP Switch", SND_SOC_NOPM, 1, 1, 0,