+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
+static void alc260_ hp_3012_ automute( struct hda_codec *codec) codec_read( codec, 0x10, 0, GET_PIN_ SENSE, 0) & AC_PINSENSE_ PRESENCE; codec_write( codec, 0x0f, 0, AC_VERB_ SET_PIN_ WIDGET_ CONTROL, codec_write( codec, 0x11, 0, AC_VERB_ SET_PIN_ WIDGET_ CONTROL, codec_write( codec, 0x15, 0, AC_VERB_ SET_PIN_ WIDGET_ CONTROL,
+{
+ unsigned int present, bits;
+
+ present = snd_hda_
+ AC_VERB_
+
+ bits = present ? 0 : PIN_OUT;
+ snd_hda_
+ bits);
+ snd_hda_
+ bits);
+ snd_hda_
+ 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/Documentat ion/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 exec_pin_ sense), PARM=0x0 get_pin_ sense), PARM=0x0 set_pin_ ctl), PARM=0x0 set_pin_ ctl), PARM=0x0
send: NID=0x10, VERB=0x709(
receive: 0x0
send: NID=0x10, VERB=0xf09(
receive: 0x80000000
send: NID=0x11, VERB=0x707(
send: NID=0x15, VERB=0x707(