Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248465
b: refs/heads/master
c: da33986
h: refs/heads/master
i:
  248463: 3c2e19c
v: v3
  • Loading branch information
Takashi Iwai committed May 13, 2011
1 parent ba74219 commit d3225cd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2557f7427d4bd1fc00166556e3047c5f3ed91958
refs/heads/master: da33986651e137b1ea2ec21794e32bc5c57b03d0
25 changes: 17 additions & 8 deletions trunk/sound/pci/hda/patch_conexant.c
Original file line number Diff line number Diff line change
Expand Up @@ -3325,6 +3325,9 @@ static void cx_auto_parse_output(struct hda_codec *codec)
spec->vmaster_nid = spec->private_dac_nids[0];
}

static void cx_auto_turn_eapd(struct hda_codec *codec, int num_pins,
hda_nid_t *pins, bool on);

/* auto-mute/unmute speaker and line outs according to headphone jack */
static void cx_auto_hp_automute(struct hda_codec *codec)
{
Expand All @@ -3341,11 +3344,13 @@ static void cx_auto_hp_automute(struct hda_codec *codec)
break;
}
}
cx_auto_turn_eapd(codec, cfg->hp_outs, cfg->hp_pins, present);
for (i = 0; i < cfg->line_outs; i++) {
snd_hda_codec_write(codec, cfg->line_out_pins[i], 0,
AC_VERB_SET_PIN_WIDGET_CONTROL,
present ? 0 : PIN_OUT);
}
cx_auto_turn_eapd(codec, cfg->line_outs, cfg->line_out_pins, !present);
for (i = 0; !present && i < cfg->line_outs; i++)
if (snd_hda_jack_detect(codec, cfg->line_out_pins[i]))
present = 1;
Expand All @@ -3354,6 +3359,7 @@ static void cx_auto_hp_automute(struct hda_codec *codec)
AC_VERB_SET_PIN_WIDGET_CONTROL,
present ? 0 : PIN_OUT);
}
cx_auto_turn_eapd(codec, cfg->speaker_outs, cfg->speaker_pins, !present);
}

/* automatic switch internal and external mic */
Expand Down Expand Up @@ -3517,14 +3523,15 @@ static int cx_auto_parse_auto_config(struct hda_codec *codec)
return 0;
}

static void cx_auto_turn_on_eapd(struct hda_codec *codec, int num_pins,
hda_nid_t *pins)
static void cx_auto_turn_eapd(struct hda_codec *codec, int num_pins,
hda_nid_t *pins, bool on)
{
int i;
for (i = 0; i < num_pins; i++) {
if (snd_hda_query_pin_caps(codec, pins[i]) & AC_PINCAP_EAPD)
snd_hda_codec_write(codec, pins[i], 0,
AC_VERB_SET_EAPD_BTLENABLE, 0x02);
AC_VERB_SET_EAPD_BTLENABLE,
on ? 0x02 : 0);
}
}

Expand Down Expand Up @@ -3565,6 +3572,13 @@ static void cx_auto_init_output(struct hda_codec *codec)
for (i = 0; i < cfg->speaker_outs; i++)
snd_hda_codec_write(codec, cfg->speaker_pins[i], 0,
AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
/* turn on EAPD */
cx_auto_turn_eapd(codec, cfg->line_outs, cfg->line_out_pins,
true);
cx_auto_turn_eapd(codec, cfg->hp_outs, cfg->hp_pins,
true);
cx_auto_turn_eapd(codec, cfg->speaker_outs, cfg->speaker_pins,
true);
}

for (i = 0; i < spec->dac_info_filled; i++) {
Expand All @@ -3573,11 +3587,6 @@ static void cx_auto_init_output(struct hda_codec *codec)
nid = spec->multiout.dac_nids[0];
select_connection(codec, spec->dac_info[i].pin, nid);
}

/* turn on EAPD */
cx_auto_turn_on_eapd(codec, cfg->line_outs, cfg->line_out_pins);
cx_auto_turn_on_eapd(codec, cfg->hp_outs, cfg->hp_pins);
cx_auto_turn_on_eapd(codec, cfg->speaker_outs, cfg->speaker_pins);
}

static void cx_auto_init_input(struct hda_codec *codec)
Expand Down

0 comments on commit d3225cd

Please sign in to comment.