int i, nums;
if (to_nid == spec->mixer_nid) {
- if (!with_aa_mix)
+ if (with_aa_mix == HDA_PARSE_NO_AAMIX)
return false;
- with_aa_mix = 2; /* mark aa-mix is included */
+ with_aa_mix = HDA_PARSE_ALL; /* mark aa-mix is included */
}
nums = snd_hda_get_connections(codec, to_nid, conn, ARRAY_SIZE(conn));
continue;
}
/* aa-mix is requested but not included? */
- if (!(spec->mixer_nid && with_aa_mix == 1))
+ if (!(spec->mixer_nid && with_aa_mix == HDA_PARSE_ONLY_AAMIX))
goto found;
}
if (depth >= MAX_NID_PATH_DEPTH)
/* parse the widget path from the given nid to the target nid;
* when @from_nid is 0, try to find an empty DAC;
- * when @with_aa_mix is 0, paths with spec->mixer_nid are excluded.
- * when @with_aa_mix is 1, paths without spec->mixer_nid are excluded.
- * when @with_aa_mix is 2, no special handling about spec->mixer_nid.
+ * when @with_aa_mix is HDA_PARSE_NO_AAMIX, paths with spec->mixer_nid are
+ * excluded, only the paths that don't go through the mixer will be chosen.
+ * when @with_aa_mix is HDA_PARSE_ONLY_AAMIX, only the paths going through
+ * spec->mixer_nid will be chosen.
+ * when @with_aa_mix is HDA_PARSE_ALL, no special handling about mixer widget.
*/
bool snd_hda_parse_nid_path(struct hda_codec *codec, hda_nid_t from_nid,
hda_nid_t to_nid, int with_aa_mix,
else
badness += bad->no_dac;
}
- path = snd_hda_add_new_path(codec, dac, pin, 0);
+ path = snd_hda_add_new_path(codec, dac, pin, HDA_PARSE_NO_AAMIX);
if (!path)
dac = dacs[i] = 0;
else
badness++;
continue;
}
- path = snd_hda_add_new_path(codec, dac, nid, 0);
+ path = snd_hda_add_new_path(codec, dac, nid, HDA_PARSE_NO_AAMIX);
if (!path) {
badness++;
continue;
dac = get_dac_if_single(codec, pins[i]);
if (!dac)
continue;
- path = snd_hda_add_new_path(codec, dac, pins[i], 0);
+ path = snd_hda_add_new_path(codec, dac, pins[i], HDA_PARSE_NO_AAMIX);
if (path) {
dacs[i] = dac;
found = true;
!nid_has_mute(codec, mix_nid, HDA_INPUT))
return 0; /* no need for analog loopback */
- path = snd_hda_add_new_path(codec, pin, mix_nid, 2);
+ path = snd_hda_add_new_path(codec, pin, mix_nid, HDA_PARSE_ALL);
if (!path)
return -EINVAL;
print_nid_path("loopback", path);
if (!path)
return -ENOMEM;
memset(path, 0, sizeof(*path));
- if (!snd_hda_parse_nid_path(codec, pin, adc, 2, path)) {
+ if (!snd_hda_parse_nid_path(codec, pin, adc, HDA_PARSE_ALL, path)) {
snd_printd(KERN_ERR
"invalid input path 0x%x -> 0x%x\n",
pin, adc);
dig_nid = look_for_dac(codec, pin, true);
if (!dig_nid)
continue;
- path = snd_hda_add_new_path(codec, dig_nid, pin, 2);
+ path = snd_hda_add_new_path(codec, dig_nid, pin, HDA_PARSE_ALL);
if (!path)
continue;
print_nid_path("digout", path);
continue;
path = snd_hda_add_new_path(codec,
spec->autocfg.dig_in_pin,
- dig_nid, 2);
+ dig_nid, HDA_PARSE_ALL);
if (path) {
print_nid_path("digin", path);
path->active = true;