Loading sound/pci/hda/hda_generic.c +24 −7 Original line number Diff line number Diff line Loading @@ -116,11 +116,9 @@ EXPORT_SYMBOL_HDA(snd_hda_gen_spec_free); * parsing paths */ /* get the path between the given NIDs; * passing 0 to either @pin or @dac behaves as a wildcard */ struct nid_path *snd_hda_get_nid_path(struct hda_codec *codec, hda_nid_t from_nid, hda_nid_t to_nid) static struct nid_path *get_nid_path(struct hda_codec *codec, hda_nid_t from_nid, hda_nid_t to_nid, int with_aa_mix) { struct hda_gen_spec *spec = codec->spec; int i; Loading @@ -130,11 +128,23 @@ struct nid_path *snd_hda_get_nid_path(struct hda_codec *codec, if (path->depth <= 0) continue; if ((!from_nid || path->path[0] == from_nid) && (!to_nid || path->path[path->depth - 1] == to_nid)) (!to_nid || path->path[path->depth - 1] == to_nid)) { if (with_aa_mix == HDA_PARSE_ALL || path->with_aa_mix == with_aa_mix) return path; } } return NULL; } /* get the path between the given NIDs; * passing 0 to either @pin or @dac behaves as a wildcard */ struct nid_path *snd_hda_get_nid_path(struct hda_codec *codec, hda_nid_t from_nid, hda_nid_t to_nid) { return get_nid_path(codec, from_nid, to_nid, HDA_PARSE_ALL); } EXPORT_SYMBOL_HDA(snd_hda_get_nid_path); /* check whether the given DAC is already found in any existing paths */ Loading Loading @@ -248,6 +258,8 @@ static bool __parse_nid_path(struct hda_codec *codec, found: path->path[path->depth] = conn[i]; if (conn[i] == spec->mixer_nid) path->with_aa_mix = true; path->idx[path->depth + 1] = i; if (nums > 1 && get_wcaps_type(get_wcaps(codec, to_nid)) != AC_WID_AUD_MIX) path->multi[path->depth + 1] = 1; Loading Loading @@ -290,6 +302,11 @@ snd_hda_add_new_path(struct hda_codec *codec, hda_nid_t from_nid, if (from_nid && to_nid && !is_reachable_path(codec, from_nid, to_nid)) return NULL; /* check whether the path has been already added */ path = get_nid_path(codec, from_nid, to_nid, with_aa_mix); if (path) return path; path = snd_array_new(&spec->paths); if (!path) return NULL; Loading sound/pci/hda/hda_generic.h +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ struct nid_path { unsigned char multi[MAX_NID_PATH_DEPTH]; unsigned int ctls[NID_PATH_NUM_CTLS]; /* NID_PATH_XXX_CTL */ bool active; bool with_aa_mix; }; /* mic/line-in auto switching entry */ Loading Loading
sound/pci/hda/hda_generic.c +24 −7 Original line number Diff line number Diff line Loading @@ -116,11 +116,9 @@ EXPORT_SYMBOL_HDA(snd_hda_gen_spec_free); * parsing paths */ /* get the path between the given NIDs; * passing 0 to either @pin or @dac behaves as a wildcard */ struct nid_path *snd_hda_get_nid_path(struct hda_codec *codec, hda_nid_t from_nid, hda_nid_t to_nid) static struct nid_path *get_nid_path(struct hda_codec *codec, hda_nid_t from_nid, hda_nid_t to_nid, int with_aa_mix) { struct hda_gen_spec *spec = codec->spec; int i; Loading @@ -130,11 +128,23 @@ struct nid_path *snd_hda_get_nid_path(struct hda_codec *codec, if (path->depth <= 0) continue; if ((!from_nid || path->path[0] == from_nid) && (!to_nid || path->path[path->depth - 1] == to_nid)) (!to_nid || path->path[path->depth - 1] == to_nid)) { if (with_aa_mix == HDA_PARSE_ALL || path->with_aa_mix == with_aa_mix) return path; } } return NULL; } /* get the path between the given NIDs; * passing 0 to either @pin or @dac behaves as a wildcard */ struct nid_path *snd_hda_get_nid_path(struct hda_codec *codec, hda_nid_t from_nid, hda_nid_t to_nid) { return get_nid_path(codec, from_nid, to_nid, HDA_PARSE_ALL); } EXPORT_SYMBOL_HDA(snd_hda_get_nid_path); /* check whether the given DAC is already found in any existing paths */ Loading Loading @@ -248,6 +258,8 @@ static bool __parse_nid_path(struct hda_codec *codec, found: path->path[path->depth] = conn[i]; if (conn[i] == spec->mixer_nid) path->with_aa_mix = true; path->idx[path->depth + 1] = i; if (nums > 1 && get_wcaps_type(get_wcaps(codec, to_nid)) != AC_WID_AUD_MIX) path->multi[path->depth + 1] = 1; Loading Loading @@ -290,6 +302,11 @@ snd_hda_add_new_path(struct hda_codec *codec, hda_nid_t from_nid, if (from_nid && to_nid && !is_reachable_path(codec, from_nid, to_nid)) return NULL; /* check whether the path has been already added */ path = get_nid_path(codec, from_nid, to_nid, with_aa_mix); if (path) return path; path = snd_array_new(&spec->paths); if (!path) return NULL; Loading
sound/pci/hda/hda_generic.h +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ struct nid_path { unsigned char multi[MAX_NID_PATH_DEPTH]; unsigned int ctls[NID_PATH_NUM_CTLS]; /* NID_PATH_XXX_CTL */ bool active; bool with_aa_mix; }; /* mic/line-in auto switching entry */ Loading