aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-06-26 12:06:01 -0400
committerTakashi Iwai <tiwai@suse.de>2012-06-26 12:06:01 -0400
commitb54f8abad63fa409fa637e86d2bebd597342c0f8 (patch)
treefe3b52d81d63f57195c18334bcdfa062a9a178bb /sound/pci
parenta75e92442a9b17b24876ca85701a722af32d31a5 (diff)
parent6e1c39c6b00d9141a82c231ba7c5e5b1716974b2 (diff)
Merge branch 'fix/hda' into topic/hda
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/Kconfig13
-rw-r--r--sound/pci/hda/hda_auto_parser.c1
-rw-r--r--sound/pci/hda/hda_auto_parser.h10
-rw-r--r--sound/pci/hda/hda_codec.c4
-rw-r--r--sound/pci/hda/patch_conexant.c6
-rw-r--r--sound/pci/hda/patch_realtek.c15
-rw-r--r--sound/pci/hda/patch_sigmatel.c7
7 files changed, 34 insertions, 22 deletions
diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig
index 163b6b5de3eb..d03079764189 100644
--- a/sound/pci/hda/Kconfig
+++ b/sound/pci/hda/Kconfig
@@ -97,19 +97,6 @@ config SND_HDA_CODEC_REALTEK
97 snd-hda-codec-realtek. 97 snd-hda-codec-realtek.
98 This module is automatically loaded at probing. 98 This module is automatically loaded at probing.
99 99
100config SND_HDA_ENABLE_REALTEK_QUIRKS
101 bool "Build static quirks for Realtek codecs"
102 depends on SND_HDA_CODEC_REALTEK
103 default y
104 help
105 Say Y here to build the static quirks codes for Realtek codecs.
106 If you need the "model" preset that the default BIOS auto-parser
107 can't handle, turn this option on.
108
109 If your device works with model=auto option, basically you don't
110 need the quirk code. By turning this off, you can reduce the
111 module size quite a lot.
112
113config SND_HDA_CODEC_ANALOG 100config SND_HDA_CODEC_ANALOG
114 bool "Build Analog Device HD-audio codec support" 101 bool "Build Analog Device HD-audio codec support"
115 default y 102 default y
diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
index 6e9ef3e25093..f7520b9f909c 100644
--- a/sound/pci/hda/hda_auto_parser.c
+++ b/sound/pci/hda/hda_auto_parser.c
@@ -618,7 +618,6 @@ int snd_hda_gen_add_verbs(struct hda_gen_spec *spec,
618 const struct hda_verb *list) 618 const struct hda_verb *list)
619{ 619{
620 const struct hda_verb **v; 620 const struct hda_verb **v;
621 snd_array_init(&spec->verbs, sizeof(struct hda_verb *), 8);
622 v = snd_array_new(&spec->verbs); 621 v = snd_array_new(&spec->verbs);
623 if (!v) 622 if (!v)
624 return -ENOMEM; 623 return -ENOMEM;
diff --git a/sound/pci/hda/hda_auto_parser.h b/sound/pci/hda/hda_auto_parser.h
index 2a7889dfbd1b..632ad0ad3007 100644
--- a/sound/pci/hda/hda_auto_parser.h
+++ b/sound/pci/hda/hda_auto_parser.h
@@ -157,4 +157,14 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
157 const struct snd_pci_quirk *quirk, 157 const struct snd_pci_quirk *quirk,
158 const struct hda_fixup *fixlist); 158 const struct hda_fixup *fixlist);
159 159
160static 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
165static inline void snd_hda_gen_free(struct hda_gen_spec *spec)
166{
167 snd_array_free(&spec->verbs);
168}
169
160#endif /* __SOUND_HDA_AUTO_PARSER_H */ 170#endif /* __SOUND_HDA_AUTO_PARSER_H */
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 045b5e7b8245..14bc1c8f5326 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1184,6 +1184,7 @@ static void snd_hda_codec_free(struct hda_codec *codec)
1184{ 1184{
1185 if (!codec) 1185 if (!codec)
1186 return; 1186 return;
1187 snd_hda_jack_tbl_clear(codec);
1187 restore_init_pincfgs(codec); 1188 restore_init_pincfgs(codec);
1188#ifdef CONFIG_SND_HDA_POWER_SAVE 1189#ifdef CONFIG_SND_HDA_POWER_SAVE
1189 cancel_delayed_work(&codec->power_work); 1190 cancel_delayed_work(&codec->power_work);
@@ -1192,6 +1193,7 @@ static void snd_hda_codec_free(struct hda_codec *codec)
1192 list_del(&codec->list); 1193 list_del(&codec->list);
1193 snd_array_free(&codec->mixers); 1194 snd_array_free(&codec->mixers);
1194 snd_array_free(&codec->nids); 1195 snd_array_free(&codec->nids);
1196 snd_array_free(&codec->cvt_setups);
1195 snd_array_free(&codec->conn_lists); 1197 snd_array_free(&codec->conn_lists);
1196 snd_array_free(&codec->spdif_out); 1198 snd_array_free(&codec->spdif_out);
1197 codec->bus->caddr_tbl[codec->addr] = NULL; 1199 codec->bus->caddr_tbl[codec->addr] = NULL;
@@ -2333,6 +2335,8 @@ int snd_hda_codec_reset(struct hda_codec *codec)
2333 /* free only driver_pins so that init_pins + user_pins are restored */ 2335 /* free only driver_pins so that init_pins + user_pins are restored */
2334 snd_array_free(&codec->driver_pins); 2336 snd_array_free(&codec->driver_pins);
2335 restore_pincfgs(codec); 2337 restore_pincfgs(codec);
2338 snd_array_free(&codec->cvt_setups);
2339 snd_array_free(&codec->spdif_out);
2336 codec->num_pcms = 0; 2340 codec->num_pcms = 0;
2337 codec->pcm_info = NULL; 2341 codec->pcm_info = NULL;
2338 codec->preset = NULL; 2342 codec->preset = NULL;
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 172370b3793b..2bf99fc1cbf2 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -445,8 +445,10 @@ static int conexant_init(struct hda_codec *codec)
445 445
446static void conexant_free(struct hda_codec *codec) 446static void conexant_free(struct hda_codec *codec)
447{ 447{
448 struct conexant_spec *spec = codec->spec;
449 snd_hda_gen_free(&spec->gen);
448 snd_hda_detach_beep_device(codec); 450 snd_hda_detach_beep_device(codec);
449 kfree(codec->spec); 451 kfree(spec);
450} 452}
451 453
452static const struct snd_kcontrol_new cxt_capture_mixers[] = { 454static const struct snd_kcontrol_new cxt_capture_mixers[] = {
@@ -4466,6 +4468,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = {
4466 SND_PCI_QUIRK(0x17aa, 0x21ce, "Lenovo T420", CXT_PINCFG_LENOVO_TP410), 4468 SND_PCI_QUIRK(0x17aa, 0x21ce, "Lenovo T420", CXT_PINCFG_LENOVO_TP410),
4467 SND_PCI_QUIRK(0x17aa, 0x21cf, "Lenovo T520", CXT_PINCFG_LENOVO_TP410), 4469 SND_PCI_QUIRK(0x17aa, 0x21cf, "Lenovo T520", CXT_PINCFG_LENOVO_TP410),
4468 SND_PCI_QUIRK(0x17aa, 0x3975, "Lenovo U300s", CXT_FIXUP_STEREO_DMIC), 4470 SND_PCI_QUIRK(0x17aa, 0x3975, "Lenovo U300s", CXT_FIXUP_STEREO_DMIC),
4471 SND_PCI_QUIRK(0x17aa, 0x397b, "Lenovo S205", CXT_FIXUP_STEREO_DMIC),
4469 {} 4472 {}
4470}; 4473};
4471 4474
@@ -4497,6 +4500,7 @@ static int patch_conexant_auto(struct hda_codec *codec)
4497 if (!spec) 4500 if (!spec)
4498 return -ENOMEM; 4501 return -ENOMEM;
4499 codec->spec = spec; 4502 codec->spec = spec;
4503 snd_hda_gen_init(&spec->gen);
4500 4504
4501 switch (codec->vendor_id) { 4505 switch (codec->vendor_id) {
4502 case 0x14f15045: 4506 case 0x14f15045:
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 4377a9539735..5c81ee95d7f0 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2406,6 +2406,7 @@ static void alc_free(struct hda_codec *codec)
2406 alc_shutup(codec); 2406 alc_shutup(codec);
2407 alc_free_kctls(codec); 2407 alc_free_kctls(codec);
2408 alc_free_bind_ctls(codec); 2408 alc_free_bind_ctls(codec);
2409 snd_hda_gen_free(&spec->gen);
2409 kfree(spec); 2410 kfree(spec);
2410 snd_hda_detach_beep_device(codec); 2411 snd_hda_detach_beep_device(codec);
2411} 2412}
@@ -4371,6 +4372,7 @@ static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
4371 return -ENOMEM; 4372 return -ENOMEM;
4372 codec->spec = spec; 4373 codec->spec = spec;
4373 spec->mixer_nid = mixer_nid; 4374 spec->mixer_nid = mixer_nid;
4375 snd_hda_gen_init(&spec->gen);
4374 4376
4375 err = alc_codec_rename_from_preset(codec); 4377 err = alc_codec_rename_from_preset(codec);
4376 if (err < 0) { 4378 if (err < 0) {
@@ -6868,6 +6870,12 @@ static int patch_alc662(struct hda_codec *codec)
6868 6870
6869 alc_fix_pll_init(codec, 0x20, 0x04, 15); 6871 alc_fix_pll_init(codec, 0x20, 0x04, 15);
6870 6872
6873 alc_pick_fixup(codec, alc662_fixup_models,
6874 alc662_fixup_tbl, alc662_fixups);
6875 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
6876
6877 alc_auto_parse_customize_define(codec);
6878
6871 if ((alc_get_coef0(codec) & (1 << 14)) && 6879 if ((alc_get_coef0(codec) & (1 << 14)) &&
6872 codec->bus->pci->subsystem_vendor == 0x1025 && 6880 codec->bus->pci->subsystem_vendor == 0x1025 &&
6873 spec->cdefine.platform_type == 1) { 6881 spec->cdefine.platform_type == 1) {
@@ -6875,12 +6883,6 @@ static int patch_alc662(struct hda_codec *codec)
6875 goto error; 6883 goto error;
6876 } 6884 }
6877 6885
6878 alc_pick_fixup(codec, alc662_fixup_models,
6879 alc662_fixup_tbl, alc662_fixups);
6880 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
6881
6882 alc_auto_parse_customize_define(codec);
6883
6884 /* automatic parse from the BIOS config */ 6886 /* automatic parse from the BIOS config */
6885 err = alc662_parse_auto_config(codec); 6887 err = alc662_parse_auto_config(codec);
6886 if (err < 0) 6888 if (err < 0)
@@ -6963,6 +6965,7 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = {
6963 { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 }, 6965 { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 },
6964 { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 }, 6966 { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 },
6965 { .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 }, 6967 { .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 },
6968 { .id = 0x10ec0280, .name = "ALC280", .patch = patch_alc269 },
6966 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", 6969 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660",
6967 .patch = patch_alc861 }, 6970 .patch = patch_alc861 },
6968 { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd }, 6971 { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd },
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 7db8228f1b88..07675282015a 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4367,7 +4367,7 @@ static int stac92xx_init(struct hda_codec *codec)
4367 AC_PINCTL_IN_EN); 4367 AC_PINCTL_IN_EN);
4368 for (i = 0; i < spec->num_pwrs; i++) { 4368 for (i = 0; i < spec->num_pwrs; i++) {
4369 hda_nid_t nid = spec->pwr_nids[i]; 4369 hda_nid_t nid = spec->pwr_nids[i];
4370 int pinctl, def_conf; 4370 unsigned int pinctl, def_conf;
4371 4371
4372 def_conf = snd_hda_codec_get_pincfg(codec, nid); 4372 def_conf = snd_hda_codec_get_pincfg(codec, nid);
4373 def_conf = get_defcfg_connect(def_conf); 4373 def_conf = get_defcfg_connect(def_conf);
@@ -4376,6 +4376,11 @@ static int stac92xx_init(struct hda_codec *codec)
4376 stac_toggle_power_map(codec, nid, 0); 4376 stac_toggle_power_map(codec, nid, 0);
4377 continue; 4377 continue;
4378 } 4378 }
4379 if (def_conf == AC_JACK_PORT_FIXED) {
4380 /* no need for jack detection for fixed pins */
4381 stac_toggle_power_map(codec, nid, 1);
4382 continue;
4383 }
4379 /* power on when no jack detection is available */ 4384 /* power on when no jack detection is available */
4380 /* or when the VREF is used for controlling LED */ 4385 /* or when the VREF is used for controlling LED */
4381 if (!spec->hp_detect || 4386 if (!spec->hp_detect ||