Skip to content

Commit

Permalink
ALSA: hda - Add fixup_forced flag
Browse files Browse the repository at this point in the history
The "fixup_forced" flag will indicate whether a specific fixup
(or nofixup) has been set by the user, to override the driver's
default.
This flag will help future patches.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
David Henningsson authored and Takashi Iwai committed May 26, 2014
1 parent a860d95 commit c21c8cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sound/pci/hda/hda_auto_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,15 +852,17 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
if (codec->modelname && !strcmp(codec->modelname, "nofixup")) {
codec->fixup_list = NULL;
codec->fixup_id = -1;
codec->fixup_forced = 1;
return;
}

if (codec->modelname && models) {
while (models->name) {
if (!strcmp(codec->modelname, models->name)) {
id = models->id;
name = models->name;
break;
codec->fixup_id = models->id;
codec->fixup_name = models->name;
codec->fixup_forced = 1;
return;
}
models++;
}
Expand Down Expand Up @@ -889,6 +891,7 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
}
}

codec->fixup_forced = 0;
codec->fixup_id = id;
if (id >= 0) {
codec->fixup_list = fixlist;
Expand Down
1 change: 1 addition & 0 deletions sound/pci/hda/hda_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ struct hda_codec {

/* fix-up list */
int fixup_id;
unsigned int fixup_forced:1; /* fixup explicitly set by user */
const struct hda_fixup *fixup_list;
const char *fixup_name;

Expand Down

0 comments on commit c21c8cf

Please sign in to comment.