From 1327a32b878b5ed2113c63557b6f4f949f821857 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 23 Mar 2009 13:07:47 +0100 Subject: 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 --- sound/pci/hda/patch_sigmatel.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sound/pci/hda/patch_sigmatel.c') 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) static unsigned int stac92xx_get_vref(struct hda_codec *codec, hda_nid_t nid) { - unsigned int pincap = snd_hda_param_read(codec, nid, - AC_PAR_PIN_CAP); + unsigned int pincap = snd_hda_query_pin_caps(codec, nid); pincap = (pincap & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT; if (pincap & AC_PINCAP_VREF_100) return AC_PINCTL_VREF_100; @@ -2799,7 +2798,7 @@ static hda_nid_t check_line_out_switch(struct hda_codec *codec) if (cfg->line_out_type != AUTO_PIN_LINE_OUT) return 0; nid = cfg->input_pins[AUTO_PIN_LINE]; - pincap = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); + pincap = snd_hda_query_pin_caps(codec, nid); if (pincap & AC_PINCAP_OUT) return nid; return 0; @@ -2822,7 +2821,7 @@ static hda_nid_t check_mic_out_switch(struct hda_codec *codec) /* some laptops have an internal analog microphone * which can't be used as a output */ if (get_defcfg_connect(def_conf) != AC_JACK_PORT_FIXED) { - pincap = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); + pincap = snd_hda_query_pin_caps(codec, nid); if (pincap & AC_PINCAP_OUT) return nid; } -- cgit v1.2.3-55-g7522