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

Pull sound fixes from Takashi Iwai:
"Quite a few small fixes, hopefully the last batch for 5.16.

Most of them are device-specific quirks and/or fixes, and nothing
looks scary for the late stage"

* tag 'sound-5.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda/realtek: Fix quirk for Clevo NJ51CU
ALSA: rawmidi - fix the uninitalized user_pversion
ALSA: hda: intel-sdw-acpi: go through HDAS ACPI at max depth of 2
ALSA: hda: intel-sdw-acpi: harden detection of controller
ALSA: hda/hdmi: Disable silent stream on GLK
ALSA: hda/realtek: fix mute/micmute LEDs for a HP ProBook
ASoC: meson: aiu: Move AIU_I2S_MISC hold setting to aiu-fifo-i2s
ASoC: meson: aiu: fifo: Add missing dma_coerce_mask_and_coherent()
ASoC: tas2770: Fix setting of high sample rates
ASoC: rt5682: fix the wrong jack type detected
ALSA: hda/realtek: Add new alc285-hp-amp-init model
ALSA: hda/realtek: Amp init fixup for HP ZBook 15 G6
ASoC: tegra: Restore headphones jack name on Nyan Big
ASoC: tegra: Add DAPM switches for headphones and mic jack
ALSA: jack: Check the return value of kstrdup()
ALSA: drivers: opl3: Fix incorrect use of vp->state
ASoC: SOF: Intel: pci-tgl: add new ADL-P variant
ASoC: SOF: Intel: pci-tgl: add ADL-N support

