ALSA: hda/generic: Add option to enforce preferred_dacs pairs
authorTakashi Iwai <tiwai@suse.de>
Fri, 27 Nov 2020 14:11:03 +0000 (15:11 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sat, 28 Nov 2020 08:29:52 +0000 (09:29 +0100)
commit242d990c158d5b1dabd166516e21992baef5f26a
treee4640cd9fe9e1eb84ebfcf95d740d51f5162ce75
parent5ef5bee02f1a7ae0706a7236867fddb26d8e8650
ALSA: hda/generic: Add option to enforce preferred_dacs pairs

The generic parser accepts the preferred_dacs[] pairs as a hint for
assigning a DAC to each pin, but this hint doesn't work always
effectively.  Currently it's merely a secondary choice after the trial
with the path index failed.  This made sometimes it difficult to
assign DACs without mimicking the connection list and/or the badness
table.

This patch adds a new flag, obey_preferred_dacs, that changes the
behavior of the parser.  As its name stands, the parser obeys the
given preferred_dacs[] pairs by skipping the path index matching and
giving a high penalty if no DAC is assigned by the pairs.  This mode
will help for assigning the fixed DACs forcibly from the codec
driver.

Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201127141104.11041-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_generic.c
sound/pci/hda/hda_generic.h