aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-12-20 09:38:40 -0500
committerTakashi Iwai <tiwai@suse.de>2013-01-12 02:34:20 -0500
commit7594aa33963eb4a795ca346ec6d7c0dfaa2485a2 (patch)
tree5e2a7938ae35847d00edfef45243245abf24eebe
parentd5a9f1bb38354ef4786d7fd761d75594bc33f7d2 (diff)
ALSA: hda - Use cached version for changing pins in hda_generic.c
There is no reason to avoid snd_hda_set_pin_ctl_cache() there. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/hda_generic.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 46b00e0756c5..f4b5043a3176 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -1572,11 +1572,12 @@ static void update_shared_mic_hp(struct hda_codec *codec, bool set_as_mic)
1572 const hda_nid_t vref_pin = spec->shared_mic_vref_pin; 1572 const hda_nid_t vref_pin = spec->shared_mic_vref_pin;
1573 unsigned int vref_val = snd_hda_get_default_vref(codec, vref_pin); 1573 unsigned int vref_val = snd_hda_get_default_vref(codec, vref_pin);
1574 if (vref_val != AC_PINCTL_VREF_HIZ) 1574 if (vref_val != AC_PINCTL_VREF_HIZ)
1575 snd_hda_set_pin_ctl(codec, vref_pin, PIN_IN | (set_as_mic ? vref_val : 0)); 1575 snd_hda_set_pin_ctl_cache(codec, vref_pin,
1576 PIN_IN | (set_as_mic ? vref_val : 0));
1576 } 1577 }
1577 1578
1578 val = set_as_mic ? val | PIN_IN : PIN_HP; 1579 val = set_as_mic ? val | PIN_IN : PIN_HP;
1579 snd_hda_set_pin_ctl(codec, pin, val); 1580 snd_hda_set_pin_ctl_cache(codec, pin, val);
1580 1581
1581 spec->automute_speaker = !set_as_mic; 1582 spec->automute_speaker = !set_as_mic;
1582 call_update_outputs(codec); 1583 call_update_outputs(codec);
@@ -2431,7 +2432,7 @@ static void do_automute(struct hda_codec *codec, int num_pins, hda_nid_t *pins,
2431 } else 2432 } else
2432 val = 0; 2433 val = 0;
2433 val |= pin_bits; 2434 val |= pin_bits;
2434 snd_hda_set_pin_ctl(codec, nid, val); 2435 snd_hda_set_pin_ctl_cache(codec, nid, val);
2435 set_pin_eapd(codec, nid, !mute); 2436 set_pin_eapd(codec, nid, !mute);
2436 } 2437 }
2437} 2438}
@@ -3467,7 +3468,7 @@ static void set_input_pin(struct hda_codec *codec, hda_nid_t nid,
3467 unsigned int val = PIN_IN; 3468 unsigned int val = PIN_IN;
3468 if (auto_pin_type == AUTO_PIN_MIC) 3469 if (auto_pin_type == AUTO_PIN_MIC)
3469 val |= snd_hda_get_default_vref(codec, nid); 3470 val |= snd_hda_get_default_vref(codec, nid);
3470 snd_hda_set_pin_ctl(codec, nid, val); 3471 snd_hda_set_pin_ctl_cache(codec, nid, val);
3471} 3472}
3472 3473
3473/* set up input pins and loopback paths */ 3474/* set up input pins and loopback paths */
@@ -3541,7 +3542,7 @@ static void init_digital(struct hda_codec *codec)
3541 } 3542 }
3542 pin = spec->autocfg.dig_in_pin; 3543 pin = spec->autocfg.dig_in_pin;
3543 if (pin) 3544 if (pin)
3544 snd_hda_set_pin_ctl(codec, pin, PIN_IN); 3545 snd_hda_set_pin_ctl_cache(codec, pin, PIN_IN);
3545} 3546}
3546 3547
3547/* clear unsol-event tags on unused pins; Conexant codecs seem to leave 3548/* clear unsol-event tags on unused pins; Conexant codecs seem to leave