aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-03-23 08:07:47 -0400
committerTakashi Iwai <tiwai@suse.de>2009-03-23 08:08:33 -0400
commit1327a32b878b5ed2113c63557b6f4f949f821857 (patch)
tree25b47d63e8cc68840134120fc49e4fa499f54569 /sound/pci/hda/patch_sigmatel.c
parent52ca15b7c0c711eb37f5e4b769e8488e5c516d43 (diff)
ALSA: hda - Cache pin-cap values
Added snd_hda_query_pin_caps() to read and cache pin-cap values to avoid too frequently issuing the same verbs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 4da72403fc87..b1c180a9e9be 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -2537,8 +2537,7 @@ static int stac92xx_build_pcms(struct hda_codec *codec)
2537 2537
2538static unsigned int stac92xx_get_vref(struct hda_codec *codec, hda_nid_t nid) 2538static unsigned int stac92xx_get_vref(struct hda_codec *codec, hda_nid_t nid)
2539{ 2539{
2540 unsigned int pincap = snd_hda_param_read(codec, nid, 2540 unsigned int pincap = snd_hda_query_pin_caps(codec, nid);
2541 AC_PAR_PIN_CAP);
2542 pincap = (pincap & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT; 2541 pincap = (pincap & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT;
2543 if (pincap & AC_PINCAP_VREF_100) 2542 if (pincap & AC_PINCAP_VREF_100)
2544 return AC_PINCTL_VREF_100; 2543 return AC_PINCTL_VREF_100;
@@ -2799,7 +2798,7 @@ static hda_nid_t check_line_out_switch(struct hda_codec *codec)
2799 if (cfg->line_out_type != AUTO_PIN_LINE_OUT) 2798 if (cfg->line_out_type != AUTO_PIN_LINE_OUT)
2800 return 0; 2799 return 0;
2801 nid = cfg->input_pins[AUTO_PIN_LINE]; 2800 nid = cfg->input_pins[AUTO_PIN_LINE];
2802 pincap = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); 2801 pincap = snd_hda_query_pin_caps(codec, nid);
2803 if (pincap & AC_PINCAP_OUT) 2802 if (pincap & AC_PINCAP_OUT)
2804 return nid; 2803 return nid;
2805 return 0; 2804 return 0;
@@ -2822,7 +2821,7 @@ static hda_nid_t check_mic_out_switch(struct hda_codec *codec)
2822 /* some laptops have an internal analog microphone 2821 /* some laptops have an internal analog microphone
2823 * which can't be used as a output */ 2822 * which can't be used as a output */
2824 if (get_defcfg_connect(def_conf) != AC_JACK_PORT_FIXED) { 2823 if (get_defcfg_connect(def_conf) != AC_JACK_PORT_FIXED) {
2825 pincap = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); 2824 pincap = snd_hda_query_pin_caps(codec, nid);
2826 if (pincap & AC_PINCAP_OUT) 2825 if (pincap & AC_PINCAP_OUT)
2827 return nid; 2826 return nid;
2828 } 2827 }