Commit ae8a9a11 authored by Clément Guedez's avatar Clément Guedez Committed by Takashi Iwai

ALSA: ice1724: ESI W192M: Add text Line in/Mic for selecting input gain state

Add text Line in/Mic for selecting input gain state in mixer for ESI W192M.
Signed-off-by: default avatarClément Guedez <klem.dev@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 16ddbe73
...@@ -339,8 +339,14 @@ static int stac9460_adc_vol_put(struct snd_kcontrol *kcontrol, ...@@ -339,8 +339,14 @@ static int stac9460_adc_vol_put(struct snd_kcontrol *kcontrol,
/* /*
* MIC / LINE switch fonction * MIC / LINE switch fonction
*/ */
static int stac9460_mic_sw_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
static const char * const texts[2] = { "Line In", "Mic" };
return snd_ctl_enum_info(uinfo, 1, 2, texts);
}
#define stac9460_mic_sw_info snd_ctl_boolean_mono_info
static int stac9460_mic_sw_get(struct snd_kcontrol *kcontrol, static int stac9460_mic_sw_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
...@@ -354,7 +360,7 @@ static int stac9460_mic_sw_get(struct snd_kcontrol *kcontrol, ...@@ -354,7 +360,7 @@ static int stac9460_mic_sw_get(struct snd_kcontrol *kcontrol,
val = stac9460_get(ice, STAC946X_GENERAL_PURPOSE); val = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
else else
val = stac9460_2_get(ice, STAC946X_GENERAL_PURPOSE); val = stac9460_2_get(ice, STAC946X_GENERAL_PURPOSE);
ucontrol->value.integer.value[0] = ~val>>7 & 0x1; ucontrol->value.enumerated.item[0] = (val >> 7) & 0x1;
return 0; return 0;
} }
...@@ -370,7 +376,7 @@ static int stac9460_mic_sw_put(struct snd_kcontrol *kcontrol, ...@@ -370,7 +376,7 @@ static int stac9460_mic_sw_put(struct snd_kcontrol *kcontrol,
old = stac9460_get(ice, STAC946X_GENERAL_PURPOSE); old = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
else else
old = stac9460_2_get(ice, STAC946X_GENERAL_PURPOSE); old = stac9460_2_get(ice, STAC946X_GENERAL_PURPOSE);
new = (~ucontrol->value.integer.value[0] << 7 & 0x80) | (old & ~0x80); new = (ucontrol->value.enumerated.item[0] << 7 & 0x80) | (old & ~0x80);
change = (new != old); change = (new != old);
if (change) { if (change) {
if (id == 0) if (id == 0)
...@@ -411,7 +417,7 @@ static struct snd_kcontrol_new stac9640_controls[] = { ...@@ -411,7 +417,7 @@ static struct snd_kcontrol_new stac9640_controls[] = {
}, },
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "MIC/Line switch", .name = "MIC/Line Input Enum",
.count = 2, .count = 2,
.info = stac9460_mic_sw_info, .info = stac9460_mic_sw_info,
.get = stac9460_mic_sw_get, .get = stac9460_mic_sw_get,
......
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