Commit 14bafe32 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Use cached calls to get widget caps and pin caps

Replace with the standard function calls to use caches for reading
the widget caps and pin caps.

hda_proc.c is still using the direct verbs to get raw values as
much as possible.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent a23b688f
...@@ -2321,8 +2321,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, ...@@ -2321,8 +2321,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
* don't power down the widget if it controls * don't power down the widget if it controls
* eapd and EAPD_BTLENABLE is set. * eapd and EAPD_BTLENABLE is set.
*/ */
pincap = snd_hda_param_read(codec, nid, pincap = snd_hda_query_pin_caps(codec, nid);
AC_PAR_PIN_CAP);
if (pincap & AC_PINCAP_EAPD) { if (pincap & AC_PINCAP_EAPD) {
int eapd = snd_hda_codec_read(codec, int eapd = snd_hda_codec_read(codec,
nid, 0, nid, 0,
......
...@@ -2869,8 +2869,7 @@ static hda_nid_t get_unassigned_dac(struct hda_codec *codec, hda_nid_t nid) ...@@ -2869,8 +2869,7 @@ static hda_nid_t get_unassigned_dac(struct hda_codec *codec, hda_nid_t nid)
conn_len = snd_hda_get_connections(codec, nid, conn, conn_len = snd_hda_get_connections(codec, nid, conn,
HDA_MAX_CONNECTIONS); HDA_MAX_CONNECTIONS);
for (j = 0; j < conn_len; j++) { for (j = 0; j < conn_len; j++) {
wcaps = snd_hda_param_read(codec, conn[j], wcaps = get_wcaps(codec, conn[j]);
AC_PAR_AUDIO_WIDGET_CAP);
wtype = (wcaps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; wtype = (wcaps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
/* we check only analog outputs */ /* we check only analog outputs */
if (wtype != AC_WID_AUD_OUT || (wcaps & AC_WCAP_DIGITAL)) if (wtype != AC_WID_AUD_OUT || (wcaps & AC_WCAP_DIGITAL))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment