Commit aa699c492e77ec01a038e8a8add6ce04011b9561

Authored by Takashi Iwai
1 parent 1a4f69d5aa

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>

Showing 1 changed file with 2 additions and 36 deletions Side-by-side Diff

sound/pci/hda/patch_sigmatel.c
... ... @@ -510,27 +510,6 @@
510 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 513 static void stac_vref_event(struct hda_codec *codec,
535 514 struct hda_jack_callback *event)
536 515 {
... ... @@ -555,8 +534,6 @@
555 534 hda_nid_t nid = spec->pwr_nids[i];
556 535 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid);
557 536 def_conf = get_defcfg_connect(def_conf);
558   - if (snd_hda_jack_tbl_get(codec, nid))
559   - continue;
560 537 if (def_conf == AC_JACK_PORT_COMPLEX &&
561 538 spec->vref_mute_led_nid != nid &&
562 539 is_jack_detectable(codec, nid)) {
... ... @@ -4206,9 +4183,6 @@
4206 4183 spec->gen.pcm_capture_hook = stac_capture_pcm_hook;
4207 4184  
4208 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 4187 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
4214 4188 if (err < 0)
4215 4189  
... ... @@ -4260,16 +4234,8 @@
4260 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 4237 stac_init_power_map(codec);
  4238 +
4273 4239 return 0;
4274 4240 }
4275 4241  
... ... @@ -4383,7 +4349,7 @@
4383 4349 #endif /* CONFIG_PM */
4384 4350  
4385 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 4353 .build_pcms = snd_hda_gen_build_pcms,
4388 4354 .init = stac_init,
4389 4355 .free = stac_free,