diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-12-18 12:12:44 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-01-12 02:30:45 -0500 |
commit | c9ce6b260b039392b24ad65954788047d13d4c9a (patch) | |
tree | 58a35568c53b2b291061d4b22430b0f64eb0f1b9 /sound/pci/hda | |
parent | 81fede89eda16a597c2d814113b74677754b0058 (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')
-rw-r--r-- | sound/pci/hda/hda_auto_parser.c | 39 | ||||
-rw-r--r-- | sound/pci/hda/hda_auto_parser.h | 78 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 8 | ||||
-rw-r--r-- | sound/pci/hda/hda_local.h | 53 | ||||
-rw-r--r-- | sound/pci/hda/patch_cirrus.c | 8 | ||||
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 6 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 10 | ||||
-rw-r--r-- | sound/pci/hda/patch_via.c | 4 |
9 files changed, 86 insertions, 122 deletions
diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c index 7da883a464e3..d4606884f6a3 100644 --- a/sound/pci/hda/hda_auto_parser.c +++ b/sound/pci/hda/hda_auto_parser.c | |||
@@ -622,28 +622,27 @@ int snd_hda_get_pin_label(struct hda_codec *codec, hda_nid_t nid, | |||
622 | } | 622 | } |
623 | EXPORT_SYMBOL_HDA(snd_hda_get_pin_label); | 623 | EXPORT_SYMBOL_HDA(snd_hda_get_pin_label); |
624 | 624 | ||
625 | int snd_hda_gen_add_verbs(struct hda_gen_spec *spec, | 625 | int snd_hda_add_verbs(struct hda_codec *codec, |
626 | const struct hda_verb *list) | 626 | const struct hda_verb *list) |
627 | { | 627 | { |
628 | const struct hda_verb **v; | 628 | const struct hda_verb **v; |
629 | v = snd_array_new(&spec->verbs); | 629 | v = snd_array_new(&codec->verbs); |
630 | if (!v) | 630 | if (!v) |
631 | return -ENOMEM; | 631 | return -ENOMEM; |
632 | *v = list; | 632 | *v = list; |
633 | return 0; | 633 | return 0; |
634 | } | 634 | } |
635 | EXPORT_SYMBOL_HDA(snd_hda_gen_add_verbs); | 635 | EXPORT_SYMBOL_HDA(snd_hda_add_verbs); |
636 | 636 | ||
637 | void snd_hda_gen_apply_verbs(struct hda_codec *codec) | 637 | void snd_hda_apply_verbs(struct hda_codec *codec) |
638 | { | 638 | { |
639 | struct hda_gen_spec *spec = codec->spec; | ||
640 | int i; | 639 | int i; |
641 | for (i = 0; i < spec->verbs.used; i++) { | 640 | for (i = 0; i < codec->verbs.used; i++) { |
642 | struct hda_verb **v = snd_array_elem(&spec->verbs, i); | 641 | struct hda_verb **v = snd_array_elem(&codec->verbs, i); |
643 | snd_hda_sequence_write(codec, *v); | 642 | snd_hda_sequence_write(codec, *v); |
644 | } | 643 | } |
645 | } | 644 | } |
646 | EXPORT_SYMBOL_HDA(snd_hda_gen_apply_verbs); | 645 | EXPORT_SYMBOL_HDA(snd_hda_apply_verbs); |
647 | 646 | ||
648 | void snd_hda_apply_pincfgs(struct hda_codec *codec, | 647 | void snd_hda_apply_pincfgs(struct hda_codec *codec, |
649 | const struct hda_pintbl *cfg) | 648 | const struct hda_pintbl *cfg) |
@@ -655,18 +654,17 @@ EXPORT_SYMBOL_HDA(snd_hda_apply_pincfgs); | |||
655 | 654 | ||
656 | void snd_hda_apply_fixup(struct hda_codec *codec, int action) | 655 | void snd_hda_apply_fixup(struct hda_codec *codec, int action) |
657 | { | 656 | { |
658 | struct hda_gen_spec *spec = codec->spec; | 657 | int id = codec->fixup_id; |
659 | int id = spec->fixup_id; | ||
660 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 658 | #ifdef CONFIG_SND_DEBUG_VERBOSE |
661 | const char *modelname = spec->fixup_name; | 659 | const char *modelname = codec->fixup_name; |
662 | #endif | 660 | #endif |
663 | int depth = 0; | 661 | int depth = 0; |
664 | 662 | ||
665 | if (!spec->fixup_list) | 663 | if (!codec->fixup_list) |
666 | return; | 664 | return; |
667 | 665 | ||
668 | while (id >= 0) { | 666 | while (id >= 0) { |
669 | const struct hda_fixup *fix = spec->fixup_list + id; | 667 | const struct hda_fixup *fix = codec->fixup_list + id; |
670 | 668 | ||
671 | switch (fix->type) { | 669 | switch (fix->type) { |
672 | case HDA_FIXUP_PINS: | 670 | case HDA_FIXUP_PINS: |
@@ -683,7 +681,7 @@ void snd_hda_apply_fixup(struct hda_codec *codec, int action) | |||
683 | snd_printdd(KERN_INFO SFX | 681 | snd_printdd(KERN_INFO SFX |
684 | "%s: Apply fix-verbs for %s\n", | 682 | "%s: Apply fix-verbs for %s\n", |
685 | codec->chip_name, modelname); | 683 | codec->chip_name, modelname); |
686 | snd_hda_gen_add_verbs(codec->spec, fix->v.verbs); | 684 | snd_hda_add_verbs(codec, fix->v.verbs); |
687 | break; | 685 | break; |
688 | case HDA_FIXUP_FUNC: | 686 | case HDA_FIXUP_FUNC: |
689 | if (!fix->v.func) | 687 | if (!fix->v.func) |
@@ -713,15 +711,14 @@ void snd_hda_pick_fixup(struct hda_codec *codec, | |||
713 | const struct snd_pci_quirk *quirk, | 711 | const struct snd_pci_quirk *quirk, |
714 | const struct hda_fixup *fixlist) | 712 | const struct hda_fixup *fixlist) |
715 | { | 713 | { |
716 | struct hda_gen_spec *spec = codec->spec; | ||
717 | const struct snd_pci_quirk *q; | 714 | const struct snd_pci_quirk *q; |
718 | int id = -1; | 715 | int id = -1; |
719 | const char *name = NULL; | 716 | const char *name = NULL; |
720 | 717 | ||
721 | /* when model=nofixup is given, don't pick up any fixups */ | 718 | /* when model=nofixup is given, don't pick up any fixups */ |
722 | if (codec->modelname && !strcmp(codec->modelname, "nofixup")) { | 719 | if (codec->modelname && !strcmp(codec->modelname, "nofixup")) { |
723 | spec->fixup_list = NULL; | 720 | codec->fixup_list = NULL; |
724 | spec->fixup_id = -1; | 721 | codec->fixup_id = -1; |
725 | return; | 722 | return; |
726 | } | 723 | } |
727 | 724 | ||
@@ -759,10 +756,10 @@ void snd_hda_pick_fixup(struct hda_codec *codec, | |||
759 | } | 756 | } |
760 | } | 757 | } |
761 | 758 | ||
762 | spec->fixup_id = id; | 759 | codec->fixup_id = id; |
763 | if (id >= 0) { | 760 | if (id >= 0) { |
764 | spec->fixup_list = fixlist; | 761 | codec->fixup_list = fixlist; |
765 | spec->fixup_name = name; | 762 | codec->fixup_name = name; |
766 | } | 763 | } |
767 | } | 764 | } |
768 | EXPORT_SYMBOL_HDA(snd_hda_pick_fixup); | 765 | EXPORT_SYMBOL_HDA(snd_hda_pick_fixup); |
diff --git a/sound/pci/hda/hda_auto_parser.h b/sound/pci/hda/hda_auto_parser.h index 632ad0ad3007..ff11074b6c8b 100644 --- a/sound/pci/hda/hda_auto_parser.h +++ b/sound/pci/hda/hda_auto_parser.h | |||
@@ -89,82 +89,4 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec, | |||
89 | #define snd_hda_parse_pin_def_config(codec, cfg, ignore) \ | 89 | #define snd_hda_parse_pin_def_config(codec, cfg, ignore) \ |
90 | snd_hda_parse_pin_defcfg(codec, cfg, ignore, 0) | 90 | snd_hda_parse_pin_defcfg(codec, cfg, ignore, 0) |
91 | 91 | ||
92 | /* | ||
93 | */ | ||
94 | |||
95 | struct hda_gen_spec { | ||
96 | /* fix-up list */ | ||
97 | int fixup_id; | ||
98 | const struct hda_fixup *fixup_list; | ||
99 | const char *fixup_name; | ||
100 | |||
101 | /* additional init verbs */ | ||
102 | struct snd_array verbs; | ||
103 | }; | ||
104 | |||
105 | |||
106 | /* | ||
107 | * Fix-up pin default configurations and add default verbs | ||
108 | */ | ||
109 | |||
110 | struct hda_pintbl { | ||
111 | hda_nid_t nid; | ||
112 | u32 val; | ||
113 | }; | ||
114 | |||
115 | struct hda_model_fixup { | ||
116 | const int id; | ||
117 | const char *name; | ||
118 | }; | ||
119 | |||
120 | struct hda_fixup { | ||
121 | int type; | ||
122 | bool chained; | ||
123 | int chain_id; | ||
124 | union { | ||
125 | const struct hda_pintbl *pins; | ||
126 | const struct hda_verb *verbs; | ||
127 | void (*func)(struct hda_codec *codec, | ||
128 | const struct hda_fixup *fix, | ||
129 | int action); | ||
130 | } v; | ||
131 | }; | ||
132 | |||
133 | /* fixup types */ | ||
134 | enum { | ||
135 | HDA_FIXUP_INVALID, | ||
136 | HDA_FIXUP_PINS, | ||
137 | HDA_FIXUP_VERBS, | ||
138 | HDA_FIXUP_FUNC, | ||
139 | }; | ||
140 | |||
141 | /* fixup action definitions */ | ||
142 | enum { | ||
143 | HDA_FIXUP_ACT_PRE_PROBE, | ||
144 | HDA_FIXUP_ACT_PROBE, | ||
145 | HDA_FIXUP_ACT_INIT, | ||
146 | HDA_FIXUP_ACT_BUILD, | ||
147 | }; | ||
148 | |||
149 | int snd_hda_gen_add_verbs(struct hda_gen_spec *spec, | ||
150 | const struct hda_verb *list); | ||
151 | void snd_hda_gen_apply_verbs(struct hda_codec *codec); | ||
152 | void snd_hda_apply_pincfgs(struct hda_codec *codec, | ||
153 | const struct hda_pintbl *cfg); | ||
154 | void snd_hda_apply_fixup(struct hda_codec *codec, int action); | ||
155 | void snd_hda_pick_fixup(struct hda_codec *codec, | ||
156 | const struct hda_model_fixup *models, | ||
157 | const struct snd_pci_quirk *quirk, | ||
158 | const struct hda_fixup *fixlist); | ||
159 | |||
160 | static inline void snd_hda_gen_init(struct hda_gen_spec *spec) | ||
161 | { | ||
162 | snd_array_init(&spec->verbs, sizeof(struct hda_verb *), 8); | ||
163 | } | ||
164 | |||
165 | static inline void snd_hda_gen_free(struct hda_gen_spec *spec) | ||
166 | { | ||
167 | snd_array_free(&spec->verbs); | ||
168 | } | ||
169 | |||
170 | #endif /* __SOUND_HDA_AUTO_PARSER_H */ | 92 | #endif /* __SOUND_HDA_AUTO_PARSER_H */ |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 0037147dcd54..e7749dee7c40 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -1253,6 +1253,7 @@ int snd_hda_codec_new(struct hda_bus *bus, | |||
1253 | snd_array_init(&codec->conn_lists, sizeof(hda_nid_t), 64); | 1253 | snd_array_init(&codec->conn_lists, sizeof(hda_nid_t), 64); |
1254 | snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16); | 1254 | snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16); |
1255 | snd_array_init(&codec->jacktbl, sizeof(struct hda_jack_tbl), 16); | 1255 | snd_array_init(&codec->jacktbl, sizeof(struct hda_jack_tbl), 16); |
1256 | snd_array_init(&codec->verbs, sizeof(struct hda_verb *), 8); | ||
1256 | INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work); | 1257 | INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work); |
1257 | 1258 | ||
1258 | #ifdef CONFIG_PM | 1259 | #ifdef CONFIG_PM |
@@ -2407,6 +2408,7 @@ int snd_hda_codec_reset(struct hda_codec *codec) | |||
2407 | snd_array_free(&codec->driver_pins); | 2408 | snd_array_free(&codec->driver_pins); |
2408 | snd_array_free(&codec->cvt_setups); | 2409 | snd_array_free(&codec->cvt_setups); |
2409 | snd_array_free(&codec->spdif_out); | 2410 | snd_array_free(&codec->spdif_out); |
2411 | snd_array_free(&codec->verbs); | ||
2410 | codec->num_pcms = 0; | 2412 | codec->num_pcms = 0; |
2411 | codec->pcm_info = NULL; | 2413 | codec->pcm_info = NULL; |
2412 | codec->preset = NULL; | 2414 | codec->preset = NULL; |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index cab39b23d37c..a1cb28ff3968 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -896,6 +896,14 @@ struct hda_codec { | |||
896 | /* jack detection */ | 896 | /* jack detection */ |
897 | struct snd_array jacks; | 897 | struct snd_array jacks; |
898 | #endif | 898 | #endif |
899 | |||
900 | /* fix-up list */ | ||
901 | int fixup_id; | ||
902 | const struct hda_fixup *fixup_list; | ||
903 | const char *fixup_name; | ||
904 | |||
905 | /* additional init verbs */ | ||
906 | struct snd_array verbs; | ||
899 | }; | 907 | }; |
900 | 908 | ||
901 | /* direction */ | 909 | /* direction */ |
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index ff56da82b7a0..de12dcc5accc 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -386,6 +386,59 @@ int snd_hda_add_new_ctls(struct hda_codec *codec, | |||
386 | const struct snd_kcontrol_new *knew); | 386 | const struct snd_kcontrol_new *knew); |
387 | 387 | ||
388 | /* | 388 | /* |
389 | * Fix-up pin default configurations and add default verbs | ||
390 | */ | ||
391 | |||
392 | struct hda_pintbl { | ||
393 | hda_nid_t nid; | ||
394 | u32 val; | ||
395 | }; | ||
396 | |||
397 | struct hda_model_fixup { | ||
398 | const int id; | ||
399 | const char *name; | ||
400 | }; | ||
401 | |||
402 | struct hda_fixup { | ||
403 | int type; | ||
404 | bool chained; | ||
405 | int chain_id; | ||
406 | union { | ||
407 | const struct hda_pintbl *pins; | ||
408 | const struct hda_verb *verbs; | ||
409 | void (*func)(struct hda_codec *codec, | ||
410 | const struct hda_fixup *fix, | ||
411 | int action); | ||
412 | } v; | ||
413 | }; | ||
414 | |||
415 | /* fixup types */ | ||
416 | enum { | ||
417 | HDA_FIXUP_INVALID, | ||
418 | HDA_FIXUP_PINS, | ||
419 | HDA_FIXUP_VERBS, | ||
420 | HDA_FIXUP_FUNC, | ||
421 | }; | ||
422 | |||
423 | /* fixup action definitions */ | ||
424 | enum { | ||
425 | HDA_FIXUP_ACT_PRE_PROBE, | ||
426 | HDA_FIXUP_ACT_PROBE, | ||
427 | HDA_FIXUP_ACT_INIT, | ||
428 | HDA_FIXUP_ACT_BUILD, | ||
429 | }; | ||
430 | |||
431 | int snd_hda_add_verbs(struct hda_codec *codec, const struct hda_verb *list); | ||
432 | void snd_hda_apply_verbs(struct hda_codec *codec); | ||
433 | void snd_hda_apply_pincfgs(struct hda_codec *codec, | ||
434 | const struct hda_pintbl *cfg); | ||
435 | void snd_hda_apply_fixup(struct hda_codec *codec, int action); | ||
436 | void snd_hda_pick_fixup(struct hda_codec *codec, | ||
437 | const struct hda_model_fixup *models, | ||
438 | const struct snd_pci_quirk *quirk, | ||
439 | const struct hda_fixup *fixlist); | ||
440 | |||
441 | /* | ||
389 | * unsolicited event handler | 442 | * unsolicited event handler |
390 | */ | 443 | */ |
391 | 444 | ||
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index a2537b2f8724..7b0b8c305737 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c | |||
@@ -34,8 +34,6 @@ | |||
34 | */ | 34 | */ |
35 | 35 | ||
36 | struct cs_spec { | 36 | struct cs_spec { |
37 | struct hda_gen_spec gen; | ||
38 | |||
39 | struct auto_pin_cfg autocfg; | 37 | struct auto_pin_cfg autocfg; |
40 | struct hda_multi_out multiout; | 38 | struct hda_multi_out multiout; |
41 | struct snd_kcontrol *vmaster_sw; | 39 | struct snd_kcontrol *vmaster_sw; |
@@ -1201,7 +1199,7 @@ static int cs_init(struct hda_codec *codec) | |||
1201 | 1199 | ||
1202 | snd_hda_sequence_write(codec, cs_coef_init_verbs); | 1200 | snd_hda_sequence_write(codec, cs_coef_init_verbs); |
1203 | 1201 | ||
1204 | snd_hda_gen_apply_verbs(codec); | 1202 | snd_hda_apply_verbs(codec); |
1205 | 1203 | ||
1206 | if (spec->gpio_mask) { | 1204 | if (spec->gpio_mask) { |
1207 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_MASK, | 1205 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_MASK, |
@@ -1252,7 +1250,6 @@ static void cs_free(struct hda_codec *codec) | |||
1252 | struct cs_spec *spec = codec->spec; | 1250 | struct cs_spec *spec = codec->spec; |
1253 | kfree(spec->capture_bind[0]); | 1251 | kfree(spec->capture_bind[0]); |
1254 | kfree(spec->capture_bind[1]); | 1252 | kfree(spec->capture_bind[1]); |
1255 | snd_hda_gen_free(&spec->gen); | ||
1256 | kfree(codec->spec); | 1253 | kfree(codec->spec); |
1257 | } | 1254 | } |
1258 | 1255 | ||
@@ -1443,7 +1440,6 @@ static int patch_cs420x(struct hda_codec *codec) | |||
1443 | if (!spec) | 1440 | if (!spec) |
1444 | return -ENOMEM; | 1441 | return -ENOMEM; |
1445 | codec->spec = spec; | 1442 | codec->spec = spec; |
1446 | snd_hda_gen_init(&spec->gen); | ||
1447 | 1443 | ||
1448 | spec->vendor_nid = CS420X_VENDOR_NID; | 1444 | spec->vendor_nid = CS420X_VENDOR_NID; |
1449 | 1445 | ||
@@ -1981,7 +1977,6 @@ static int patch_cs4210(struct hda_codec *codec) | |||
1981 | if (!spec) | 1977 | if (!spec) |
1982 | return -ENOMEM; | 1978 | return -ENOMEM; |
1983 | codec->spec = spec; | 1979 | codec->spec = spec; |
1984 | snd_hda_gen_init(&spec->gen); | ||
1985 | 1980 | ||
1986 | spec->vendor_nid = CS4210_VENDOR_NID; | 1981 | spec->vendor_nid = CS4210_VENDOR_NID; |
1987 | 1982 | ||
@@ -2021,7 +2016,6 @@ static int patch_cs4213(struct hda_codec *codec) | |||
2021 | if (!spec) | 2016 | if (!spec) |
2022 | return -ENOMEM; | 2017 | return -ENOMEM; |
2023 | codec->spec = spec; | 2018 | codec->spec = spec; |
2024 | snd_hda_gen_init(&spec->gen); | ||
2025 | 2019 | ||
2026 | spec->vendor_nid = CS4213_VENDOR_NID; | 2020 | spec->vendor_nid = CS4213_VENDOR_NID; |
2027 | 2021 | ||
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index dd798c3196ff..a52f5662f69c 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -67,8 +67,6 @@ struct imux_info { | |||
67 | }; | 67 | }; |
68 | 68 | ||
69 | struct conexant_spec { | 69 | struct conexant_spec { |
70 | struct hda_gen_spec gen; | ||
71 | |||
72 | const struct snd_kcontrol_new *mixers[5]; | 70 | const struct snd_kcontrol_new *mixers[5]; |
73 | int num_mixers; | 71 | int num_mixers; |
74 | hda_nid_t vmaster_nid; | 72 | hda_nid_t vmaster_nid; |
@@ -451,7 +449,6 @@ static int conexant_init(struct hda_codec *codec) | |||
451 | static void conexant_free(struct hda_codec *codec) | 449 | static void conexant_free(struct hda_codec *codec) |
452 | { | 450 | { |
453 | struct conexant_spec *spec = codec->spec; | 451 | struct conexant_spec *spec = codec->spec; |
454 | snd_hda_gen_free(&spec->gen); | ||
455 | snd_hda_detach_beep_device(codec); | 452 | snd_hda_detach_beep_device(codec); |
456 | kfree(spec); | 453 | kfree(spec); |
457 | } | 454 | } |
@@ -4033,7 +4030,7 @@ static void cx_auto_init_digital(struct hda_codec *codec) | |||
4033 | static int cx_auto_init(struct hda_codec *codec) | 4030 | static int cx_auto_init(struct hda_codec *codec) |
4034 | { | 4031 | { |
4035 | struct conexant_spec *spec = codec->spec; | 4032 | struct conexant_spec *spec = codec->spec; |
4036 | snd_hda_gen_apply_verbs(codec); | 4033 | snd_hda_apply_verbs(codec); |
4037 | cx_auto_init_output(codec); | 4034 | cx_auto_init_output(codec); |
4038 | cx_auto_init_input(codec); | 4035 | cx_auto_init_input(codec); |
4039 | cx_auto_init_digital(codec); | 4036 | cx_auto_init_digital(codec); |
@@ -4533,7 +4530,6 @@ static int patch_conexant_auto(struct hda_codec *codec) | |||
4533 | if (!spec) | 4530 | if (!spec) |
4534 | return -ENOMEM; | 4531 | return -ENOMEM; |
4535 | codec->spec = spec; | 4532 | codec->spec = spec; |
4536 | snd_hda_gen_init(&spec->gen); | ||
4537 | 4533 | ||
4538 | switch (codec->vendor_id) { | 4534 | switch (codec->vendor_id) { |
4539 | case 0x14f15045: | 4535 | case 0x14f15045: |
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 | ||
123 | struct alc_spec { | 123 | struct 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; |
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 09bb64996d72..b224b3d68184 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -120,8 +120,6 @@ enum { | |||
120 | }; | 120 | }; |
121 | 121 | ||
122 | struct via_spec { | 122 | struct via_spec { |
123 | struct hda_gen_spec gen; | ||
124 | |||
125 | /* codec parameterization */ | 123 | /* codec parameterization */ |
126 | const struct snd_kcontrol_new *mixers[6]; | 124 | const struct snd_kcontrol_new *mixers[6]; |
127 | unsigned int num_mixers; | 125 | unsigned int num_mixers; |
@@ -252,7 +250,6 @@ static struct via_spec * via_new_spec(struct hda_codec *codec) | |||
252 | /* VT1708BCE & VT1708S are almost same */ | 250 | /* VT1708BCE & VT1708S are almost same */ |
253 | if (spec->codec_type == VT1708BCE) | 251 | if (spec->codec_type == VT1708BCE) |
254 | spec->codec_type = VT1708S; | 252 | spec->codec_type = VT1708S; |
255 | snd_hda_gen_init(&spec->gen); | ||
256 | return spec; | 253 | return spec; |
257 | } | 254 | } |
258 | 255 | ||
@@ -1657,7 +1654,6 @@ static void via_free(struct hda_codec *codec) | |||
1657 | vt1708_stop_hp_work(spec); | 1654 | vt1708_stop_hp_work(spec); |
1658 | kfree(spec->bind_cap_vol); | 1655 | kfree(spec->bind_cap_vol); |
1659 | kfree(spec->bind_cap_sw); | 1656 | kfree(spec->bind_cap_sw); |
1660 | snd_hda_gen_free(&spec->gen); | ||
1661 | kfree(spec); | 1657 | kfree(spec); |
1662 | } | 1658 | } |
1663 | 1659 | ||