aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-12-18 12:12:44 -0500
committerTakashi Iwai <tiwai@suse.de>2013-01-12 02:30:45 -0500
commitc9ce6b260b039392b24ad65954788047d13d4c9a (patch)
tree58a35568c53b2b291061d4b22430b0f64eb0f1b9 /sound/pci/hda/patch_realtek.c
parent81fede89eda16a597c2d814113b74677754b0058 (diff)
ALSA: hda - Move fixup code into struct hda_codec
Since the fixup code is used commonly, it's worth to move it to the common place, struct hda_codec, instead of keeping in hda_gen_spec. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index fbdcbded3417..567d93f6c698 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -121,8 +121,6 @@ struct nid_path {
121}; 121};
122 122
123struct alc_spec { 123struct alc_spec {
124 struct hda_gen_spec gen;
125
126 /* codec parameterization */ 124 /* codec parameterization */
127 const struct snd_kcontrol_new *mixers[5]; /* mixer arrays */ 125 const struct snd_kcontrol_new *mixers[5]; /* mixer arrays */
128 unsigned int num_mixers; 126 unsigned int num_mixers;
@@ -1727,7 +1725,7 @@ static int alc_init(struct hda_codec *codec)
1727 alc_fix_pll(codec); 1725 alc_fix_pll(codec);
1728 alc_auto_init_amp(codec, spec->init_amp); 1726 alc_auto_init_amp(codec, spec->init_amp);
1729 1727
1730 snd_hda_gen_apply_verbs(codec); 1728 snd_hda_apply_verbs(codec);
1731 alc_auto_init_std(codec); 1729 alc_auto_init_std(codec);
1732 1730
1733 if (spec->vmaster_mute.sw_kctl && spec->vmaster_mute.hook) 1731 if (spec->vmaster_mute.sw_kctl && spec->vmaster_mute.hook)
@@ -2117,7 +2115,6 @@ static void alc_free(struct hda_codec *codec)
2117 alc_free_kctls(codec); 2115 alc_free_kctls(codec);
2118 alc_free_bind_ctls(codec); 2116 alc_free_bind_ctls(codec);
2119 snd_array_free(&spec->paths); 2117 snd_array_free(&spec->paths);
2120 snd_hda_gen_free(&spec->gen);
2121 kfree(spec); 2118 kfree(spec);
2122 snd_hda_detach_beep_device(codec); 2119 snd_hda_detach_beep_device(codec);
2123} 2120}
@@ -4525,7 +4522,6 @@ static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
4525 codec->spec = spec; 4522 codec->spec = spec;
4526 codec->single_adc_amp = 1; 4523 codec->single_adc_amp = 1;
4527 spec->mixer_nid = mixer_nid; 4524 spec->mixer_nid = mixer_nid;
4528 snd_hda_gen_init(&spec->gen);
4529 snd_array_init(&spec->kctls, sizeof(struct snd_kcontrol_new), 32); 4525 snd_array_init(&spec->kctls, sizeof(struct snd_kcontrol_new), 32);
4530 snd_array_init(&spec->bind_ctls, sizeof(struct hda_bind_ctls *), 8); 4526 snd_array_init(&spec->bind_ctls, sizeof(struct hda_bind_ctls *), 8);
4531 snd_array_init(&spec->paths, sizeof(struct nid_path), 8); 4527 snd_array_init(&spec->paths, sizeof(struct nid_path), 8);
@@ -5001,7 +4997,7 @@ static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
5001 spec->autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ 4997 spec->autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
5002 snd_hda_jack_detect_enable_callback(codec, 0x0f, ALC_HP_EVENT, 4998 snd_hda_jack_detect_enable_callback(codec, 0x0f, ALC_HP_EVENT,
5003 alc_hp_automute); 4999 alc_hp_automute);
5004 snd_hda_gen_add_verbs(&spec->gen, alc_gpio1_init_verbs); 5000 snd_hda_add_verbs(codec, alc_gpio1_init_verbs);
5005 } 5001 }
5006} 5002}
5007 5003
@@ -5878,7 +5874,7 @@ static int alc268_parse_auto_config(struct hda_codec *codec)
5878 if (err > 0) { 5874 if (err > 0) {
5879 if (!spec->no_analog && spec->autocfg.speaker_pins[0] != 0x1d) { 5875 if (!spec->no_analog && spec->autocfg.speaker_pins[0] != 0x1d) {
5880 add_mixer(spec, alc268_beep_mixer); 5876 add_mixer(spec, alc268_beep_mixer);
5881 snd_hda_gen_add_verbs(&spec->gen, alc268_beep_init_verbs); 5877 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
5882 } 5878 }
5883 } 5879 }
5884 return err; 5880 return err;