diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-09-11 09:29:18 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-09-16 11:25:01 -0400 |
commit | aa699c492e77ec01a038e8a8add6ce04011b9561 (patch) | |
tree | 8ec8348732c73dad6d8e82b23a0349fd926729d6 /sound/pci | |
parent | 1a4f69d5aaecb39a980fc20b14ec800fd5b53061 (diff) |
ALSA: hda - Remove superfluous callbacks from STAC/IDT codecs
Now we can register multiple callbacks to each jack, most of hooks
used in STAC/IDT codecs can be removed by enabling the powermap update
callback for all relevant pins. Along with this, the call of
stac_init_power_map() can be moved back to stac_parse_auto_config()
and the own build_controls callback can be removed, too.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 3193529607f2..4f6413e01c13 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -510,27 +510,6 @@ static void jack_update_power(struct hda_codec *codec, | |||
510 | spec->power_map_bits); | 510 | spec->power_map_bits); |
511 | } | 511 | } |
512 | 512 | ||
513 | static void stac_hp_automute(struct hda_codec *codec, | ||
514 | struct hda_jack_callback *jack) | ||
515 | { | ||
516 | snd_hda_gen_hp_automute(codec, jack); | ||
517 | jack_update_power(codec, jack); | ||
518 | } | ||
519 | |||
520 | static void stac_line_automute(struct hda_codec *codec, | ||
521 | struct hda_jack_callback *jack) | ||
522 | { | ||
523 | snd_hda_gen_line_automute(codec, jack); | ||
524 | jack_update_power(codec, jack); | ||
525 | } | ||
526 | |||
527 | static void stac_mic_autoswitch(struct hda_codec *codec, | ||
528 | struct hda_jack_callback *jack) | ||
529 | { | ||
530 | snd_hda_gen_mic_autoswitch(codec, jack); | ||
531 | jack_update_power(codec, jack); | ||
532 | } | ||
533 | |||
534 | static void stac_vref_event(struct hda_codec *codec, | 513 | static void stac_vref_event(struct hda_codec *codec, |
535 | struct hda_jack_callback *event) | 514 | struct hda_jack_callback *event) |
536 | { | 515 | { |
@@ -555,8 +534,6 @@ static void stac_init_power_map(struct hda_codec *codec) | |||
555 | hda_nid_t nid = spec->pwr_nids[i]; | 534 | hda_nid_t nid = spec->pwr_nids[i]; |
556 | unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid); | 535 | unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid); |
557 | def_conf = get_defcfg_connect(def_conf); | 536 | def_conf = get_defcfg_connect(def_conf); |
558 | if (snd_hda_jack_tbl_get(codec, nid)) | ||
559 | continue; | ||
560 | if (def_conf == AC_JACK_PORT_COMPLEX && | 537 | if (def_conf == AC_JACK_PORT_COMPLEX && |
561 | spec->vref_mute_led_nid != nid && | 538 | spec->vref_mute_led_nid != nid && |
562 | is_jack_detectable(codec, nid)) { | 539 | is_jack_detectable(codec, nid)) { |
@@ -4206,9 +4183,6 @@ static int stac_parse_auto_config(struct hda_codec *codec) | |||
4206 | spec->gen.pcm_capture_hook = stac_capture_pcm_hook; | 4183 | spec->gen.pcm_capture_hook = stac_capture_pcm_hook; |
4207 | 4184 | ||
4208 | spec->gen.automute_hook = stac_update_outputs; | 4185 | spec->gen.automute_hook = stac_update_outputs; |
4209 | spec->gen.hp_automute_hook = stac_hp_automute; | ||
4210 | spec->gen.line_automute_hook = stac_line_automute; | ||
4211 | spec->gen.mic_autoswitch_hook = stac_mic_autoswitch; | ||
4212 | 4186 | ||
4213 | err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); | 4187 | err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); |
4214 | if (err < 0) | 4188 | if (err < 0) |
@@ -4260,16 +4234,8 @@ static int stac_parse_auto_config(struct hda_codec *codec) | |||
4260 | return err; | 4234 | return err; |
4261 | } | 4235 | } |
4262 | 4236 | ||
4263 | return 0; | ||
4264 | } | ||
4265 | |||
4266 | static int stac_build_controls(struct hda_codec *codec) | ||
4267 | { | ||
4268 | int err = snd_hda_gen_build_controls(codec); | ||
4269 | |||
4270 | if (err < 0) | ||
4271 | return err; | ||
4272 | stac_init_power_map(codec); | 4237 | stac_init_power_map(codec); |
4238 | |||
4273 | return 0; | 4239 | return 0; |
4274 | } | 4240 | } |
4275 | 4241 | ||
@@ -4383,7 +4349,7 @@ static int stac_suspend(struct hda_codec *codec) | |||
4383 | #endif /* CONFIG_PM */ | 4349 | #endif /* CONFIG_PM */ |
4384 | 4350 | ||
4385 | static const struct hda_codec_ops stac_patch_ops = { | 4351 | static const struct hda_codec_ops stac_patch_ops = { |
4386 | .build_controls = stac_build_controls, | 4352 | .build_controls = snd_hda_gen_build_controls, |
4387 | .build_pcms = snd_hda_gen_build_pcms, | 4353 | .build_pcms = snd_hda_gen_build_pcms, |
4388 | .init = stac_init, | 4354 | .init = stac_init, |
4389 | .free = stac_free, | 4355 | .free = stac_free, |