ALSA: hda - Add a generic fixup callback for Realtek codecs
authorTakashi Iwai <tiwai@suse.de>
Mon, 22 Nov 2010 12:29:19 +0000 (13:29 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 22 Nov 2010 12:29:19 +0000 (13:29 +0100)
Add a generic callback function for fixup elements.  This can be used
to do some unusual things like overriding the AMP cache, etc.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_realtek.c

index 564e6c136dddf4d50f7012129072e527c89cc7ab..f10c613c530f17ee3e480ad35ed03acbdec9b5b7 100644 (file)
@@ -1681,6 +1681,8 @@ struct alc_fixup {
        unsigned int sku;
        const struct alc_pincfg *pins;
        const struct hda_verb *verbs;
+       void (*func)(struct hda_codec *codec, const struct alc_fixup *fix,
+                    int pre_init);
 };
 
 static void alc_pick_fixup(struct hda_codec *codec,
@@ -1720,6 +1722,13 @@ static void alc_pick_fixup(struct hda_codec *codec,
 #endif
                add_verb(codec->spec, fix->verbs);
        }
+       if (fix->func) {
+#ifdef CONFIG_SND_DEBUG_VERBOSE
+               snd_printdd(KERN_INFO "hda_codec: %s: Apply fix-func for %s\n",
+                           codec->chip_name, quirk->name);
+#endif
+               fix->func(codec, fix, pre_init);
+       }
 }
 
 static int alc_read_coef_idx(struct hda_codec *codec,