diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-12-19 09:16:44 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-01-12 02:31:01 -0500 |
commit | 5d550e15be0a960c7ff5dbcf12b5a454e70403b6 (patch) | |
tree | f9b70b25a2588cf6b2d908a1d1f57cf056f14ea8 /sound/pci/hda/hda_generic.c | |
parent | 36502d020030665bcfc558767cbb0ddf87b9892f (diff) |
ALSA: hda - Export standard jack event handlers for generic parser
These handlers are supposed to be called externally from the codec
drivers once when they need to handle own jack events.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_generic.c')
-rw-r--r-- | sound/pci/hda/hda_generic.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 364ec06071ae..6914d70df09a 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c | |||
@@ -2414,7 +2414,7 @@ static void do_automute(struct hda_codec *codec, int num_pins, hda_nid_t *pins, | |||
2414 | } | 2414 | } |
2415 | 2415 | ||
2416 | /* Toggle outputs muting */ | 2416 | /* Toggle outputs muting */ |
2417 | static void update_outputs(struct hda_codec *codec) | 2417 | void snd_hda_gen_update_outputs(struct hda_codec *codec) |
2418 | { | 2418 | { |
2419 | struct hda_gen_spec *spec = codec->spec; | 2419 | struct hda_gen_spec *spec = codec->spec; |
2420 | int on; | 2420 | int on; |
@@ -2448,6 +2448,7 @@ static void update_outputs(struct hda_codec *codec) | |||
2448 | do_automute(codec, ARRAY_SIZE(spec->autocfg.line_out_pins), | 2448 | do_automute(codec, ARRAY_SIZE(spec->autocfg.line_out_pins), |
2449 | spec->autocfg.line_out_pins, on, false); | 2449 | spec->autocfg.line_out_pins, on, false); |
2450 | } | 2450 | } |
2451 | EXPORT_SYMBOL_HDA(snd_hda_gen_update_outputs); | ||
2451 | 2452 | ||
2452 | static void call_update_outputs(struct hda_codec *codec) | 2453 | static void call_update_outputs(struct hda_codec *codec) |
2453 | { | 2454 | { |
@@ -2455,11 +2456,11 @@ static void call_update_outputs(struct hda_codec *codec) | |||
2455 | if (spec->automute_hook) | 2456 | if (spec->automute_hook) |
2456 | spec->automute_hook(codec); | 2457 | spec->automute_hook(codec); |
2457 | else | 2458 | else |
2458 | update_outputs(codec); | 2459 | snd_hda_gen_update_outputs(codec); |
2459 | } | 2460 | } |
2460 | 2461 | ||
2461 | /* standard HP-automute helper */ | 2462 | /* standard HP-automute helper */ |
2462 | static void hp_automute(struct hda_codec *codec, struct hda_jack_tbl *jack) | 2463 | void snd_hda_gen_hp_automute(struct hda_codec *codec, struct hda_jack_tbl *jack) |
2463 | { | 2464 | { |
2464 | struct hda_gen_spec *spec = codec->spec; | 2465 | struct hda_gen_spec *spec = codec->spec; |
2465 | 2466 | ||
@@ -2470,9 +2471,10 @@ static void hp_automute(struct hda_codec *codec, struct hda_jack_tbl *jack) | |||
2470 | return; | 2471 | return; |
2471 | call_update_outputs(codec); | 2472 | call_update_outputs(codec); |
2472 | } | 2473 | } |
2474 | EXPORT_SYMBOL_HDA(snd_hda_gen_hp_automute); | ||
2473 | 2475 | ||
2474 | /* standard line-out-automute helper */ | 2476 | /* standard line-out-automute helper */ |
2475 | static void line_automute(struct hda_codec *codec, struct hda_jack_tbl *jack) | 2477 | void snd_hda_gen_line_automute(struct hda_codec *codec, struct hda_jack_tbl *jack) |
2476 | { | 2478 | { |
2477 | struct hda_gen_spec *spec = codec->spec; | 2479 | struct hda_gen_spec *spec = codec->spec; |
2478 | 2480 | ||
@@ -2489,9 +2491,10 @@ static void line_automute(struct hda_codec *codec, struct hda_jack_tbl *jack) | |||
2489 | return; | 2491 | return; |
2490 | call_update_outputs(codec); | 2492 | call_update_outputs(codec); |
2491 | } | 2493 | } |
2494 | EXPORT_SYMBOL_HDA(snd_hda_gen_line_automute); | ||
2492 | 2495 | ||
2493 | /* standard mic auto-switch helper */ | 2496 | /* standard mic auto-switch helper */ |
2494 | static void mic_autoswitch(struct hda_codec *codec, struct hda_jack_tbl *jack) | 2497 | void snd_hda_gen_mic_autoswitch(struct hda_codec *codec, struct hda_jack_tbl *jack) |
2495 | { | 2498 | { |
2496 | struct hda_gen_spec *spec = codec->spec; | 2499 | struct hda_gen_spec *spec = codec->spec; |
2497 | int i; | 2500 | int i; |
@@ -2507,6 +2510,7 @@ static void mic_autoswitch(struct hda_codec *codec, struct hda_jack_tbl *jack) | |||
2507 | } | 2510 | } |
2508 | mux_select(codec, 0, spec->am_entry[0].idx); | 2511 | mux_select(codec, 0, spec->am_entry[0].idx); |
2509 | } | 2512 | } |
2513 | EXPORT_SYMBOL_HDA(snd_hda_gen_mic_autoswitch); | ||
2510 | 2514 | ||
2511 | /* | 2515 | /* |
2512 | * Auto-Mute mode mixer enum support | 2516 | * Auto-Mute mode mixer enum support |
@@ -2639,7 +2643,7 @@ static int check_auto_mute_availability(struct hda_codec *codec) | |||
2639 | snd_printdd("hda-codec: Enable HP auto-muting on NID 0x%x\n", | 2643 | snd_printdd("hda-codec: Enable HP auto-muting on NID 0x%x\n", |
2640 | nid); | 2644 | nid); |
2641 | snd_hda_jack_detect_enable_callback(codec, nid, HDA_GEN_HP_EVENT, | 2645 | snd_hda_jack_detect_enable_callback(codec, nid, HDA_GEN_HP_EVENT, |
2642 | hp_automute); | 2646 | snd_hda_gen_hp_automute); |
2643 | spec->detect_hp = 1; | 2647 | spec->detect_hp = 1; |
2644 | } | 2648 | } |
2645 | 2649 | ||
@@ -2652,7 +2656,7 @@ static int check_auto_mute_availability(struct hda_codec *codec) | |||
2652 | snd_printdd("hda-codec: Enable Line-Out auto-muting on NID 0x%x\n", nid); | 2656 | snd_printdd("hda-codec: Enable Line-Out auto-muting on NID 0x%x\n", nid); |
2653 | snd_hda_jack_detect_enable_callback(codec, nid, | 2657 | snd_hda_jack_detect_enable_callback(codec, nid, |
2654 | HDA_GEN_FRONT_EVENT, | 2658 | HDA_GEN_FRONT_EVENT, |
2655 | line_automute); | 2659 | snd_hda_gen_line_automute); |
2656 | spec->detect_lo = 1; | 2660 | spec->detect_lo = 1; |
2657 | } | 2661 | } |
2658 | spec->automute_lo_possible = spec->detect_hp; | 2662 | spec->automute_lo_possible = spec->detect_hp; |
@@ -2704,7 +2708,7 @@ static bool auto_mic_check_imux(struct hda_codec *codec) | |||
2704 | snd_hda_jack_detect_enable_callback(codec, | 2708 | snd_hda_jack_detect_enable_callback(codec, |
2705 | spec->am_entry[i].pin, | 2709 | spec->am_entry[i].pin, |
2706 | HDA_GEN_MIC_EVENT, | 2710 | HDA_GEN_MIC_EVENT, |
2707 | mic_autoswitch); | 2711 | snd_hda_gen_mic_autoswitch); |
2708 | return true; | 2712 | return true; |
2709 | } | 2713 | } |
2710 | 2714 | ||
@@ -3536,9 +3540,9 @@ int snd_hda_gen_init(struct hda_codec *codec) | |||
3536 | init_digital(codec); | 3540 | init_digital(codec); |
3537 | 3541 | ||
3538 | /* call init functions of standard auto-mute helpers */ | 3542 | /* call init functions of standard auto-mute helpers */ |
3539 | hp_automute(codec, NULL); | 3543 | snd_hda_gen_hp_automute(codec, NULL); |
3540 | line_automute(codec, NULL); | 3544 | snd_hda_gen_line_automute(codec, NULL); |
3541 | mic_autoswitch(codec, NULL); | 3545 | snd_hda_gen_mic_autoswitch(codec, NULL); |
3542 | 3546 | ||
3543 | if (spec->vmaster_mute.sw_kctl && spec->vmaster_mute.hook) | 3547 | if (spec->vmaster_mute.sw_kctl && spec->vmaster_mute.hook) |
3544 | snd_hda_sync_vmaster_hook(&spec->vmaster_mute); | 3548 | snd_hda_sync_vmaster_hook(&spec->vmaster_mute); |