Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sound-3.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"Again only fixes for HD-audio:
- regression fixes due to the modularization
- a few fixups for Dell, Sony and HP laptops
- a revert of the previous fix as it leads to another regression"

* tag 'sound-3.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: Revert "ALSA: hda/realtek - Avoid invalid COEFs for ALC271X"
ALSA: hda - Fix undefined symbol due to builtin/module mixup
ALSA: hda - Fix mic capture on Sony VAIO Pro 11
ALSA: hda - Add a headset quirk for Dell XPS 13
ALSA: hda - Fix inconsistent Mic mute LED
ALSA: hda - Fix leftover ifdef checks after modularization

+52 -40
+18 -18
sound/pci/hda/hda_codec.c
··· 932 932 } 933 933 EXPORT_SYMBOL_GPL(snd_hda_bus_new); 934 934 935 - #ifdef CONFIG_SND_HDA_GENERIC 935 + #if IS_ENABLED(CONFIG_SND_HDA_GENERIC) 936 936 #define is_generic_config(codec) \ 937 937 (codec->modelname && !strcmp(codec->modelname, "generic")) 938 938 #else ··· 1339 1339 /* 1340 1340 * Dynamic symbol binding for the codec parsers 1341 1341 */ 1342 - #ifdef MODULE 1343 - #define load_parser_sym(sym) ((int (*)(struct hda_codec *))symbol_request(sym)) 1344 - #define unload_parser_addr(addr) symbol_put_addr(addr) 1345 - #else 1346 - #define load_parser_sym(sym) (sym) 1347 - #define unload_parser_addr(addr) do {} while (0) 1348 - #endif 1349 1342 1350 1343 #define load_parser(codec, sym) \ 1351 - ((codec)->parser = load_parser_sym(sym)) 1344 + ((codec)->parser = (int (*)(struct hda_codec *))symbol_request(sym)) 1352 1345 1353 1346 static void unload_parser(struct hda_codec *codec) 1354 1347 { 1355 - if (codec->parser) { 1356 - unload_parser_addr(codec->parser); 1357 - codec->parser = NULL; 1358 - } 1348 + if (codec->parser) 1349 + symbol_put_addr(codec->parser); 1350 + codec->parser = NULL; 1359 1351 } 1360 1352 1361 1353 /* ··· 1562 1570 EXPORT_SYMBOL_GPL(snd_hda_codec_update_widgets); 1563 1571 1564 1572 1565 - #ifdef CONFIG_SND_HDA_CODEC_HDMI 1573 + #if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) 1566 1574 /* if all audio out widgets are digital, let's assume the codec as a HDMI/DP */ 1567 1575 static bool is_likely_hdmi_codec(struct hda_codec *codec) 1568 1576 { ··· 1612 1620 patch = codec->preset->patch; 1613 1621 if (!patch) { 1614 1622 unload_parser(codec); /* to be sure */ 1615 - if (is_likely_hdmi_codec(codec)) 1623 + if (is_likely_hdmi_codec(codec)) { 1624 + #if IS_MODULE(CONFIG_SND_HDA_CODEC_HDMI) 1616 1625 patch = load_parser(codec, snd_hda_parse_hdmi_codec); 1617 - #ifdef CONFIG_SND_HDA_GENERIC 1618 - if (!patch) 1619 - patch = load_parser(codec, snd_hda_parse_generic_codec); 1626 + #elif IS_BUILTIN(CONFIG_SND_HDA_CODEC_HDMI) 1627 + patch = snd_hda_parse_hdmi_codec; 1620 1628 #endif 1629 + } 1630 + if (!patch) { 1631 + #if IS_MODULE(CONFIG_SND_HDA_GENERIC) 1632 + patch = load_parser(codec, snd_hda_parse_generic_codec); 1633 + #elif IS_BUILTIN(CONFIG_SND_HDA_GENERIC) 1634 + patch = snd_hda_parse_generic_codec; 1635 + #endif 1636 + } 1621 1637 if (!patch) { 1622 1638 printk(KERN_ERR "hda-codec: No codec parser is available\n"); 1623 1639 return -ENODEV;
+4 -4
sound/pci/hda/hda_generic.c
··· 3269 3269 mutex_unlock(&codec->control_mutex); 3270 3270 snd_hda_codec_flush_cache(codec); /* flush the updates */ 3271 3271 if (err >= 0 && spec->cap_sync_hook) 3272 - spec->cap_sync_hook(codec, ucontrol); 3272 + spec->cap_sync_hook(codec, kcontrol, ucontrol); 3273 3273 return err; 3274 3274 } 3275 3275 ··· 3390 3390 return ret; 3391 3391 3392 3392 if (spec->cap_sync_hook) 3393 - spec->cap_sync_hook(codec, ucontrol); 3393 + spec->cap_sync_hook(codec, kcontrol, ucontrol); 3394 3394 3395 3395 return ret; 3396 3396 } ··· 3795 3795 return 0; 3796 3796 snd_hda_activate_path(codec, path, true, false); 3797 3797 if (spec->cap_sync_hook) 3798 - spec->cap_sync_hook(codec, NULL); 3798 + spec->cap_sync_hook(codec, NULL, NULL); 3799 3799 path_power_down_sync(codec, old_path); 3800 3800 return 1; 3801 3801 } ··· 5270 5270 } 5271 5271 5272 5272 if (spec->cap_sync_hook) 5273 - spec->cap_sync_hook(codec, NULL); 5273 + spec->cap_sync_hook(codec, NULL, NULL); 5274 5274 } 5275 5275 5276 5276 /* set right pin controls for digital I/O */
+1
sound/pci/hda/hda_generic.h
··· 274 274 void (*init_hook)(struct hda_codec *codec); 275 275 void (*automute_hook)(struct hda_codec *codec); 276 276 void (*cap_sync_hook)(struct hda_codec *codec, 277 + struct snd_kcontrol *kcontrol, 277 278 struct snd_ctl_elem_value *ucontrol); 278 279 279 280 /* PCM hooks */
+1 -1
sound/pci/hda/hda_intel.c
··· 198 198 #endif 199 199 200 200 #if defined(CONFIG_PM) && defined(CONFIG_VGA_SWITCHEROO) 201 - #ifdef CONFIG_SND_HDA_CODEC_HDMI 201 + #if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) 202 202 #define SUPPORT_VGA_SWITCHEROO 203 203 #endif 204 204 #endif
+2 -1
sound/pci/hda/patch_conexant.c
··· 3291 3291 } 3292 3292 3293 3293 static void cxt_update_headset_mode_hook(struct hda_codec *codec, 3294 - struct snd_ctl_elem_value *ucontrol) 3294 + struct snd_kcontrol *kcontrol, 3295 + struct snd_ctl_elem_value *ucontrol) 3295 3296 { 3296 3297 cxt_update_headset_mode(codec); 3297 3298 }
+8 -6
sound/pci/hda/patch_realtek.c
··· 708 708 } 709 709 710 710 static void alc_inv_dmic_hook(struct hda_codec *codec, 711 - struct snd_ctl_elem_value *ucontrol) 711 + struct snd_kcontrol *kcontrol, 712 + struct snd_ctl_elem_value *ucontrol) 712 713 { 713 714 alc_inv_dmic_sync(codec, false); 714 715 } ··· 3219 3218 3220 3219 /* turn on/off mic-mute LED per capture hook */ 3221 3220 static void alc269_fixup_hp_gpio_mic_mute_hook(struct hda_codec *codec, 3222 - struct snd_ctl_elem_value *ucontrol) 3221 + struct snd_kcontrol *kcontrol, 3222 + struct snd_ctl_elem_value *ucontrol) 3223 3223 { 3224 3224 struct alc_spec *spec = codec->spec; 3225 3225 unsigned int oldval = spec->gpio_led; ··· 3530 3528 } 3531 3529 3532 3530 static void alc_update_headset_mode_hook(struct hda_codec *codec, 3533 - struct snd_ctl_elem_value *ucontrol) 3531 + struct snd_kcontrol *kcontrol, 3532 + struct snd_ctl_elem_value *ucontrol) 3534 3533 { 3535 3534 alc_update_headset_mode(codec); 3536 3535 } ··· 4332 4329 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), 4333 4330 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), 4334 4331 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), 4332 + SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), 4335 4333 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), 4336 4334 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), 4337 4335 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), ··· 4437 4433 int val; 4438 4434 4439 4435 if (spec->codec_variant != ALC269_TYPE_ALC269VB) 4440 - return; 4441 - /* ALC271X doesn't seem to support these COEFs (bko#52181) */ 4442 - if (!strcmp(codec->chip_name, "ALC271X")) 4443 4436 return; 4444 4437 4445 4438 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { ··· 5107 5106 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), 5108 5107 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 5109 5108 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 5109 + SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 5110 5110 SND_PCI_QUIRK(0x1028, 0x0623, "Dell", ALC668_FIXUP_AUTO_MUTE), 5111 5111 SND_PCI_QUIRK(0x1028, 0x0624, "Dell", ALC668_FIXUP_AUTO_MUTE), 5112 5112 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
+17 -10
sound/pci/hda/patch_sigmatel.c
··· 194 194 int default_polarity; 195 195 196 196 unsigned int mic_mute_led_gpio; /* capture mute LED GPIO */ 197 - bool mic_mute_led_on; /* current mic mute state */ 197 + unsigned int mic_enabled; /* current mic mute state (bitmask) */ 198 198 199 199 /* stream */ 200 200 unsigned int stream_delay; ··· 324 324 325 325 /* hook for controlling mic-mute LED GPIO */ 326 326 static void stac_capture_led_hook(struct hda_codec *codec, 327 - struct snd_ctl_elem_value *ucontrol) 327 + struct snd_kcontrol *kcontrol, 328 + struct snd_ctl_elem_value *ucontrol) 328 329 { 329 330 struct sigmatel_spec *spec = codec->spec; 330 - bool mute; 331 + unsigned int mask; 332 + bool cur_mute, prev_mute; 331 333 332 - if (!ucontrol) 334 + if (!kcontrol || !ucontrol) 333 335 return; 334 336 335 - mute = !(ucontrol->value.integer.value[0] || 336 - ucontrol->value.integer.value[1]); 337 - if (spec->mic_mute_led_on != mute) { 338 - spec->mic_mute_led_on = mute; 339 - if (mute) 337 + mask = 1U << snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 338 + prev_mute = !spec->mic_enabled; 339 + if (ucontrol->value.integer.value[0] || 340 + ucontrol->value.integer.value[1]) 341 + spec->mic_enabled |= mask; 342 + else 343 + spec->mic_enabled &= ~mask; 344 + cur_mute = !spec->mic_enabled; 345 + if (cur_mute != prev_mute) { 346 + if (cur_mute) 340 347 spec->gpio_data |= spec->mic_mute_led_gpio; 341 348 else 342 349 spec->gpio_data &= ~spec->mic_mute_led_gpio; ··· 4469 4462 if (spec->mic_mute_led_gpio) { 4470 4463 spec->gpio_mask |= spec->mic_mute_led_gpio; 4471 4464 spec->gpio_dir |= spec->mic_mute_led_gpio; 4472 - spec->mic_mute_led_on = true; 4465 + spec->mic_enabled = 0; 4473 4466 spec->gpio_data |= spec->mic_mute_led_gpio; 4474 4467 4475 4468 spec->gen.cap_sync_hook = stac_capture_led_hook;
+1
sound/pci/hda/thinkpad_helper.c
··· 39 39 } 40 40 41 41 static void update_tpacpi_micmute_led(struct hda_codec *codec, 42 + struct snd_kcontrol *kcontrol, 42 43 struct snd_ctl_elem_value *ucontrol) 43 44 { 44 45 if (!ucontrol || !led_set_func)