Comment 6 for bug 1294830

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

+static void alc260_hp_3012_automute(struct hda_codec *codec)
+{
+ unsigned int present, bits;
+
+ present = snd_hda_codec_read(codec, 0x10, 0,
+ AC_VERB_GET_PIN_SENSE, 0) & AC_PINSENSE_PRESENCE;
+
+ bits = present ? 0 : PIN_OUT;
+ snd_hda_codec_write(codec, 0x0f, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
+ bits);
+ snd_hda_codec_write(codec, 0x11, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
+ bits);
+ snd_hda_codec_write(codec, 0x15, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
+ bits);
+}
+

Node 0x10 [Pin Complex] wcaps 0x40018d: Stereo Amp-Out
  Control: name="Headphone Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Control: name="Front Headphone Jack", index=0, device=0
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals: [0x00 0x00]
  Pincap 0x0001003f: IN OUT HP EAPD Detect Trigger ImpSense
  EAPD 0x2: EAPD
  Pin Default 0x0221101f: [Jack] HP Out at Ext Front
    Conn = 1/8, Color = Black
    DefAssociation = 0x1, Sequence = 0xf
  Pin-ctls: 0xc0: OUT HP
  Unsolicited: tag=01, enabled=1
  Connection: 1
     0x09

seem alc260 support Trigger and ImpSense

https://bugzilla.kernel.org/show_bug.cgi?id=66621#c39

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/Documentation/sound/alsa/HD-Audio.txt

the difference is it only use AC_VERB_GET_PIN_SENSE to detect the presence of the headphone in the previous version but

try add hint

trigger_sense = 0

using hda-emu, the current version send (exec_pin_sense) before (get_pin_sense)

 jack 0x10 1
send: NID=0x10, VERB=0x709(exec_pin_sense), PARM=0x0
receive: 0x0
send: NID=0x10, VERB=0xf09(get_pin_sense), PARM=0x0
receive: 0x80000000
send: NID=0x11, VERB=0x707(set_pin_ctl), PARM=0x0
send: NID=0x15, VERB=0x707(set_pin_ctl), PARM=0x0