snd_hda_gen_remove(codec);
}
-static void cx_process_headset_plugin(struct hda_codec *codec)
+static void cx_process_headset_detect_plug_type(struct hda_codec *codec)
{
unsigned int val;
unsigned int count = 0;
* Check hp&mic tag to process headset plugin & plugout.
*/
mic_present = snd_hda_codec_read(codec, 0x19, 0, AC_VERB_GET_PIN_SENSE, 0x0);
- if (!(mic_present & AC_PINSENSE_PRESENCE)) /* mic plugout */
+ if (!(mic_present & AC_PINSENSE_PRESENCE)) { /* mic plugout */
snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20);
- else
- cx_process_headset_plugin(codec);
+ } else {
+ cx_process_headset_detect_plug_type(codec);
+ snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24);
+ }
}
static int cx_suspend(struct hda_codec *codec)