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-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"A slightly higher volume than a new year's wish, but not too
worrisome: a large LOC is only for HD-audio device-specific quirks, so
fairly safe to apply. The rest ASoC fixes are all trivial and small;
a simple replacement of mutex call with nested lock version, a few
Arizona and Realtek codec fixes, and a regression fix for Skylake
firmware handling"

* tag 'sound-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ASoC: Intel: Skylake: Fix the memory leak
ASoC: Intel: Skylake: Revert previous broken fix memory leak fix
ASoC: Use nested lock for snd_soc_dapm_mutex_lock
ASoC: rt5645: add sys clk detection
ALSA: hda - Add keycode map for alc input device
ALSA: hda - Add mic mute hotkey quirk for Lenovo ThinkCentre AIO
ASoC: arizona: Fix bclk for sample rates that are multiple of 4kHz

+104 -18
+1 -1
include/sound/soc.h
··· 1655 1655 /* Helper functions */ 1656 1656 static inline void snd_soc_dapm_mutex_lock(struct snd_soc_dapm_context *dapm) 1657 1657 { 1658 - mutex_lock(&dapm->card->dapm_mutex); 1658 + mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); 1659 1659 } 1660 1660 1661 1661 static inline void snd_soc_dapm_mutex_unlock(struct snd_soc_dapm_context *dapm)
+86 -15
sound/pci/hda/patch_realtek.c
··· 67 67 ALC_HEADSET_TYPE_OMTP, 68 68 }; 69 69 70 + enum { 71 + ALC_KEY_MICMUTE_INDEX, 72 + }; 73 + 70 74 struct alc_customize_define { 71 75 unsigned int sku_cfg; 72 76 unsigned char port_connectivity; ··· 127 123 unsigned int pll_coef_idx, pll_coef_bit; 128 124 unsigned int coef0; 129 125 struct input_dev *kb_dev; 126 + u8 alc_mute_keycode_map[1]; 130 127 }; 131 128 132 129 /* ··· 3467 3462 3468 3463 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore 3469 3464 send both key on and key off event for every interrupt. */ 3470 - input_report_key(spec->kb_dev, KEY_MICMUTE, 1); 3465 + input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1); 3471 3466 input_sync(spec->kb_dev); 3472 - input_report_key(spec->kb_dev, KEY_MICMUTE, 0); 3467 + input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0); 3473 3468 input_sync(spec->kb_dev); 3469 + } 3470 + 3471 + static int alc_register_micmute_input_device(struct hda_codec *codec) 3472 + { 3473 + struct alc_spec *spec = codec->spec; 3474 + int i; 3475 + 3476 + spec->kb_dev = input_allocate_device(); 3477 + if (!spec->kb_dev) { 3478 + codec_err(codec, "Out of memory (input_allocate_device)\n"); 3479 + return -ENOMEM; 3480 + } 3481 + 3482 + spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE; 3483 + 3484 + spec->kb_dev->name = "Microphone Mute Button"; 3485 + spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY); 3486 + spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]); 3487 + spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map); 3488 + spec->kb_dev->keycode = spec->alc_mute_keycode_map; 3489 + for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++) 3490 + set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit); 3491 + 3492 + if (input_register_device(spec->kb_dev)) { 3493 + codec_err(codec, "input_register_device failed\n"); 3494 + input_free_device(spec->kb_dev); 3495 + spec->kb_dev = NULL; 3496 + return -ENOMEM; 3497 + } 3498 + 3499 + return 0; 3474 3500 } 3475 3501 3476 3502 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, ··· 3521 3485 struct alc_spec *spec = codec->spec; 3522 3486 3523 3487 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 3524 - spec->kb_dev = input_allocate_device(); 3525 - if (!spec->kb_dev) { 3526 - codec_err(codec, "Out of memory (input_allocate_device)\n"); 3488 + if (alc_register_micmute_input_device(codec) != 0) 3527 3489 return; 3528 - } 3529 - spec->kb_dev->name = "Microphone Mute Button"; 3530 - spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY); 3531 - spec->kb_dev->keybit[BIT_WORD(KEY_MICMUTE)] = BIT_MASK(KEY_MICMUTE); 3532 - if (input_register_device(spec->kb_dev)) { 3533 - codec_err(codec, "input_register_device failed\n"); 3534 - input_free_device(spec->kb_dev); 3535 - spec->kb_dev = NULL; 3536 - return; 3537 - } 3538 3490 3539 3491 snd_hda_add_verbs(codec, gpio_init); 3540 3492 snd_hda_codec_write_cache(codec, codec->core.afg, 0, ··· 3536 3512 spec->mute_led_polarity = 0; 3537 3513 spec->gpio_mute_led_mask = 0x08; 3538 3514 spec->gpio_mic_led_mask = 0x10; 3515 + return; 3516 + } 3517 + 3518 + if (!spec->kb_dev) 3519 + return; 3520 + 3521 + switch (action) { 3522 + case HDA_FIXUP_ACT_PROBE: 3523 + spec->init_amp = ALC_INIT_DEFAULT; 3524 + break; 3525 + case HDA_FIXUP_ACT_FREE: 3526 + input_unregister_device(spec->kb_dev); 3527 + spec->kb_dev = NULL; 3528 + } 3529 + } 3530 + 3531 + static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, 3532 + const struct hda_fixup *fix, int action) 3533 + { 3534 + /* Line2 = mic mute hotkey 3535 + GPIO2 = mic mute LED */ 3536 + static const struct hda_verb gpio_init[] = { 3537 + { 0x01, AC_VERB_SET_GPIO_MASK, 0x04 }, 3538 + { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04 }, 3539 + {} 3540 + }; 3541 + 3542 + struct alc_spec *spec = codec->spec; 3543 + 3544 + if (action == HDA_FIXUP_ACT_PRE_PROBE) { 3545 + if (alc_register_micmute_input_device(codec) != 0) 3546 + return; 3547 + 3548 + snd_hda_add_verbs(codec, gpio_init); 3549 + snd_hda_jack_detect_enable_callback(codec, 0x1b, 3550 + gpio2_mic_hotkey_event); 3551 + 3552 + spec->gen.cap_sync_hook = alc_fixup_gpio_mic_mute_hook; 3553 + spec->gpio_led = 0; 3554 + spec->mute_led_polarity = 0; 3555 + spec->gpio_mic_led_mask = 0x04; 3539 3556 return; 3540 3557 } 3541 3558 ··· 4693 4628 ALC275_FIXUP_DELL_XPS, 4694 4629 ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE, 4695 4630 ALC293_FIXUP_LENOVO_SPK_NOISE, 4631 + ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, 4696 4632 }; 4697 4633 4698 4634 static const struct hda_fixup alc269_fixups[] = { ··· 5303 5237 .chained = true, 5304 5238 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 5305 5239 }, 5240 + [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = { 5241 + .type = HDA_FIXUP_FUNC, 5242 + .v.func = alc233_fixup_lenovo_line2_mic_hotkey, 5243 + }, 5306 5244 }; 5307 5245 5308 5246 static const struct snd_pci_quirk alc269_fixup_tbl[] = { ··· 5456 5386 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), 5457 5387 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), 5458 5388 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), 5389 + SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 5459 5390 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), 5460 5391 SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP), 5461 5392 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
+1 -1
sound/soc/codecs/arizona.c
··· 1537 1537 bool reconfig; 1538 1538 unsigned int aif_tx_state, aif_rx_state; 1539 1539 1540 - if (params_rate(params) % 8000) 1540 + if (params_rate(params) % 4000) 1541 1541 rates = &arizona_44k1_bclk_rates[0]; 1542 1542 else 1543 1543 rates = &arizona_48k_bclk_rates[0];
+4
sound/soc/codecs/rt5645.c
··· 1667 1667 RT5645_PWR_CLS_D_L, 1668 1668 RT5645_PWR_CLS_D | RT5645_PWR_CLS_D_R | 1669 1669 RT5645_PWR_CLS_D_L); 1670 + snd_soc_update_bits(codec, RT5645_GEN_CTRL3, 1671 + RT5645_DET_CLK_MASK, RT5645_DET_CLK_MODE1); 1670 1672 break; 1671 1673 1672 1674 case SND_SOC_DAPM_PRE_PMD: 1675 + snd_soc_update_bits(codec, RT5645_GEN_CTRL3, 1676 + RT5645_DET_CLK_MASK, RT5645_DET_CLK_DIS); 1673 1677 snd_soc_write(codec, RT5645_EQ_CTRL2, 0); 1674 1678 snd_soc_update_bits(codec, RT5645_PWR_DIG1, 1675 1679 RT5645_PWR_CLS_D | RT5645_PWR_CLS_D_R |
+4
sound/soc/codecs/rt5645.h
··· 2122 2122 /* General Control3 (0xfc) */ 2123 2123 #define RT5645_JD_PSV_MODE (0x1 << 12) 2124 2124 #define RT5645_IRQ_CLK_GATE_CTRL (0x1 << 11) 2125 + #define RT5645_DET_CLK_MASK (0x3 << 9) 2126 + #define RT5645_DET_CLK_DIS (0x0 << 9) 2127 + #define RT5645_DET_CLK_MODE1 (0x1 << 9) 2128 + #define RT5645_DET_CLK_MODE2 (0x2 << 9) 2125 2129 #define RT5645_MICINDET_MANU (0x1 << 7) 2126 2130 #define RT5645_RING2_SLEEVE_GND (0x1 << 5) 2127 2131
+2 -1
sound/soc/intel/skylake/skl-topology.c
··· 1240 1240 */ 1241 1241 ret = snd_soc_tplg_component_load(&platform->component, 1242 1242 &skl_tplg_ops, fw, 0); 1243 - release_firmware(fw); 1244 1243 if (ret < 0) { 1245 1244 dev_err(bus->dev, "tplg component load failed%d\n", ret); 1246 1245 return -EINVAL; ··· 1247 1248 1248 1249 skl->resource.max_mcps = SKL_MAX_MCPS; 1249 1250 skl->resource.max_mem = SKL_FW_MAX_MEM; 1251 + 1252 + skl->tplg = fw; 1250 1253 1251 1254 return 0; 1252 1255 }
+4
sound/soc/intel/skylake/skl.c
··· 25 25 #include <linux/pci.h> 26 26 #include <linux/pm_runtime.h> 27 27 #include <linux/platform_device.h> 28 + #include <linux/firmware.h> 28 29 #include <sound/pcm.h> 29 30 #include "skl.h" 30 31 ··· 520 519 { 521 520 struct hdac_ext_bus *ebus = pci_get_drvdata(pci); 522 521 struct skl *skl = ebus_to_skl(ebus); 522 + 523 + if (skl->tplg) 524 + release_firmware(skl->tplg); 523 525 524 526 if (pci_dev_run_wake(pci)) 525 527 pm_runtime_get_noresume(&pci->dev);
+2
sound/soc/intel/skylake/skl.h
··· 68 68 struct skl_dsp_resource resource; 69 69 struct list_head ppl_list; 70 70 struct list_head dapm_path_list; 71 + 72 + const struct firmware *tplg; 71 73 }; 72 74 73 75 #define skl_to_ebus(s) (&(s)->ebus)