Comment 8 for bug 1487702

Revision history for this message
Raymond (superquad-vortex2) wrote :

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/patch/sound/pci/hda?id=b016951e897b5bd06abfb732012f67b461fb1e2e

if none of those headset model work, you have to compile the driver in debug mode since only the debug version show headset type

static void alc_determine_headset_type(struct hda_codec *codec)
{
 int val;
 bool is_ctia = false;
 struct alc_spec *spec = codec->spec;

 switch (codec->core.vendor_id) {

 case 0x10ec0233:
 case 0x10ec0283:
  alc_write_coef_idx(codec, 0x45, 0xd029);
  msleep(300);
  val = alc_read_coef_idx(codec, 0x46);
  is_ctia = (val & 0x0070) == 0x0070;
  break;

 }

 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
      is_ctia ? "yes" : "no");
 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
}