+107 -47
+2
Documentation/sound/hd-audio/models.rst
··· 326 326 Headset support on USI machines 327 327 dual-codecs 328 328 Lenovo laptops with dual codecs 329 + alc285-hp-amp-init 330 + HP laptops which require speaker amplifier initialization (ALC285) 329 331 330 332 ALC680 331 333 ======
+4
sound/core/jack.c
··· 509 509 return -ENOMEM; 510 510 511 511 jack->id = kstrdup(id, GFP_KERNEL); 512 + if (jack->id == NULL) { 513 + kfree(jack); 514 + return -ENOMEM; 515 + } 512 516 513 517 /* don't creat input device for phantom jack */ 514 518 if (!phantom_jack) {
+1
sound/core/rawmidi.c
··· 447 447 err = -ENOMEM; 448 448 goto __error; 449 449 } 450 + rawmidi_file->user_pversion = 0; 450 451 init_waitqueue_entry(&wait, current); 451 452 add_wait_queue(&rmidi->open_wait, &wait); 452 453 while (1) {
+1 -1
sound/drivers/opl3/opl3_midi.c
··· 397 397 } 398 398 if (instr_4op) { 399 399 vp2 = &opl3->voices[voice + 3]; 400 - if (vp->state > 0) { 400 + if (vp2->state > 0) { 401 401 opl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK + 402 402 voice_offset + 3); 403 403 reg_val = vp->keyon_reg & ~OPL3_KEYON_BIT;
+10 -3
sound/hda/intel-sdw-acpi.c
··· 132 132 return AE_NOT_FOUND; 133 133 } 134 134 135 - info->handle = handle; 136 - 137 135 /* 138 136 * On some Intel platforms, multiple children of the HDAS 139 137 * device can be found, but only one of them is the SoundWire ··· 141 143 */ 142 144 if (FIELD_GET(GENMASK(31, 28), adr) != SDW_LINK_TYPE) 143 145 return AE_OK; /* keep going */ 146 + 147 + /* found the correct SoundWire controller */ 148 + info->handle = handle; 144 149 145 150 /* device found, stop namespace walk */ 146 151 return AE_CTRL_TERMINATE; ··· 165 164 acpi_status status; 166 165 167 166 info->handle = NULL; 167 + /* 168 + * In the HDAS ACPI scope, 'SNDW' may be either the child of 169 + * 'HDAS' or the grandchild of 'HDAS'. So let's go through 170 + * the ACPI from 'HDAS' at max depth of 2 to find the 'SNDW' 171 + * device. 172 + */ 168 173 status = acpi_walk_namespace(ACPI_TYPE_DEVICE, 169 - parent_handle, 1, 174 + parent_handle, 2, 170 175 sdw_intel_acpi_cb, 171 176 NULL, info, NULL); 172 177 if (ACPI_FAILURE(status) || info->handle == NULL)
+15 -6
sound/pci/hda/patch_hdmi.c
··· 2947 2947 2948 2948 /* Intel Haswell and onwards; audio component with eld notifier */ 2949 2949 static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid, 2950 - const int *port_map, int port_num, int dev_num) 2950 + const int *port_map, int port_num, int dev_num, 2951 + bool send_silent_stream) 2951 2952 { 2952 2953 struct hdmi_spec *spec; 2953 2954 int err; ··· 2981 2980 * Enable silent stream feature, if it is enabled via 2982 2981 * module param or Kconfig option 2983 2982 */ 2984 - if (enable_silent_stream) 2983 + if (send_silent_stream) 2985 2984 spec->send_silent_stream = true; 2986 2985 2987 2986 return parse_intel_hdmi(codec); ··· 2989 2988 2990 2989 static int patch_i915_hsw_hdmi(struct hda_codec *codec) 2991 2990 { 2992 - return intel_hsw_common_init(codec, 0x08, NULL, 0, 3); 2991 + return intel_hsw_common_init(codec, 0x08, NULL, 0, 3, 2992 + enable_silent_stream); 2993 2993 } 2994 2994 2995 2995 static int patch_i915_glk_hdmi(struct hda_codec *codec) 2996 2996 { 2997 - return intel_hsw_common_init(codec, 0x0b, NULL, 0, 3); 2997 + /* 2998 + * Silent stream calls audio component .get_power() from 2999 + * .pin_eld_notify(). On GLK this will deadlock in i915 due 3000 + * to the audio vs. CDCLK workaround. 3001 + */ 3002 + return intel_hsw_common_init(codec, 0x0b, NULL, 0, 3, false); 2998 3003 } 2999 3004 3000 3005 static int patch_i915_icl_hdmi(struct hda_codec *codec) ··· 3011 3004 */ 3012 3005 static const int map[] = {0x0, 0x4, 0x6, 0x8, 0xa, 0xb}; 3013 3006 3014 - return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 3); 3007 + return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 3, 3008 + enable_silent_stream); 3015 3009 } 3016 3010 3017 3011 static int patch_i915_tgl_hdmi(struct hda_codec *codec) ··· 3024 3016 static const int map[] = {0x4, 0x6, 0x8, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}; 3025 3017 int ret; 3026 3018 3027 - ret = intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 4); 3019 + ret = intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 4, 3020 + enable_silent_stream); 3028 3021 if (!ret) { 3029 3022 struct hdmi_spec *spec = codec->spec; 3030 3023
+28 -1
sound/pci/hda/patch_realtek.c
··· 6546 6546 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs); 6547 6547 } 6548 6548 6549 + static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec, 6550 + const struct hda_fixup *fix, 6551 + int action) 6552 + { 6553 + /* 6554 + * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec, 6555 + * but uses the 0x8686 subproduct id in both cases. The ALC256 codec 6556 + * needs an additional quirk for sound working after suspend and resume. 6557 + */ 6558 + if (codec->core.vendor_id == 0x10ec0256) { 6559 + alc_update_coef_idx(codec, 0x10, 1<<9, 0); 6560 + snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120); 6561 + } else { 6562 + snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c); 6563 + } 6564 + } 6565 + 6549 6566 enum { 6550 6567 ALC269_FIXUP_GPIO2, 6551 6568 ALC269_FIXUP_SONY_VAIO, ··· 6783 6766 ALC256_FIXUP_SET_COEF_DEFAULTS, 6784 6767 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE, 6785 6768 ALC233_FIXUP_NO_AUDIO_JACK, 6769 + ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME, 6786 6770 }; 6787 6771 6788 6772 static const struct hda_fixup alc269_fixups[] = { ··· 8508 8490 .type = HDA_FIXUP_FUNC, 8509 8491 .v.func = alc233_fixup_no_audio_jack, 8510 8492 }, 8493 + [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = { 8494 + .type = HDA_FIXUP_FUNC, 8495 + .v.func = alc256_fixup_mic_no_presence_and_resume, 8496 + .chained = true, 8497 + .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 8498 + }, 8511 8499 }; 8512 8500 8513 8501 static const struct snd_pci_quirk alc269_fixup_tbl[] = { ··· 8684 8660 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN), 8685 8661 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), 8686 8662 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360), 8663 + SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT), 8687 8664 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT), 8688 8665 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), 8689 8666 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO), ··· 8730 8705 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED), 8731 8706 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), 8732 8707 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED), 8708 + SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 8733 8709 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), 8734 8710 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), 8735 8711 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), ··· 8855 8829 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC), 8856 8830 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 8857 8831 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 8858 - SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 8832 + SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME), 8859 8833 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 8860 8834 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 8861 8835 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), ··· 9149 9123 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"}, 9150 9124 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"}, 9151 9125 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"}, 9126 + {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"}, 9152 9127 {} 9153 9128 }; 9154 9129 #define ALC225_STANDARD_PINS \
+4
sound/soc/codecs/rt5682.c
··· 929 929 unsigned int val, count; 930 930 931 931 if (jack_insert) { 932 + snd_soc_dapm_mutex_lock(dapm); 933 + 932 934 snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1, 933 935 RT5682_PWR_VREF2 | RT5682_PWR_MB, 934 936 RT5682_PWR_VREF2 | RT5682_PWR_MB); ··· 981 979 snd_soc_component_update_bits(component, RT5682_MICBIAS_2, 982 980 RT5682_PWR_CLK25M_MASK | RT5682_PWR_CLK1M_MASK, 983 981 RT5682_PWR_CLK25M_PU | RT5682_PWR_CLK1M_PU); 982 + 983 + snd_soc_dapm_mutex_unlock(dapm); 984 984 } else { 985 985 rt5682_enable_push_button_irq(component, false); 986 986 snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,
+2 -2
sound/soc/codecs/tas2770.c
··· 291 291 ramp_rate_val = TAS2770_TDM_CFG_REG0_SMP_44_1KHZ | 292 292 TAS2770_TDM_CFG_REG0_31_88_2_96KHZ; 293 293 break; 294 - case 19200: 294 + case 192000: 295 295 ramp_rate_val = TAS2770_TDM_CFG_REG0_SMP_48KHZ | 296 296 TAS2770_TDM_CFG_REG0_31_176_4_192KHZ; 297 297 break; 298 - case 17640: 298 + case 176400: 299 299 ramp_rate_val = TAS2770_TDM_CFG_REG0_SMP_44_1KHZ | 300 300 TAS2770_TDM_CFG_REG0_31_176_4_192KHZ; 301 301 break;
-33
sound/soc/meson/aiu-encoder-i2s.c
··· 18 18 #define AIU_RST_SOFT_I2S_FAST BIT(0) 19 19 20 20 #define AIU_I2S_DAC_CFG_MSB_FIRST BIT(2) 21 - #define AIU_I2S_MISC_HOLD_EN BIT(2) 22 21 #define AIU_CLK_CTRL_I2S_DIV_EN BIT(0) 23 22 #define AIU_CLK_CTRL_I2S_DIV GENMASK(3, 2) 24 23 #define AIU_CLK_CTRL_AOCLK_INVERT BIT(6) ··· 33 34 snd_soc_component_update_bits(component, AIU_CLK_CTRL, 34 35 AIU_CLK_CTRL_I2S_DIV_EN, 35 36 enable ? AIU_CLK_CTRL_I2S_DIV_EN : 0); 36 - } 37 - 38 - static void aiu_encoder_i2s_hold(struct snd_soc_component *component, 39 - bool enable) 40 - { 41 - snd_soc_component_update_bits(component, AIU_I2S_MISC, 42 - AIU_I2S_MISC_HOLD_EN, 43 - enable ? AIU_I2S_MISC_HOLD_EN : 0); 44 - } 45 - 46 - static int aiu_encoder_i2s_trigger(struct snd_pcm_substream *substream, int cmd, 47 - struct snd_soc_dai *dai) 48 - { 49 - struct snd_soc_component *component = dai->component; 50 - 51 - switch (cmd) { 52 - case SNDRV_PCM_TRIGGER_START: 53 - case SNDRV_PCM_TRIGGER_RESUME: 54 - case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 55 - aiu_encoder_i2s_hold(component, false); 56 - return 0; 57 - 58 - case SNDRV_PCM_TRIGGER_STOP: 59 - case SNDRV_PCM_TRIGGER_SUSPEND: 60 - case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 61 - aiu_encoder_i2s_hold(component, true); 62 - return 0; 63 - 64 - default: 65 - return -EINVAL; 66 - } 67 37 } 68 38 69 39 static int aiu_encoder_i2s_setup_desc(struct snd_soc_component *component, ··· 321 353 } 322 354 323 355 const struct snd_soc_dai_ops aiu_encoder_i2s_dai_ops = { 324 - .trigger = aiu_encoder_i2s_trigger, 325 356 .hw_params = aiu_encoder_i2s_hw_params, 326 357 .hw_free = aiu_encoder_i2s_hw_free, 327 358 .set_fmt = aiu_encoder_i2s_set_fmt,
+19
sound/soc/meson/aiu-fifo-i2s.c
··· 20 20 #define AIU_MEM_I2S_CONTROL_MODE_16BIT BIT(6) 21 21 #define AIU_MEM_I2S_BUF_CNTL_INIT BIT(0) 22 22 #define AIU_RST_SOFT_I2S_FAST BIT(0) 23 + #define AIU_I2S_MISC_HOLD_EN BIT(2) 24 + #define AIU_I2S_MISC_FORCE_LEFT_RIGHT BIT(4) 23 25 24 26 #define AIU_FIFO_I2S_BLOCK 256 25 27 ··· 92 90 unsigned int val; 93 91 int ret; 94 92 93 + snd_soc_component_update_bits(component, AIU_I2S_MISC, 94 + AIU_I2S_MISC_HOLD_EN, 95 + AIU_I2S_MISC_HOLD_EN); 96 + 95 97 ret = aiu_fifo_hw_params(substream, params, dai); 96 98 if (ret) 97 99 return ret; ··· 122 116 val = FIELD_PREP(AIU_MEM_I2S_MASKS_IRQ_BLOCK, val); 123 117 snd_soc_component_update_bits(component, AIU_MEM_I2S_MASKS, 124 118 AIU_MEM_I2S_MASKS_IRQ_BLOCK, val); 119 + 120 + /* 121 + * Most (all?) supported SoCs have this bit set by default. The vendor 122 + * driver however sets it manually (depending on the version either 123 + * while un-setting AIU_I2S_MISC_HOLD_EN or right before that). Follow 124 + * the same approach for consistency with the vendor driver. 125 + */ 126 + snd_soc_component_update_bits(component, AIU_I2S_MISC, 127 + AIU_I2S_MISC_FORCE_LEFT_RIGHT, 128 + AIU_I2S_MISC_FORCE_LEFT_RIGHT); 129 + 130 + snd_soc_component_update_bits(component, AIU_I2S_MISC, 131 + AIU_I2S_MISC_HOLD_EN, 0); 125 132 126 133 return 0; 127 134 }
+6
sound/soc/meson/aiu-fifo.c
··· 5 5 6 6 #include <linux/bitfield.h> 7 7 #include <linux/clk.h> 8 + #include <linux/dma-mapping.h> 8 9 #include <sound/pcm_params.h> 9 10 #include <sound/soc.h> 10 11 #include <sound/soc-dai.h> ··· 180 179 struct snd_card *card = rtd->card->snd_card; 181 180 struct aiu_fifo *fifo = dai->playback_dma_data; 182 181 size_t size = fifo->pcm->buffer_bytes_max; 182 + int ret; 183 + 184 + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32)); 185 + if (ret) 186 + return ret; 183 187 184 188 snd_pcm_set_managed_buffer_all(rtd->pcm, SNDRV_DMA_TYPE_DEV, 185 189 card->dev, size, size);
+4
sound/soc/sof/intel/pci-tgl.c
··· 112 112 .driver_data = (unsigned long)&adls_desc}, 113 113 { PCI_DEVICE(0x8086, 0x51c8), /* ADL-P */ 114 114 .driver_data = (unsigned long)&adl_desc}, 115 + { PCI_DEVICE(0x8086, 0x51cd), /* ADL-P */ 116 + .driver_data = (unsigned long)&adl_desc}, 115 117 { PCI_DEVICE(0x8086, 0x51cc), /* ADL-M */ 118 + .driver_data = (unsigned long)&adl_desc}, 119 + { PCI_DEVICE(0x8086, 0x54c8), /* ADL-N */ 116 120 .driver_data = (unsigned long)&adl_desc}, 117 121 { 0, } 118 122 };
+10 -1
sound/soc/tegra/tegra_asoc_machine.c
··· 116 116 SOC_DAPM_PIN_SWITCH("Headset Mic"), 117 117 SOC_DAPM_PIN_SWITCH("Internal Mic 1"), 118 118 SOC_DAPM_PIN_SWITCH("Internal Mic 2"), 119 + SOC_DAPM_PIN_SWITCH("Headphones"), 120 + SOC_DAPM_PIN_SWITCH("Mic Jack"), 119 121 }; 120 122 121 123 int tegra_asoc_machine_init(struct snd_soc_pcm_runtime *rtd) 122 124 { 123 125 struct snd_soc_card *card = rtd->card; 124 126 struct tegra_machine *machine = snd_soc_card_get_drvdata(card); 127 + const char *jack_name; 125 128 int err; 126 129 127 130 if (machine->gpiod_hp_det && machine->asoc->add_hp_jack) { 128 - err = snd_soc_card_jack_new(card, "Headphones Jack", 131 + if (machine->asoc->hp_jack_name) 132 + jack_name = machine->asoc->hp_jack_name; 133 + else 134 + jack_name = "Headphones Jack"; 135 + 136 + err = snd_soc_card_jack_new(card, jack_name, 129 137 SND_JACK_HEADPHONE, 130 138 &tegra_machine_hp_jack, 131 139 tegra_machine_hp_jack_pins, ··· 666 658 static const struct tegra_asoc_data tegra_max98090_data = { 667 659 .mclk_rate = tegra_machine_mclk_rate_12mhz, 668 660 .card = &snd_soc_tegra_max98090, 661 + .hp_jack_name = "Headphones", 669 662 .add_common_dapm_widgets = true, 670 663 .add_common_controls = true, 671 664 .add_common_snd_ops = true,
+1
sound/soc/tegra/tegra_asoc_machine.h
··· 14 14 struct tegra_asoc_data { 15 15 unsigned int (*mclk_rate)(unsigned int srate); 16 16 const char *codec_dev_name; 17 + const char *hp_jack_name; 17 18 struct snd_soc_card *card; 18 19 unsigned int mclk_id; 19 20 bool hp_jack_gpio_active_low;