Commit 196c1766 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Manage using output/loopback path indices

Instead of search for the path with the certain route at each time,
keep the path index for each output and loopback, and just use it when
referred.

In this implementation, the path index number begins with one, not
zero (although I've been writing in C over decades).  It's just to
make the check for uninitialized values easier.

So far, the input paths aren't handled with indices yet, but still
picked up via snd_hda_get_nid_path() at each time.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 05453b7e
This diff is collapsed.
...@@ -130,6 +130,13 @@ struct hda_gen_spec { ...@@ -130,6 +130,13 @@ struct hda_gen_spec {
/* path list */ /* path list */
struct snd_array paths; struct snd_array paths;
/* path indices */
int out_paths[AUTO_CFG_MAX_OUTS];
int hp_paths[AUTO_CFG_MAX_OUTS];
int speaker_paths[AUTO_CFG_MAX_OUTS];
int digout_paths[AUTO_CFG_MAX_OUTS];
int loopback_paths[HDA_MAX_NUM_INPUTS];
/* auto-mic stuff */ /* auto-mic stuff */
int am_num_entries; int am_num_entries;
struct automic_entry am_entry[MAX_AUTO_MIC_PINS]; struct automic_entry am_entry[MAX_AUTO_MIC_PINS];
...@@ -198,6 +205,8 @@ int snd_hda_gen_init(struct hda_codec *codec); ...@@ -198,6 +205,8 @@ int snd_hda_gen_init(struct hda_codec *codec);
struct nid_path *snd_hda_get_nid_path(struct hda_codec *codec, struct nid_path *snd_hda_get_nid_path(struct hda_codec *codec,
hda_nid_t from_nid, hda_nid_t to_nid); hda_nid_t from_nid, hda_nid_t to_nid);
int snd_hda_get_path_idx(struct hda_codec *codec, struct nid_path *path);
struct nid_path *snd_hda_get_path_from_idx(struct hda_codec *codec, int idx);
enum { enum {
HDA_PARSE_NO_AAMIX, HDA_PARSE_NO_AAMIX,
......
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