summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_auto_parser.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-01-23 21:10:10 +0400
committerTakashi Iwai <tiwai@suse.de>2013-01-23 21:10:10 +0400
commit1f57825077dc2fa4e3d4a4e6b3af6c75f81112e7 (patch)
treef7172473bf9f1ac37d75f0afbeac8d65fcd0dd3f /sound/pci/hda/hda_auto_parser.c
parent3e367f155f3ba90b761497ab9e0343dc54778469 (diff)
downloadlinux-1f57825077dc2fa4e3d4a4e6b3af6c75f81112e7.tar.xz
ALSA: hda - Add chained_before flag to the fixup entry
Sometimes we want to call a fixup after applying other existing fixups, but currently the fixup chain mechanism allows only the call the others after the target fixup. This patch adds a new flag, chained_before, to struct hda_fixup, for allowing the chained call before the current execution. 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.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
index 0088bb0b04de..96a05c4c28e1 100644
--- a/sound/pci/hda/hda_auto_parser.c
+++ b/sound/pci/hda/hda_auto_parser.c
@@ -696,20 +696,18 @@ static void set_pin_targets(struct hda_codec *codec,
snd_hda_set_pin_ctl_cache(codec, cfg->nid, cfg->val);
}
-void snd_hda_apply_fixup(struct hda_codec *codec, int action)
+static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
{
- int id = codec->fixup_id;
#ifdef CONFIG_SND_DEBUG_VERBOSE
const char *modelname = codec->fixup_name;
#endif
- int depth = 0;
-
- if (!codec->fixup_list)
- return;
while (id >= 0) {
const struct hda_fixup *fix = codec->fixup_list + id;
+ if (fix->chained_before)
+ apply_fixup(codec, fix->chain_id, action, depth + 1);
+
switch (fix->type) {
case HDA_FIXUP_PINS:
if (action != HDA_FIXUP_ACT_PRE_PROBE || !fix->v.pins)
@@ -749,13 +747,19 @@ void snd_hda_apply_fixup(struct hda_codec *codec, int action)
codec->chip_name, fix->type);
break;
}
- if (!fix->chained)
+ if (!fix->chained || fix->chained_before)
break;
if (++depth > 10)
break;
id = fix->chain_id;
}
}
+
+void snd_hda_apply_fixup(struct hda_codec *codec, int action)
+{
+ if (codec->fixup_list)
+ apply_fixup(codec, codec->fixup_id, action, 0);
+}
EXPORT_SYMBOL_HDA(snd_hda_apply_fixup);
void snd_hda_pick_fixup(struct hda_codec *codec,