diff options
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/es1968.c | 2 | ||||
-rw-r--r-- | sound/pci/fm801.c | 4 | ||||
-rw-r--r-- | sound/pci/hda/Kconfig | 13 | ||||
-rw-r--r-- | sound/pci/hda/hda_auto_parser.c | 1 | ||||
-rw-r--r-- | sound/pci/hda/hda_auto_parser.h | 10 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.c | 50 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 19 | ||||
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 8 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 53 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 7 |
11 files changed, 126 insertions, 43 deletions
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index 67f47d891959..52b5c0bf90c1 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c | |||
@@ -2769,7 +2769,7 @@ static int __devinit snd_es1968_create(struct snd_card *card, | |||
2769 | chip->tea.ops = &snd_es1968_tea_ops; | 2769 | chip->tea.ops = &snd_es1968_tea_ops; |
2770 | strlcpy(chip->tea.card, "SF64-PCE2", sizeof(chip->tea.card)); | 2770 | strlcpy(chip->tea.card, "SF64-PCE2", sizeof(chip->tea.card)); |
2771 | sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci)); | 2771 | sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci)); |
2772 | if (!snd_tea575x_init(&chip->tea)) | 2772 | if (!snd_tea575x_init(&chip->tea, THIS_MODULE)) |
2773 | printk(KERN_INFO "es1968: detected TEA575x radio\n"); | 2773 | printk(KERN_INFO "es1968: detected TEA575x radio\n"); |
2774 | #endif | 2774 | #endif |
2775 | 2775 | ||
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index f69662322750..b32e8024ea86 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c | |||
@@ -1254,7 +1254,7 @@ static int __devinit snd_fm801_create(struct snd_card *card, | |||
1254 | sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci)); | 1254 | sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci)); |
1255 | if ((tea575x_tuner & TUNER_TYPE_MASK) > 0 && | 1255 | if ((tea575x_tuner & TUNER_TYPE_MASK) > 0 && |
1256 | (tea575x_tuner & TUNER_TYPE_MASK) < 4) { | 1256 | (tea575x_tuner & TUNER_TYPE_MASK) < 4) { |
1257 | if (snd_tea575x_init(&chip->tea)) { | 1257 | if (snd_tea575x_init(&chip->tea, THIS_MODULE)) { |
1258 | snd_printk(KERN_ERR "TEA575x radio not found\n"); | 1258 | snd_printk(KERN_ERR "TEA575x radio not found\n"); |
1259 | snd_fm801_free(chip); | 1259 | snd_fm801_free(chip); |
1260 | return -ENODEV; | 1260 | return -ENODEV; |
@@ -1263,7 +1263,7 @@ static int __devinit snd_fm801_create(struct snd_card *card, | |||
1263 | /* autodetect tuner connection */ | 1263 | /* autodetect tuner connection */ |
1264 | for (tea575x_tuner = 1; tea575x_tuner <= 3; tea575x_tuner++) { | 1264 | for (tea575x_tuner = 1; tea575x_tuner <= 3; tea575x_tuner++) { |
1265 | chip->tea575x_tuner = tea575x_tuner; | 1265 | chip->tea575x_tuner = tea575x_tuner; |
1266 | if (!snd_tea575x_init(&chip->tea)) { | 1266 | if (!snd_tea575x_init(&chip->tea, THIS_MODULE)) { |
1267 | snd_printk(KERN_INFO "detected TEA575x radio type %s\n", | 1267 | snd_printk(KERN_INFO "detected TEA575x radio type %s\n", |
1268 | get_tea575x_gpio(chip)->name); | 1268 | get_tea575x_gpio(chip)->name); |
1269 | break; | 1269 | break; |
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 | ||
100 | config 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 | |||
113 | config SND_HDA_CODEC_ANALOG | 100 | config 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 | ||
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 | |||
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 41ca803a1fff..51cb2a2e4fce 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; |
@@ -4393,20 +4397,19 @@ void snd_hda_update_power_acct(struct hda_codec *codec) | |||
4393 | codec->power_jiffies += delta; | 4397 | codec->power_jiffies += delta; |
4394 | } | 4398 | } |
4395 | 4399 | ||
4396 | /** | 4400 | /* Transition to powered up, if wait_power_down then wait for a pending |
4397 | * snd_hda_power_up - Power-up the codec | 4401 | * transition to D3 to complete. A pending D3 transition is indicated |
4398 | * @codec: HD-audio codec | 4402 | * with power_transition == -1. */ |
4399 | * | 4403 | static void __snd_hda_power_up(struct hda_codec *codec, bool wait_power_down) |
4400 | * Increment the power-up counter and power up the hardware really when | ||
4401 | * not turned on yet. | ||
4402 | */ | ||
4403 | void snd_hda_power_up(struct hda_codec *codec) | ||
4404 | { | 4404 | { |
4405 | struct hda_bus *bus = codec->bus; | 4405 | struct hda_bus *bus = codec->bus; |
4406 | 4406 | ||
4407 | spin_lock(&codec->power_lock); | 4407 | spin_lock(&codec->power_lock); |
4408 | codec->power_count++; | 4408 | codec->power_count++; |
4409 | if (codec->power_on || codec->power_transition > 0) { | 4409 | /* Return if power_on or transitioning to power_on, unless currently |
4410 | * powering down. */ | ||
4411 | if ((codec->power_on || codec->power_transition > 0) && | ||
4412 | !(wait_power_down && codec->power_transition < 0)) { | ||
4410 | spin_unlock(&codec->power_lock); | 4413 | spin_unlock(&codec->power_lock); |
4411 | return; | 4414 | return; |
4412 | } | 4415 | } |
@@ -4430,8 +4433,37 @@ void snd_hda_power_up(struct hda_codec *codec) | |||
4430 | codec->power_transition = 0; | 4433 | codec->power_transition = 0; |
4431 | spin_unlock(&codec->power_lock); | 4434 | spin_unlock(&codec->power_lock); |
4432 | } | 4435 | } |
4436 | |||
4437 | /** | ||
4438 | * snd_hda_power_up - Power-up the codec | ||
4439 | * @codec: HD-audio codec | ||
4440 | * | ||
4441 | * Increment the power-up counter and power up the hardware really when | ||
4442 | * not turned on yet. | ||
4443 | */ | ||
4444 | void snd_hda_power_up(struct hda_codec *codec) | ||
4445 | { | ||
4446 | __snd_hda_power_up(codec, false); | ||
4447 | } | ||
4433 | EXPORT_SYMBOL_HDA(snd_hda_power_up); | 4448 | EXPORT_SYMBOL_HDA(snd_hda_power_up); |
4434 | 4449 | ||
4450 | /** | ||
4451 | * snd_hda_power_up_d3wait - Power-up the codec after waiting for any pending | ||
4452 | * D3 transition to complete. This differs from snd_hda_power_up() when | ||
4453 | * power_transition == -1. snd_hda_power_up sees this case as a nop, | ||
4454 | * snd_hda_power_up_d3wait waits for the D3 transition to complete then powers | ||
4455 | * back up. | ||
4456 | * @codec: HD-audio codec | ||
4457 | * | ||
4458 | * Cancel any power down operation hapenning on the work queue, then power up. | ||
4459 | */ | ||
4460 | void snd_hda_power_up_d3wait(struct hda_codec *codec) | ||
4461 | { | ||
4462 | /* This will cancel and wait for pending power_work to complete. */ | ||
4463 | __snd_hda_power_up(codec, true); | ||
4464 | } | ||
4465 | EXPORT_SYMBOL_HDA(snd_hda_power_up_d3wait); | ||
4466 | |||
4435 | #define power_save(codec) \ | 4467 | #define power_save(codec) \ |
4436 | ((codec)->bus->power_save ? *(codec)->bus->power_save : 0) | 4468 | ((codec)->bus->power_save ? *(codec)->bus->power_save : 0) |
4437 | 4469 | ||
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 4fc3960c8591..2fdaadbb4326 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -1056,10 +1056,12 @@ const char *snd_hda_get_jack_location(u32 cfg); | |||
1056 | */ | 1056 | */ |
1057 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1057 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
1058 | void snd_hda_power_up(struct hda_codec *codec); | 1058 | void snd_hda_power_up(struct hda_codec *codec); |
1059 | void snd_hda_power_up_d3wait(struct hda_codec *codec); | ||
1059 | void snd_hda_power_down(struct hda_codec *codec); | 1060 | void snd_hda_power_down(struct hda_codec *codec); |
1060 | void snd_hda_update_power_acct(struct hda_codec *codec); | 1061 | void snd_hda_update_power_acct(struct hda_codec *codec); |
1061 | #else | 1062 | #else |
1062 | static inline void snd_hda_power_up(struct hda_codec *codec) {} | 1063 | static inline void snd_hda_power_up(struct hda_codec *codec) {} |
1064 | static inline void snd_hda_power_up_d3wait(struct hda_codec *codec) {} | ||
1063 | static inline void snd_hda_power_down(struct hda_codec *codec) {} | 1065 | static inline void snd_hda_power_down(struct hda_codec *codec) {} |
1064 | #endif | 1066 | #endif |
1065 | 1067 | ||
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 2b6392be451c..7757536b9d5f 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -1766,7 +1766,7 @@ static int azx_pcm_open(struct snd_pcm_substream *substream) | |||
1766 | buff_step); | 1766 | buff_step); |
1767 | snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, | 1767 | snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, |
1768 | buff_step); | 1768 | buff_step); |
1769 | snd_hda_power_up(apcm->codec); | 1769 | snd_hda_power_up_d3wait(apcm->codec); |
1770 | err = hinfo->ops.open(hinfo, apcm->codec, substream); | 1770 | err = hinfo->ops.open(hinfo, apcm->codec, substream); |
1771 | if (err < 0) { | 1771 | if (err < 0) { |
1772 | azx_release_device(azx_dev); | 1772 | azx_release_device(azx_dev); |
@@ -2484,9 +2484,9 @@ static void azx_notifier_unregister(struct azx *chip) | |||
2484 | static int DELAYED_INIT_MARK azx_first_init(struct azx *chip); | 2484 | static int DELAYED_INIT_MARK azx_first_init(struct azx *chip); |
2485 | static int DELAYED_INIT_MARK azx_probe_continue(struct azx *chip); | 2485 | static int DELAYED_INIT_MARK azx_probe_continue(struct azx *chip); |
2486 | 2486 | ||
2487 | #ifdef SUPPORT_VGA_SWITCHEROO | ||
2487 | static struct pci_dev __devinit *get_bound_vga(struct pci_dev *pci); | 2488 | static struct pci_dev __devinit *get_bound_vga(struct pci_dev *pci); |
2488 | 2489 | ||
2489 | #ifdef SUPPORT_VGA_SWITCHEROO | ||
2490 | static void azx_vs_set_state(struct pci_dev *pci, | 2490 | static void azx_vs_set_state(struct pci_dev *pci, |
2491 | enum vga_switcheroo_state state) | 2491 | enum vga_switcheroo_state state) |
2492 | { | 2492 | { |
@@ -2578,6 +2578,7 @@ static int __devinit register_vga_switcheroo(struct azx *chip) | |||
2578 | #else | 2578 | #else |
2579 | #define init_vga_switcheroo(chip) /* NOP */ | 2579 | #define init_vga_switcheroo(chip) /* NOP */ |
2580 | #define register_vga_switcheroo(chip) 0 | 2580 | #define register_vga_switcheroo(chip) 0 |
2581 | #define check_hdmi_disabled(pci) false | ||
2581 | #endif /* SUPPORT_VGA_SWITCHER */ | 2582 | #endif /* SUPPORT_VGA_SWITCHER */ |
2582 | 2583 | ||
2583 | /* | 2584 | /* |
@@ -2638,6 +2639,7 @@ static int azx_dev_free(struct snd_device *device) | |||
2638 | return azx_free(device->device_data); | 2639 | return azx_free(device->device_data); |
2639 | } | 2640 | } |
2640 | 2641 | ||
2642 | #ifdef SUPPORT_VGA_SWITCHEROO | ||
2641 | /* | 2643 | /* |
2642 | * Check of disabled HDMI controller by vga-switcheroo | 2644 | * Check of disabled HDMI controller by vga-switcheroo |
2643 | */ | 2645 | */ |
@@ -2670,12 +2672,13 @@ static bool __devinit check_hdmi_disabled(struct pci_dev *pci) | |||
2670 | struct pci_dev *p = get_bound_vga(pci); | 2672 | struct pci_dev *p = get_bound_vga(pci); |
2671 | 2673 | ||
2672 | if (p) { | 2674 | if (p) { |
2673 | if (vga_default_device() && p != vga_default_device()) | 2675 | if (vga_switcheroo_get_client_state(p) == VGA_SWITCHEROO_OFF) |
2674 | vga_inactive = true; | 2676 | vga_inactive = true; |
2675 | pci_dev_put(p); | 2677 | pci_dev_put(p); |
2676 | } | 2678 | } |
2677 | return vga_inactive; | 2679 | return vga_inactive; |
2678 | } | 2680 | } |
2681 | #endif /* SUPPORT_VGA_SWITCHEROO */ | ||
2679 | 2682 | ||
2680 | /* | 2683 | /* |
2681 | * white/black-listing for position_fix | 2684 | * white/black-listing for position_fix |
@@ -3351,6 +3354,11 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = { | |||
3351 | { PCI_DEVICE(0x6549, 0x1200), | 3354 | { PCI_DEVICE(0x6549, 0x1200), |
3352 | .driver_data = AZX_DRIVER_TERA | AZX_DCAPS_NO_64BIT }, | 3355 | .driver_data = AZX_DRIVER_TERA | AZX_DCAPS_NO_64BIT }, |
3353 | /* Creative X-Fi (CA0110-IBG) */ | 3356 | /* Creative X-Fi (CA0110-IBG) */ |
3357 | /* CTHDA chips */ | ||
3358 | { PCI_DEVICE(0x1102, 0x0010), | ||
3359 | .driver_data = AZX_DRIVER_CTHDA | AZX_DCAPS_PRESET_CTHDA }, | ||
3360 | { PCI_DEVICE(0x1102, 0x0012), | ||
3361 | .driver_data = AZX_DRIVER_CTHDA | AZX_DCAPS_PRESET_CTHDA }, | ||
3354 | #if !defined(CONFIG_SND_CTXFI) && !defined(CONFIG_SND_CTXFI_MODULE) | 3362 | #if !defined(CONFIG_SND_CTXFI) && !defined(CONFIG_SND_CTXFI_MODULE) |
3355 | /* the following entry conflicts with snd-ctxfi driver, | 3363 | /* the following entry conflicts with snd-ctxfi driver, |
3356 | * as ctxfi driver mutates from HD-audio to native mode with | 3364 | * as ctxfi driver mutates from HD-audio to native mode with |
@@ -3367,11 +3375,6 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = { | |||
3367 | .driver_data = AZX_DRIVER_CTX | AZX_DCAPS_CTX_WORKAROUND | | 3375 | .driver_data = AZX_DRIVER_CTX | AZX_DCAPS_CTX_WORKAROUND | |
3368 | AZX_DCAPS_RIRB_PRE_DELAY | AZX_DCAPS_POSFIX_LPIB }, | 3376 | AZX_DCAPS_RIRB_PRE_DELAY | AZX_DCAPS_POSFIX_LPIB }, |
3369 | #endif | 3377 | #endif |
3370 | /* CTHDA chips */ | ||
3371 | { PCI_DEVICE(0x1102, 0x0010), | ||
3372 | .driver_data = AZX_DRIVER_CTHDA | AZX_DCAPS_PRESET_CTHDA }, | ||
3373 | { PCI_DEVICE(0x1102, 0x0012), | ||
3374 | .driver_data = AZX_DRIVER_CTHDA | AZX_DCAPS_PRESET_CTHDA }, | ||
3375 | /* Vortex86MX */ | 3378 | /* Vortex86MX */ |
3376 | { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC }, | 3379 | { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC }, |
3377 | /* VMware HDAudio */ | 3380 | /* VMware HDAudio */ |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 3acb5824ad39..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 | ||
446 | static void conexant_free(struct hda_codec *codec) | 446 | static 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 | ||
452 | static const struct snd_kcontrol_new cxt_capture_mixers[] = { | 454 | static const struct snd_kcontrol_new cxt_capture_mixers[] = { |
@@ -4061,7 +4063,7 @@ static void cx_auto_init_digital(struct hda_codec *codec) | |||
4061 | static int cx_auto_init(struct hda_codec *codec) | 4063 | static int cx_auto_init(struct hda_codec *codec) |
4062 | { | 4064 | { |
4063 | struct conexant_spec *spec = codec->spec; | 4065 | struct conexant_spec *spec = codec->spec; |
4064 | /*snd_hda_sequence_write(codec, cx_auto_init_verbs);*/ | 4066 | snd_hda_gen_apply_verbs(codec); |
4065 | cx_auto_init_output(codec); | 4067 | cx_auto_init_output(codec); |
4066 | cx_auto_init_input(codec); | 4068 | cx_auto_init_input(codec); |
4067 | cx_auto_init_digital(codec); | 4069 | cx_auto_init_digital(codec); |
@@ -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 224410e8e9e7..aa4c25e0f327 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1896,6 +1896,7 @@ static int alc_init(struct hda_codec *codec) | |||
1896 | alc_fix_pll(codec); | 1896 | alc_fix_pll(codec); |
1897 | alc_auto_init_amp(codec, spec->init_amp); | 1897 | alc_auto_init_amp(codec, spec->init_amp); |
1898 | 1898 | ||
1899 | snd_hda_gen_apply_verbs(codec); | ||
1899 | alc_init_special_input_src(codec); | 1900 | alc_init_special_input_src(codec); |
1900 | alc_auto_init_std(codec); | 1901 | alc_auto_init_std(codec); |
1901 | 1902 | ||
@@ -2288,6 +2289,7 @@ static void alc_free(struct hda_codec *codec) | |||
2288 | alc_shutup(codec); | 2289 | alc_shutup(codec); |
2289 | alc_free_kctls(codec); | 2290 | alc_free_kctls(codec); |
2290 | alc_free_bind_ctls(codec); | 2291 | alc_free_bind_ctls(codec); |
2292 | snd_hda_gen_free(&spec->gen); | ||
2291 | kfree(spec); | 2293 | kfree(spec); |
2292 | snd_hda_detach_beep_device(codec); | 2294 | snd_hda_detach_beep_device(codec); |
2293 | } | 2295 | } |
@@ -4252,6 +4254,7 @@ static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) | |||
4252 | return -ENOMEM; | 4254 | return -ENOMEM; |
4253 | codec->spec = spec; | 4255 | codec->spec = spec; |
4254 | spec->mixer_nid = mixer_nid; | 4256 | spec->mixer_nid = mixer_nid; |
4257 | snd_hda_gen_init(&spec->gen); | ||
4255 | 4258 | ||
4256 | err = alc_codec_rename_from_preset(codec); | 4259 | err = alc_codec_rename_from_preset(codec); |
4257 | if (err < 0) { | 4260 | if (err < 0) { |
@@ -6439,6 +6442,7 @@ enum { | |||
6439 | ALC662_FIXUP_ASUS_MODE7, | 6442 | ALC662_FIXUP_ASUS_MODE7, |
6440 | ALC662_FIXUP_ASUS_MODE8, | 6443 | ALC662_FIXUP_ASUS_MODE8, |
6441 | ALC662_FIXUP_NO_JACK_DETECT, | 6444 | ALC662_FIXUP_NO_JACK_DETECT, |
6445 | ALC662_FIXUP_ZOTAC_Z68, | ||
6442 | }; | 6446 | }; |
6443 | 6447 | ||
6444 | static const struct alc_fixup alc662_fixups[] = { | 6448 | static const struct alc_fixup alc662_fixups[] = { |
@@ -6588,6 +6592,13 @@ static const struct alc_fixup alc662_fixups[] = { | |||
6588 | .type = ALC_FIXUP_FUNC, | 6592 | .type = ALC_FIXUP_FUNC, |
6589 | .v.func = alc_fixup_no_jack_detect, | 6593 | .v.func = alc_fixup_no_jack_detect, |
6590 | }, | 6594 | }, |
6595 | [ALC662_FIXUP_ZOTAC_Z68] = { | ||
6596 | .type = ALC_FIXUP_PINS, | ||
6597 | .v.pins = (const struct alc_pincfg[]) { | ||
6598 | { 0x1b, 0x02214020 }, /* Front HP */ | ||
6599 | { } | ||
6600 | } | ||
6601 | }, | ||
6591 | }; | 6602 | }; |
6592 | 6603 | ||
6593 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { | 6604 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
@@ -6601,6 +6612,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { | |||
6601 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), | 6612 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
6602 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), | 6613 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
6603 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), | 6614 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
6615 | SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), | ||
6604 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), | 6616 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
6605 | 6617 | ||
6606 | #if 0 | 6618 | #if 0 |
@@ -6676,6 +6688,31 @@ static const struct alc_model_fixup alc662_fixup_models[] = { | |||
6676 | {} | 6688 | {} |
6677 | }; | 6689 | }; |
6678 | 6690 | ||
6691 | static void alc662_fill_coef(struct hda_codec *codec) | ||
6692 | { | ||
6693 | int val, coef; | ||
6694 | |||
6695 | coef = alc_get_coef0(codec); | ||
6696 | |||
6697 | switch (codec->vendor_id) { | ||
6698 | case 0x10ec0662: | ||
6699 | if ((coef & 0x00f0) == 0x0030) { | ||
6700 | val = alc_read_coef_idx(codec, 0x4); /* EAPD Ctrl */ | ||
6701 | alc_write_coef_idx(codec, 0x4, val & ~(1<<10)); | ||
6702 | } | ||
6703 | break; | ||
6704 | case 0x10ec0272: | ||
6705 | case 0x10ec0273: | ||
6706 | case 0x10ec0663: | ||
6707 | case 0x10ec0665: | ||
6708 | case 0x10ec0670: | ||
6709 | case 0x10ec0671: | ||
6710 | case 0x10ec0672: | ||
6711 | val = alc_read_coef_idx(codec, 0xd); /* EAPD Ctrl */ | ||
6712 | alc_write_coef_idx(codec, 0xd, val | (1<<14)); | ||
6713 | break; | ||
6714 | } | ||
6715 | } | ||
6679 | 6716 | ||
6680 | /* | 6717 | /* |
6681 | */ | 6718 | */ |
@@ -6695,12 +6732,8 @@ static int patch_alc662(struct hda_codec *codec) | |||
6695 | 6732 | ||
6696 | alc_fix_pll_init(codec, 0x20, 0x04, 15); | 6733 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
6697 | 6734 | ||
6698 | if ((alc_get_coef0(codec) & (1 << 14)) && | 6735 | spec->init_hook = alc662_fill_coef; |
6699 | codec->bus->pci->subsystem_vendor == 0x1025 && | 6736 | alc662_fill_coef(codec); |
6700 | spec->cdefine.platform_type == 1) { | ||
6701 | if (alc_codec_rename(codec, "ALC272X") < 0) | ||
6702 | goto error; | ||
6703 | } | ||
6704 | 6737 | ||
6705 | alc_pick_fixup(codec, alc662_fixup_models, | 6738 | alc_pick_fixup(codec, alc662_fixup_models, |
6706 | alc662_fixup_tbl, alc662_fixups); | 6739 | alc662_fixup_tbl, alc662_fixups); |
@@ -6708,6 +6741,13 @@ static int patch_alc662(struct hda_codec *codec) | |||
6708 | 6741 | ||
6709 | alc_auto_parse_customize_define(codec); | 6742 | alc_auto_parse_customize_define(codec); |
6710 | 6743 | ||
6744 | if ((alc_get_coef0(codec) & (1 << 14)) && | ||
6745 | codec->bus->pci->subsystem_vendor == 0x1025 && | ||
6746 | spec->cdefine.platform_type == 1) { | ||
6747 | if (alc_codec_rename(codec, "ALC272X") < 0) | ||
6748 | goto error; | ||
6749 | } | ||
6750 | |||
6711 | /* automatic parse from the BIOS config */ | 6751 | /* automatic parse from the BIOS config */ |
6712 | err = alc662_parse_auto_config(codec); | 6752 | err = alc662_parse_auto_config(codec); |
6713 | if (err < 0) | 6753 | if (err < 0) |
@@ -6790,6 +6830,7 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = { | |||
6790 | { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 }, | 6830 | { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 }, |
6791 | { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 }, | 6831 | { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 }, |
6792 | { .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 }, | 6832 | { .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 }, |
6833 | { .id = 0x10ec0280, .name = "ALC280", .patch = patch_alc269 }, | ||
6793 | { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", | 6834 | { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", |
6794 | .patch = patch_alc861 }, | 6835 | .patch = patch_alc861 }, |
6795 | { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd }, | 6836 | { .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 || |