Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353046
b: refs/heads/master
c: 5d550e1
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Jan 12, 2013
1 parent b57ec43 commit 216a4c0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 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: 36502d020030665bcfc558767cbb0ddf87b9892f
refs/heads/master: 5d550e15be0a960c7ff5dbcf12b5a454e70403b6
26 changes: 15 additions & 11 deletions trunk/sound/pci/hda/hda_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2414,7 +2414,7 @@ static void do_automute(struct hda_codec *codec, int num_pins, hda_nid_t *pins,
}

/* Toggle outputs muting */
static void update_outputs(struct hda_codec *codec)
void snd_hda_gen_update_outputs(struct hda_codec *codec)
{
struct hda_gen_spec *spec = codec->spec;
int on;
Expand Down Expand Up @@ -2448,18 +2448,19 @@ static void update_outputs(struct hda_codec *codec)
do_automute(codec, ARRAY_SIZE(spec->autocfg.line_out_pins),
spec->autocfg.line_out_pins, on, false);
}
EXPORT_SYMBOL_HDA(snd_hda_gen_update_outputs);

static void call_update_outputs(struct hda_codec *codec)
{
struct hda_gen_spec *spec = codec->spec;
if (spec->automute_hook)
spec->automute_hook(codec);
else
update_outputs(codec);
snd_hda_gen_update_outputs(codec);
}

/* standard HP-automute helper */
static void hp_automute(struct hda_codec *codec, struct hda_jack_tbl *jack)
void snd_hda_gen_hp_automute(struct hda_codec *codec, struct hda_jack_tbl *jack)
{
struct hda_gen_spec *spec = codec->spec;

Expand All @@ -2470,9 +2471,10 @@ static void hp_automute(struct hda_codec *codec, struct hda_jack_tbl *jack)
return;
call_update_outputs(codec);
}
EXPORT_SYMBOL_HDA(snd_hda_gen_hp_automute);

/* standard line-out-automute helper */
static void line_automute(struct hda_codec *codec, struct hda_jack_tbl *jack)
void snd_hda_gen_line_automute(struct hda_codec *codec, struct hda_jack_tbl *jack)
{
struct hda_gen_spec *spec = codec->spec;

Expand All @@ -2489,9 +2491,10 @@ static void line_automute(struct hda_codec *codec, struct hda_jack_tbl *jack)
return;
call_update_outputs(codec);
}
EXPORT_SYMBOL_HDA(snd_hda_gen_line_automute);

/* standard mic auto-switch helper */
static void mic_autoswitch(struct hda_codec *codec, struct hda_jack_tbl *jack)
void snd_hda_gen_mic_autoswitch(struct hda_codec *codec, struct hda_jack_tbl *jack)
{
struct hda_gen_spec *spec = codec->spec;
int i;
Expand All @@ -2507,6 +2510,7 @@ static void mic_autoswitch(struct hda_codec *codec, struct hda_jack_tbl *jack)
}
mux_select(codec, 0, spec->am_entry[0].idx);
}
EXPORT_SYMBOL_HDA(snd_hda_gen_mic_autoswitch);

/*
* Auto-Mute mode mixer enum support
Expand Down Expand Up @@ -2639,7 +2643,7 @@ static int check_auto_mute_availability(struct hda_codec *codec)
snd_printdd("hda-codec: Enable HP auto-muting on NID 0x%x\n",
nid);
snd_hda_jack_detect_enable_callback(codec, nid, HDA_GEN_HP_EVENT,
hp_automute);
snd_hda_gen_hp_automute);
spec->detect_hp = 1;
}

Expand All @@ -2652,7 +2656,7 @@ static int check_auto_mute_availability(struct hda_codec *codec)
snd_printdd("hda-codec: Enable Line-Out auto-muting on NID 0x%x\n", nid);
snd_hda_jack_detect_enable_callback(codec, nid,
HDA_GEN_FRONT_EVENT,
line_automute);
snd_hda_gen_line_automute);
spec->detect_lo = 1;
}
spec->automute_lo_possible = spec->detect_hp;
Expand Down Expand Up @@ -2704,7 +2708,7 @@ static bool auto_mic_check_imux(struct hda_codec *codec)
snd_hda_jack_detect_enable_callback(codec,
spec->am_entry[i].pin,
HDA_GEN_MIC_EVENT,
mic_autoswitch);
snd_hda_gen_mic_autoswitch);
return true;
}

Expand Down Expand Up @@ -3536,9 +3540,9 @@ int snd_hda_gen_init(struct hda_codec *codec)
init_digital(codec);

/* call init functions of standard auto-mute helpers */
hp_automute(codec, NULL);
line_automute(codec, NULL);
mic_autoswitch(codec, NULL);
snd_hda_gen_hp_automute(codec, NULL);
snd_hda_gen_line_automute(codec, NULL);
snd_hda_gen_mic_autoswitch(codec, NULL);

if (spec->vmaster_mute.sw_kctl && spec->vmaster_mute.hook)
snd_hda_sync_vmaster_hook(&spec->vmaster_mute);
Expand Down
9 changes: 9 additions & 0 deletions trunk/sound/pci/hda/hda_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,13 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec,
int snd_hda_gen_build_controls(struct hda_codec *codec);
int snd_hda_gen_build_pcms(struct hda_codec *codec);

/* standard jack event callbacks */
void snd_hda_gen_hp_automute(struct hda_codec *codec,
struct hda_jack_tbl *jack);
void snd_hda_gen_line_automute(struct hda_codec *codec,
struct hda_jack_tbl *jack);
void snd_hda_gen_mic_autoswitch(struct hda_codec *codec,
struct hda_jack_tbl *jack);
void snd_hda_gen_update_outputs(struct hda_codec *codec);

#endif /* __SOUND_HDA_GENERIC_H */

0 comments on commit 216a4c0

Please sign in to comment.