diff options
author | David Henningsson <david.henningsson@canonical.com> | 2014-07-22 14:09:34 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-07-22 14:26:50 +0200 |
commit | f5662e1cbf3f0939a6e033a00c542be4a0c2edee (patch) | |
tree | 5838be80537428235822d74a665a8b9f35d2bbcc /sound/pci/hda/hda_auto_parser.c | |
parent | 9dc12862da9d56ef4da646ba540c4f58b78738fc (diff) | |
download | linux-f5662e1cbf3f0939a6e033a00c542be4a0c2edee.tar.bz2 |
ALSA: hda - Refactor quirk picking and change quirk priority
Previously, calling one quirk function first and another later
would make the latter one take priority, this is now changed
to make the former take priority.
By adding two special values for fixup_id we can also get rid of the
fixup_forced flag.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_auto_parser.c')
-rw-r--r-- | sound/pci/hda/hda_auto_parser.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c index a9790198aa17..51dea49aadd4 100644 --- a/sound/pci/hda/hda_auto_parser.c +++ b/sound/pci/hda/hda_auto_parser.c @@ -854,7 +854,7 @@ void snd_hda_pick_pin_fixup(struct hda_codec *codec, { const struct snd_hda_pin_quirk *pq; - if (codec->fixup_forced) + if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET) return; for (pq = pin_quirk; pq->subvendor; pq++) { @@ -880,14 +880,17 @@ void snd_hda_pick_fixup(struct hda_codec *codec, const struct hda_fixup *fixlist) { const struct snd_pci_quirk *q; - int id = -1; + int id = HDA_FIXUP_ID_NOT_SET; const char *name = NULL; + if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET) + return; + /* when model=nofixup is given, don't pick up any fixups */ if (codec->modelname && !strcmp(codec->modelname, "nofixup")) { codec->fixup_list = NULL; - codec->fixup_id = -1; - codec->fixup_forced = 1; + codec->fixup_name = NULL; + codec->fixup_id = HDA_FIXUP_ID_NO_FIXUP; return; } @@ -897,13 +900,12 @@ void snd_hda_pick_fixup(struct hda_codec *codec, codec->fixup_id = models->id; codec->fixup_name = models->name; codec->fixup_list = fixlist; - codec->fixup_forced = 1; return; } models++; } } - if (id < 0 && quirk) { + if (quirk) { q = snd_pci_quirk_lookup(codec->bus->pci, quirk); if (q) { id = q->value; @@ -927,7 +929,6 @@ void snd_hda_pick_fixup(struct hda_codec *codec, } } - codec->fixup_forced = 0; codec->fixup_id = id; if (id >= 0) { codec->fixup_list = fixlist; |