thr driver assume headset use the first hp_pins
hp_pin = spec->gen.autocfg.hp_pins[0];
you must verify that the jack with headset icon is node 0x15
which headphone playback volume affect that jack,
index=0 or index=1
static void alc_update_headset_mode(struct hda_codec *codec) +{ + struct alc_spec *spec = codec->spec; + + hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]]; + hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; + + int new_headset_mode; + + if (!snd_hda_jack_detect(codec, hp_pin)) + new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; + else if (mux_pin == spec->headset_mic_pin) + new_headset_mode = ALC_HEADSET_MODE_HEADSET; + else if (mux_pin == spec->headphone_mic_pin) + new_headset_mode = ALC_HEADSET_MODE_MIC; + else + new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; + + if (new_headset_mode == spec->current_headset_mode) + return; + + switch (new_headset_mode) { + case ALC_HEADSET_MODE_UNPLUGGED: + alc_headset_mode_unplugged(codec); + spec->gen.hp_jack_present = false; + break; + case ALC_HEADSET_MODE_HEADSET: + if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) + alc_determine_headset_type(codec); + if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) + alc_headset_mode_ctia(codec); + else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) + alc_headset_mode_omtp(codec); + spec->gen.hp_jack_present = true; + break; + case ALC_HEADSET_MODE_MIC: + alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); + spec->gen.hp_jack_present = false; + break; + case ALC_HEADSET_MODE_HEADPHONE: + alc_headset_mode_default(codec); + spec->gen.hp_jack_present = true; + break; + }
thr driver assume headset use the first hp_pins
hp_pin = spec->gen. autocfg. hp_pins[ 0];
you must verify that the jack with headset icon is node 0x15
which headphone playback volume affect that jack,
index=0 or index=1
static void alc_update_ headset_ mode(struct hda_codec *codec) imux_pins[ spec->gen. cur_mux[ 0]]; autocfg. hp_pins[ 0]; jack_detect( codec, hp_pin)) MODE_UNPLUGGED; mic_pin) MODE_HEADSET; _mic_pin) MODE_MIC; MODE_HEADPHONE; headset_ mode) MODE_UNPLUGGED: mode_unplugged( codec); hp_jack_ present = false; MODE_HEADSET: current_ headset_ type == ALC_HEADSET_ TYPE_UNKNOWN) headset_ type(codec) ; current_ headset_ type == ALC_HEADSET_ TYPE_CTIA) mode_ctia( codec); current_ headset_ type == ALC_HEADSET_ TYPE_OMTP) mode_omtp( codec); hp_jack_ present = true; MODE_MIC: mode_mic_ in(codec, hp_pin, spec->headphone _mic_pin) ; hp_jack_ present = false; MODE_HEADPHONE: mode_default( codec); hp_jack_ present = true;
+{
+ struct alc_spec *spec = codec->spec;
+
+ hda_nid_t mux_pin = spec->gen.
+ hda_nid_t hp_pin = spec->gen.
+
+ int new_headset_mode;
+
+ if (!snd_hda_
+ new_headset_mode = ALC_HEADSET_
+ else if (mux_pin == spec->headset_
+ new_headset_mode = ALC_HEADSET_
+ else if (mux_pin == spec->headphone
+ new_headset_mode = ALC_HEADSET_
+ else
+ new_headset_mode = ALC_HEADSET_
+
+ if (new_headset_mode == spec->current_
+ return;
+
+ switch (new_headset_mode) {
+ case ALC_HEADSET_
+ alc_headset_
+ spec->gen.
+ break;
+ case ALC_HEADSET_
+ if (spec->
+ alc_determine_
+ if (spec->
+ alc_headset_
+ else if (spec->
+ alc_headset_
+ spec->gen.
+ break;
+ case ALC_HEADSET_
+ alc_headset_
+ spec->gen.
+ break;
+ case ALC_HEADSET_
+ alc_headset_
+ spec->gen.
+ break;
+ }