diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-03-23 08:07:47 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-03-23 08:08:33 -0400 |
commit | 1327a32b878b5ed2113c63557b6f4f949f821857 (patch) | |
tree | 25b47d63e8cc68840134120fc49e4fa499f54569 /sound/pci/hda/patch_realtek.c | |
parent | 52ca15b7c0c711eb37f5e4b769e8488e5c516d43 (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_realtek.c')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 965a531d2fba..bf7e64e2c468 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -770,7 +770,7 @@ static void alc_set_input_pin(struct hda_codec *codec, hda_nid_t nid, | |||
770 | 770 | ||
771 | if (auto_pin_type <= AUTO_PIN_FRONT_MIC) { | 771 | if (auto_pin_type <= AUTO_PIN_FRONT_MIC) { |
772 | unsigned int pincap; | 772 | unsigned int pincap; |
773 | pincap = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); | 773 | pincap = snd_hda_query_pin_caps(codec, nid); |
774 | pincap = (pincap & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT; | 774 | pincap = (pincap & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT; |
775 | if (pincap & AC_PINCAP_VREF_80) | 775 | if (pincap & AC_PINCAP_VREF_80) |
776 | val = PIN_VREF80; | 776 | val = PIN_VREF80; |
@@ -16746,13 +16746,13 @@ static int alc662_input_pin_idx(struct hda_codec *codec, hda_nid_t nid, | |||
16746 | 16746 | ||
16747 | static int alc662_is_input_pin(struct hda_codec *codec, hda_nid_t nid) | 16747 | static int alc662_is_input_pin(struct hda_codec *codec, hda_nid_t nid) |
16748 | { | 16748 | { |
16749 | unsigned int pincap = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); | 16749 | unsigned int pincap = snd_hda_query_pin_caps(codec, nid); |
16750 | return (pincap & AC_PINCAP_IN) != 0; | 16750 | return (pincap & AC_PINCAP_IN) != 0; |
16751 | } | 16751 | } |
16752 | 16752 | ||
16753 | static int alc662_is_output_pin(struct hda_codec *codec, hda_nid_t nid) | 16753 | static int alc662_is_output_pin(struct hda_codec *codec, hda_nid_t nid) |
16754 | { | 16754 | { |
16755 | unsigned int pincap = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); | 16755 | unsigned int pincap = snd_hda_query_pin_caps(codec, nid); |
16756 | return (pincap & AC_PINCAP_OUT) != 0; | 16756 | return (pincap & AC_PINCAP_OUT) != 0; |
16757 | } | 16757 | } |
16758 | 16758 | ||