aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_via.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-09-11 09:35:22 -0400
committerTakashi Iwai <tiwai@suse.de>2014-09-16 11:25:01 -0400
commit7c3008c47b405420bf2b24fb5a21af3df5b5c323 (patch)
treef08dff791e2be3773c07836a4e4a86c44335c6ff /sound/pci/hda/patch_via.c
parentaa699c492e77ec01a038e8a8add6ce04011b9561 (diff)
ALSA: hda - Remove superfluous hooks from VIA driver
Like the previous fix for STAC/IDT codecs, the automute hooks in VIA driver can be also removed by enabling the power control callback for all pins. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_via.c')
-rw-r--r--sound/pci/hda/patch_via.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 8d234ab9f06b..6c206b6c8d65 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -118,7 +118,6 @@ static void via_playback_pcm_hook(struct hda_pcm_stream *hinfo,
118 struct hda_codec *codec, 118 struct hda_codec *codec,
119 struct snd_pcm_substream *substream, 119 struct snd_pcm_substream *substream,
120 int action); 120 int action);
121static void via_hp_automute(struct hda_codec *codec, struct hda_jack_callback *tbl);
122 121
123static struct via_spec *via_new_spec(struct hda_codec *codec) 122static struct via_spec *via_new_spec(struct hda_codec *codec)
124{ 123{
@@ -575,20 +574,6 @@ static const struct snd_kcontrol_new vt1708_jack_detect_ctl[] = {
575 {} /* terminator */ 574 {} /* terminator */
576}; 575};
577 576
578static void via_hp_automute(struct hda_codec *codec,
579 struct hda_jack_callback *tbl)
580{
581 set_widgets_power_state(codec);
582 snd_hda_gen_hp_automute(codec, tbl);
583}
584
585static void via_line_automute(struct hda_codec *codec,
586 struct hda_jack_callback *tbl)
587{
588 set_widgets_power_state(codec);
589 snd_hda_gen_line_automute(codec, tbl);
590}
591
592static void via_jack_powerstate_event(struct hda_codec *codec, 577static void via_jack_powerstate_event(struct hda_codec *codec,
593 struct hda_jack_callback *tbl) 578 struct hda_jack_callback *tbl)
594{ 579{
@@ -602,22 +587,16 @@ static void via_set_jack_unsol_events(struct hda_codec *codec)
602 hda_nid_t pin; 587 hda_nid_t pin;
603 int i; 588 int i;
604 589
605 spec->gen.hp_automute_hook = via_hp_automute;
606 if (cfg->speaker_pins[0])
607 spec->gen.line_automute_hook = via_line_automute;
608
609 for (i = 0; i < cfg->line_outs; i++) { 590 for (i = 0; i < cfg->line_outs; i++) {
610 pin = cfg->line_out_pins[i]; 591 pin = cfg->line_out_pins[i];
611 if (pin && !snd_hda_jack_tbl_get(codec, pin) && 592 if (pin && is_jack_detectable(codec, pin))
612 is_jack_detectable(codec, pin))
613 snd_hda_jack_detect_enable_callback(codec, pin, 593 snd_hda_jack_detect_enable_callback(codec, pin,
614 via_jack_powerstate_event); 594 via_jack_powerstate_event);
615 } 595 }
616 596
617 for (i = 0; i < cfg->num_inputs; i++) { 597 for (i = 0; i < cfg->num_inputs; i++) {
618 pin = cfg->line_out_pins[i]; 598 pin = cfg->line_out_pins[i];
619 if (pin && !snd_hda_jack_tbl_get(codec, pin) && 599 if (pin && is_jack_detectable(codec, pin))
620 is_jack_detectable(codec, pin))
621 snd_hda_jack_detect_enable_callback(codec, pin, 600 snd_hda_jack_detect_enable_callback(codec, pin,
622 via_jack_powerstate_event); 601 via_jack_powerstate_event);
623 } 602 }