diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-07-11 09:42:52 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-07-12 01:45:01 -0400 |
commit | 9e7717c9eb9da8dba98f36dd3c390a45375499b3 (patch) | |
tree | 0462962bd0a95cc706b3e1db0ded45a52126ba2e | |
parent | b2f934a0dffd4153e9447ee9e0090e357a3d8b3b (diff) |
ALSA: hda - Always read raw connections for proc output
In the codec proc outputs, read the raw connections instead of the
cached connection list, i.e. proc files contain only raw values.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/hda_codec.c | 20 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_proc.c | 2 |
3 files changed, 17 insertions, 7 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index d0deab1ed510..25b90eec915a 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -308,9 +308,6 @@ int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid, | |||
308 | } | 308 | } |
309 | EXPORT_SYMBOL_HDA(snd_hda_get_sub_nodes); | 309 | EXPORT_SYMBOL_HDA(snd_hda_get_sub_nodes); |
310 | 310 | ||
311 | static int _hda_get_connections(struct hda_codec *codec, hda_nid_t nid, | ||
312 | hda_nid_t *conn_list, int max_conns); | ||
313 | |||
314 | /* look up the cached results */ | 311 | /* look up the cached results */ |
315 | static hda_nid_t *lookup_conn_list(struct snd_array *array, hda_nid_t nid) | 312 | static hda_nid_t *lookup_conn_list(struct snd_array *array, hda_nid_t nid) |
316 | { | 313 | { |
@@ -357,7 +354,7 @@ int snd_hda_get_conn_list(struct hda_codec *codec, hda_nid_t nid, | |||
357 | return -EINVAL; | 354 | return -EINVAL; |
358 | 355 | ||
359 | /* read the connection and add to the cache */ | 356 | /* read the connection and add to the cache */ |
360 | len = _hda_get_connections(codec, nid, list, HDA_MAX_CONNECTIONS); | 357 | len = snd_hda_get_raw_connections(codec, nid, list, HDA_MAX_CONNECTIONS); |
361 | if (len < 0) | 358 | if (len < 0) |
362 | return len; | 359 | return len; |
363 | err = snd_hda_override_conn_list(codec, nid, len, list); | 360 | err = snd_hda_override_conn_list(codec, nid, len, list); |
@@ -399,8 +396,19 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid, | |||
399 | } | 396 | } |
400 | EXPORT_SYMBOL_HDA(snd_hda_get_connections); | 397 | EXPORT_SYMBOL_HDA(snd_hda_get_connections); |
401 | 398 | ||
402 | static int _hda_get_connections(struct hda_codec *codec, hda_nid_t nid, | 399 | /** |
403 | hda_nid_t *conn_list, int max_conns) | 400 | * snd_hda_get_raw_connections - copy connection list without cache |
401 | * @codec: the HDA codec | ||
402 | * @nid: NID to parse | ||
403 | * @conn_list: connection list array | ||
404 | * @max_conns: max. number of connections to store | ||
405 | * | ||
406 | * Like snd_hda_get_connections(), copy the connection list but without | ||
407 | * checking through the connection-list cache. | ||
408 | * Currently called only from hda_proc.c, so not exported. | ||
409 | */ | ||
410 | int snd_hda_get_raw_connections(struct hda_codec *codec, hda_nid_t nid, | ||
411 | hda_nid_t *conn_list, int max_conns) | ||
404 | { | 412 | { |
405 | unsigned int parm; | 413 | unsigned int parm; |
406 | int i, conn_len, conns; | 414 | int i, conn_len, conns; |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index e6bc16f66bce..f465e07a4879 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -903,6 +903,8 @@ int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid, | |||
903 | hda_nid_t *start_id); | 903 | hda_nid_t *start_id); |
904 | int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid, | 904 | int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid, |
905 | hda_nid_t *conn_list, int max_conns); | 905 | hda_nid_t *conn_list, int max_conns); |
906 | int snd_hda_get_raw_connections(struct hda_codec *codec, hda_nid_t nid, | ||
907 | hda_nid_t *conn_list, int max_conns); | ||
906 | int snd_hda_get_conn_list(struct hda_codec *codec, hda_nid_t nid, | 908 | int snd_hda_get_conn_list(struct hda_codec *codec, hda_nid_t nid, |
907 | const hda_nid_t **listp); | 909 | const hda_nid_t **listp); |
908 | int snd_hda_override_conn_list(struct hda_codec *codec, hda_nid_t nid, int nums, | 910 | int snd_hda_override_conn_list(struct hda_codec *codec, hda_nid_t nid, int nums, |
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index bfe74c2fb079..2be57b051aa2 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c | |||
@@ -636,7 +636,7 @@ static void print_codec_info(struct snd_info_entry *entry, | |||
636 | wid_caps |= AC_WCAP_CONN_LIST; | 636 | wid_caps |= AC_WCAP_CONN_LIST; |
637 | 637 | ||
638 | if (wid_caps & AC_WCAP_CONN_LIST) | 638 | if (wid_caps & AC_WCAP_CONN_LIST) |
639 | conn_len = snd_hda_get_connections(codec, nid, conn, | 639 | conn_len = snd_hda_get_raw_connections(codec, nid, conn, |
640 | HDA_MAX_CONNECTIONS); | 640 | HDA_MAX_CONNECTIONS); |
641 | 641 | ||
642 | if (wid_caps & AC_WCAP_IN_AMP) { | 642 | if (wid_caps & AC_WCAP_IN_AMP) { |