Преглед изворни кода

ALSA: hda: Add fixup for mario system

create fixup function for the mario model and override amp capabilities
for NID 0x2

Signed-off-by: Todd Broch <tbroch@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Todd Broch пре 14 година
родитељ
комит
6be7948ff4
1 измењених фајлова са 21 додато и 1 уклоњено
  1. 21 1
      sound/pci/hda/patch_realtek.c

+ 21 - 1
sound/pci/hda/patch_realtek.c

@@ -19332,9 +19332,21 @@ static void alc662_auto_init(struct hda_codec *codec)
 		alc_inithook(codec);
 		alc_inithook(codec);
 }
 }
 
 
+static void alc272_fixup_mario(struct hda_codec *codec,
+			       const struct alc_fixup *fix, int pre_init) {
+	if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
+				      (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
+				      (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
+				      (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
+				      (0 << AC_AMPCAP_MUTE_SHIFT)))
+		printk(KERN_WARNING
+		       "hda_codec: failed to override amp caps for NID 0x2\n");
+}
+
 enum {
 enum {
 	ALC662_FIXUP_ASPIRE,
 	ALC662_FIXUP_ASPIRE,
 	ALC662_FIXUP_IDEAPAD,
 	ALC662_FIXUP_IDEAPAD,
+	ALC272_FIXUP_MARIO,
 };
 };
 
 
 static const struct alc_fixup alc662_fixups[] = {
 static const struct alc_fixup alc662_fixups[] = {
@@ -19350,6 +19362,9 @@ static const struct alc_fixup alc662_fixups[] = {
 			{ }
 			{ }
 		}
 		}
 	},
 	},
+	[ALC272_FIXUP_MARIO] = {
+		.func = alc272_fixup_mario,
+	}
 };
 };
 
 
 static struct snd_pci_quirk alc662_fixup_tbl[] = {
 static struct snd_pci_quirk alc662_fixup_tbl[] = {
@@ -19360,6 +19375,10 @@ static struct snd_pci_quirk alc662_fixup_tbl[] = {
 	{}
 	{}
 };
 };
 
 
+static const struct alc_model_fixup alc662_fixup_models[] = {
+	{.id = ALC272_FIXUP_MARIO, .name = "mario"},
+	{}
+};
 
 
 
 
 static int patch_alc662(struct hda_codec *codec)
 static int patch_alc662(struct hda_codec *codec)
@@ -19459,7 +19478,8 @@ static int patch_alc662(struct hda_codec *codec)
 	codec->patch_ops = alc_patch_ops;
 	codec->patch_ops = alc_patch_ops;
 	if (board_config == ALC662_AUTO) {
 	if (board_config == ALC662_AUTO) {
 		spec->init_hook = alc662_auto_init;
 		spec->init_hook = alc662_auto_init;
-		alc_pick_fixup(codec, alc662_fixup_tbl, alc662_fixups, 0);
+		alc_pick_fixup_model(codec, alc662_fixup_models,
+				     alc662_fixup_tbl, alc662_fixups, 0);
 	}
 	}
 
 
 	alc_init_jacks(codec);
 	alc_init_jacks(codec);