Pull sound fixes from Takashi Iwai: "A collection of small fixes for 5.19 merge window. Nothing particular stands out, as most changes are device-specific fixes and quirks" * tag 'sound-fix-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: selftests: alsa: Handle pkg-config failure more gracefully ALSA: usb-audio: Optimize TEAC clock quirk ASoC: da7219: cancel AAD related work earlier for jack removal ASoC: da7219: Fix pole orientation detection on certain headsets ASoC: Intel: avs: Fix build error on arc, m68k and sparc ALSA: hda/realtek - Fix microphone noise on ASUS TUF B550M-PLUS ALSA: hda/via: Delete does not require return ALSA: hda/realtek: Enable 4-speaker output for Dell XPS 15 9520 laptop ASoC: Intel: common: fix typo for tplg naming ALSA: usb-audio: Cancel pending work at closing a MIDI substream ALSA: usb-audio: Add mixer mapping for Gigabyte B450/550 Mobos ASoC: rt5640: Do not manipulate pin "Platform Clock" if the "Platform Clock" is not in the DAPM ASoC: SOF: amd: Fixed Build error ASoC: fsl_sai: Fix FSL_SAI_xDR/xFR definition ASoC: soc-pcm: fix BE transition for TRIGGER_START
Unified · Split
| @@ -1981,6 +1981,7 @@ enum { · 1980 unmodified lines | ||
| 1981 | 1981 | ALC1220_FIXUP_CLEVO_PB51ED_PINS, |
| 1982 | 1982 | ALC887_FIXUP_ASUS_AUDIO, |
| 1983 | 1983 | ALC887_FIXUP_ASUS_HMIC, |
| 1984 | + ALCS1200A_FIXUP_MIC_VREF, | |
| 1984 | 1985 | }; |
| 1985 | 1986 | |
| 1986 | 1987 | static void alc889_fixup_coef(struct hda_codec *codec, |
| @@ -2526,6 +2527,14 @@ static const struct hda_fixup alc882_fixups[] = { · 539 unmodified lines | ||
| 2526 | 2527 | .chained = true, |
| 2527 | 2528 | .chain_id = ALC887_FIXUP_ASUS_AUDIO, |
| 2528 | 2529 | }, |
| 2530 | + [ALCS1200A_FIXUP_MIC_VREF] = { | |
| 2531 | + .type = HDA_FIXUP_PINCTLS, | |
| 2532 | + .v.pins = (const struct hda_pintbl[]) { | |
| 2533 | + { 0x18, PIN_VREF50 }, /* rear mic */ | |
| 2534 | + { 0x19, PIN_VREF50 }, /* front mic */ | |
| 2535 | + {} | |
| 2536 | + } | |
| 2537 | + }, | |
| 2529 | 2538 | }; |
| 2530 | 2539 | |
| 2531 | 2540 | static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
| @@ -2563,6 +2572,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { · 31 unmodified lines | ||
| 2563 | 2572 | SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), |
| 2564 | 2573 | SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), |
| 2565 | 2574 | SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), |
| 2575 | + SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF), | |
| 2566 | 2576 | SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), |
| 2567 | 2577 | SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), |
| 2568 | 2578 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), |
| @@ -8905,6 +8915,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 6336 unmodified lines | ||
| 8905 | 8915 | SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK), |
| 8906 | 8916 | SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), |
| 8907 | 8917 | SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), |
| 8918 | + SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK), | |
| 8908 | 8919 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 8909 | 8920 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 8910 | 8921 | SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
| @@ -449,8 +449,6 @@ static void vt1708_set_pinconfig_connect(struct hda_codec *codec, hda_nid_t nid) · 448 unmodified lines | ||
| 449 | 449 | def_conf = def_conf & (~(AC_JACK_PORT_BOTH << 30)); |
| 450 | 450 | snd_hda_codec_set_pincfg(codec, nid, def_conf); |
| 451 | 451 | } |
| 452 | − | |
| 453 | − return; | |
| 454 | 452 | } |
| 455 | 453 | |
| 456 | 454 | static int vt1708_jack_detect_get(struct snd_kcontrol *kcontrol, |
| @@ -16,6 +16,7 @@ · 15 unmodified lines | ||
| 16 | 16 | #include <linux/pci.h> |
| 17 | 17 | #include <linux/platform_device.h> |
| 18 | 18 | #include <linux/pm_runtime.h> |
| 19 | +#include <linux/module.h> | |
| 19 | 20 | |
| 20 | 21 | #include "amd.h" |
| 21 | 22 | #include "../mach-config.h" |
| @@ -60,6 +60,9 @@ static void da7219_aad_btn_det_work(struct work_struct *work) · 59 unmodified lines | ||
| 60 | 60 | bool micbias_up = false; |
| 61 | 61 | int retries = 0; |
| 62 | 62 | |
| 63 | + /* Disable ground switch */ | |
| 64 | + snd_soc_component_update_bits(component, 0xFB, 0x01, 0x00); | |
| 65 | + | |
| 63 | 66 | /* Drive headphones/lineout */ |
| 64 | 67 | snd_soc_component_update_bits(component, DA7219_HP_L_CTRL, |
| 65 | 68 | DA7219_HP_L_AMP_OE_MASK, |
| @@ -153,6 +156,9 @@ static void da7219_aad_hptest_work(struct work_struct *work) · 87 unmodified lines | ||
| 153 | 156 | tonegen_freq_hptest = cpu_to_le16(DA7219_AAD_HPTEST_RAMP_FREQ_INT_OSC); |
| 154 | 157 | } |
| 155 | 158 | |
| 159 | + /* Disable ground switch */ | |
| 160 | + snd_soc_component_update_bits(component, 0xFB, 0x01, 0x00); | |
| 161 | + | |
| 156 | 162 | /* Ensure gain ramping at fastest rate */ |
| 157 | 163 | gain_ramp_ctrl = snd_soc_component_read(component, DA7219_GAIN_RAMP_CTRL); |
| 158 | 164 | snd_soc_component_write(component, DA7219_GAIN_RAMP_CTRL, DA7219_GAIN_RAMP_RATE_X8); |
| @@ -428,6 +434,10 @@ static irqreturn_t da7219_aad_irq_thread(int irq, void *data) · 269 unmodified lines | ||
| 428 | 434 | mask |= DA7219_AAD_REPORT_ALL_MASK; |
| 429 | 435 | da7219_aad->jack_inserted = false; |
| 430 | 436 | |
| 437 | + /* Cancel any pending work */ | |
| 438 | + cancel_work_sync(&da7219_aad->btn_det_work); | |
| 439 | + cancel_work_sync(&da7219_aad->hptest_work); | |
| 440 | + | |
| 431 | 441 | /* Un-drive headphones/lineout */ |
| 432 | 442 | snd_soc_component_update_bits(component, DA7219_HP_R_CTRL, |
| 433 | 443 | DA7219_HP_R_AMP_OE_MASK, 0); |
| @@ -444,9 +454,8 @@ static irqreturn_t da7219_aad_irq_thread(int irq, void *data) · 10 unmodified lines | ||
| 444 | 454 | snd_soc_dapm_disable_pin(dapm, "Mic Bias"); |
| 445 | 455 | snd_soc_dapm_sync(dapm); |
| 446 | 456 | |
| 447 | − /* Cancel any pending work */ | |
| 448 | − cancel_work_sync(&da7219_aad->btn_det_work); | |
| 449 | − cancel_work_sync(&da7219_aad->hptest_work); | |
| 457 | + /* Enable ground switch */ | |
| 458 | + snd_soc_component_update_bits(component, 0xFB, 0x01, 0x01); | |
| 450 | 459 | } |
| 451 | 460 | } |
| 452 | 461 | |
| @@ -899,6 +908,9 @@ int da7219_aad_init(struct snd_soc_component *component) · 446 unmodified lines | ||
| 899 | 908 | snd_soc_component_update_bits(component, DA7219_ACCDET_CONFIG_1, |
| 900 | 909 | DA7219_BUTTON_CONFIG_MASK, 0); |
| 901 | 910 | |
| 911 | + /* Enable ground switch */ | |
| 912 | + snd_soc_component_update_bits(component, 0xFB, 0x01, 0x01); | |
| 913 | + | |
| 902 | 914 | INIT_WORK(&da7219_aad->btn_det_work, da7219_aad_btn_det_work); |
| 903 | 915 | INIT_WORK(&da7219_aad->hptest_work, da7219_aad_hptest_work); |
| 904 | 916 | |
| @@ -2094,12 +2094,14 @@ EXPORT_SYMBOL_GPL(rt5640_sel_asrc_clk_src); · 2093 unmodified lines | ||
| 2094 | 2094 | void rt5640_enable_micbias1_for_ovcd(struct snd_soc_component *component) |
| 2095 | 2095 | { |
| 2096 | 2096 | struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); |
| 2097 | + struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); | |
| 2097 | 2098 | |
| 2098 | 2099 | snd_soc_dapm_mutex_lock(dapm); |
| 2099 | 2100 | snd_soc_dapm_force_enable_pin_unlocked(dapm, "LDO2"); |
| 2100 | 2101 | snd_soc_dapm_force_enable_pin_unlocked(dapm, "MICBIAS1"); |
| 2101 | 2102 | /* OVCD is unreliable when used with RCCLK as sysclk-source */ |
| 2102 | − snd_soc_dapm_force_enable_pin_unlocked(dapm, "Platform Clock"); | |
| 2103 | + if (rt5640->use_platform_clock) | |
| 2104 | + snd_soc_dapm_force_enable_pin_unlocked(dapm, "Platform Clock"); | |
| 2103 | 2105 | snd_soc_dapm_sync_unlocked(dapm); |
| 2104 | 2106 | snd_soc_dapm_mutex_unlock(dapm); |
| 2105 | 2107 | } |
| @@ -2108,9 +2110,11 @@ EXPORT_SYMBOL_GPL(rt5640_enable_micbias1_for_ovcd); · 2 unmodified lines | ||
| 2108 | 2110 | void rt5640_disable_micbias1_for_ovcd(struct snd_soc_component *component) |
| 2109 | 2111 | { |
| 2110 | 2112 | struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); |
| 2113 | + struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); | |
| 2111 | 2114 | |
| 2112 | 2115 | snd_soc_dapm_mutex_lock(dapm); |
| 2113 | − snd_soc_dapm_disable_pin_unlocked(dapm, "Platform Clock"); | |
| 2116 | + if (rt5640->use_platform_clock) | |
| 2117 | + snd_soc_dapm_disable_pin_unlocked(dapm, "Platform Clock"); | |
| 2114 | 2118 | snd_soc_dapm_disable_pin_unlocked(dapm, "MICBIAS1"); |
| 2115 | 2119 | snd_soc_dapm_disable_pin_unlocked(dapm, "LDO2"); |
| 2116 | 2120 | snd_soc_dapm_sync_unlocked(dapm); |
| @@ -2535,6 +2539,9 @@ static void rt5640_enable_jack_detect(struct snd_soc_component *component, · 418 unmodified lines | ||
| 2535 | 2539 | rt5640->jd_gpio_irq_requested = true; |
| 2536 | 2540 | } |
| 2537 | 2541 | |
| 2542 | + if (jack_data && jack_data->use_platform_clock) | |
| 2543 | + rt5640->use_platform_clock = jack_data->use_platform_clock; | |
| 2544 | + | |
| 2538 | 2545 | ret = request_irq(rt5640->irq, rt5640_irq, |
| 2539 | 2546 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, |
| 2540 | 2547 | "rt5640", rt5640); |
| @@ -2155,11 +2155,13 @@ struct rt5640_priv { · 2154 unmodified lines | ||
| 2155 | 2155 | bool jd_inverted; |
| 2156 | 2156 | unsigned int ovcd_th; |
| 2157 | 2157 | unsigned int ovcd_sf; |
| 2158 | + bool use_platform_clock; | |
| 2158 | 2159 | }; |
| 2159 | 2160 | |
| 2160 | 2161 | struct rt5640_set_jack_data { |
| 2161 | 2162 | int codec_irq_override; |
| 2162 | 2163 | struct gpio_desc *jd_gpio; |
| 2164 | + bool use_platform_clock; | |
| 2163 | 2165 | }; |
| 2164 | 2166 | |
| 2165 | 2167 | int rt5640_dmic_enable(struct snd_soc_component *component, |
| @@ -80,8 +80,8 @@ · 79 unmodified lines | ||
| 80 | 80 | #define FSL_SAI_xCR3(tx, ofs) (tx ? FSL_SAI_TCR3(ofs) : FSL_SAI_RCR3(ofs)) |
| 81 | 81 | #define FSL_SAI_xCR4(tx, ofs) (tx ? FSL_SAI_TCR4(ofs) : FSL_SAI_RCR4(ofs)) |
| 82 | 82 | #define FSL_SAI_xCR5(tx, ofs) (tx ? FSL_SAI_TCR5(ofs) : FSL_SAI_RCR5(ofs)) |
| 83 | −#define FSL_SAI_xDR(tx, ofs) (tx ? FSL_SAI_TDR(ofs) : FSL_SAI_RDR(ofs)) | |
| 84 | −#define FSL_SAI_xFR(tx, ofs) (tx ? FSL_SAI_TFR(ofs) : FSL_SAI_RFR(ofs)) | |
| 83 | +#define FSL_SAI_xDR0(tx) (tx ? FSL_SAI_TDR0 : FSL_SAI_RDR0) | |
| 84 | +#define FSL_SAI_xFR0(tx) (tx ? FSL_SAI_TFR0 : FSL_SAI_RFR0) | |
| 85 | 85 | #define FSL_SAI_xMR(tx) (tx ? FSL_SAI_TMR : FSL_SAI_RMR) |
| 86 | 86 | |
| 87 | 87 | /* SAI Transmit/Receive Control Register */ |
| @@ -326,7 +326,8 @@ static int avs_register_i2s_board(struct avs_dev *adev, struct snd_soc_acpi_mach · 325 unmodified lines | ||
| 326 | 326 | num_ssps = adev->hw_cfg.i2s_caps.ctrl_count; |
| 327 | 327 | if (fls(mach->mach_params.i2s_link_mask) > num_ssps) { |
| 328 | 328 | dev_err(adev->dev, "Platform supports %d SSPs but board %s requires SSP%ld\n", |
| 329 | − num_ssps, mach->drv_name, __fls(mach->mach_params.i2s_link_mask)); | |
| 329 | + num_ssps, mach->drv_name, | |
| 330 | + (unsigned long)__fls(mach->mach_params.i2s_link_mask)); | |
| 330 | 331 | return -ENODEV; |
| 331 | 332 | } |
| 332 | 333 | |
| @@ -1191,12 +1191,14 @@ static int byt_rt5640_init(struct snd_soc_pcm_runtime *runtime) · 1190 unmodified lines | ||
| 1191 | 1191 | { |
| 1192 | 1192 | struct snd_soc_card *card = runtime->card; |
| 1193 | 1193 | struct byt_rt5640_private *priv = snd_soc_card_get_drvdata(card); |
| 1194 | + struct rt5640_set_jack_data *jack_data = &priv->jack_data; | |
| 1194 | 1195 | struct snd_soc_component *component = asoc_rtd_to_codec(runtime, 0)->component; |
| 1195 | 1196 | const struct snd_soc_dapm_route *custom_map = NULL; |
| 1196 | 1197 | int num_routes = 0; |
| 1197 | 1198 | int ret; |
| 1198 | 1199 | |
| 1199 | 1200 | card->dapm.idle_bias_off = true; |
| 1201 | + jack_data->use_platform_clock = true; | |
| 1200 | 1202 | |
| 1201 | 1203 | /* Start with RC clk for jack-detect (we disable MCLK below) */ |
| 1202 | 1204 | if (byt_rt5640_quirk & BYT_RT5640_MCLK_EN) |
| @@ -453,7 +453,7 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = { · 452 unmodified lines | ||
| 453 | 453 | .drv_name = "adl_mx98360a_nau8825", |
| 454 | 454 | .machine_quirk = snd_soc_acpi_codec_list, |
| 455 | 455 | .quirk_data = &adl_max98360a_amp, |
| 456 | − .sof_tplg_filename = "sof-adl-mx98360a-nau8825.tplg", | |
| 456 | + .sof_tplg_filename = "sof-adl-max98360a-nau8825.tplg", | |
| 457 | 457 | }, |
| 458 | 458 | { |
| 459 | 459 | .id = "RTL5682", |
| @@ -2128,8 +2128,6 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, · 2127 unmodified lines | ||
| 2128 | 2128 | else |
| 2129 | 2129 | ret = soc_pcm_trigger(be_substream, |
| 2130 | 2130 | SNDRV_PCM_TRIGGER_START); |
| 2131 | − | |
| 2132 | − ret = soc_pcm_trigger(be_substream, cmd); | |
| 2133 | 2131 | if (ret) { |
| 2134 | 2132 | be->dpcm[stream].be_start--; |
| 2135 | 2133 | goto next; |
| @@ -573,10 +573,14 @@ static int set_sample_rate_v2v3(struct snd_usb_audio *chip, · 572 unmodified lines | ||
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | /* FIXME - TEAC devices require the immediate interface setup */ |
| 576 | − if (rate != prev_rate && USB_ID_VENDOR(chip->usb_id) == 0x0644) { | |
| 577 | − usb_set_interface(chip->dev, fmt->iface, fmt->altsetting); | |
| 578 | − if (chip->quirk_flags & QUIRK_FLAG_IFACE_DELAY) | |
| 579 | − msleep(50); | |
| 576 | + if (USB_ID_VENDOR(chip->usb_id) == 0x0644) { | |
| 577 | + bool cur_base_48k = (rate % 48000 == 0); | |
| 578 | + bool prev_base_48k = (prev_rate % 48000 == 0); | |
| 579 | + if (cur_base_48k != prev_base_48k) { | |
| 580 | + usb_set_interface(chip->dev, fmt->iface, fmt->altsetting); | |
| 581 | + if (chip->quirk_flags & QUIRK_FLAG_IFACE_DELAY) | |
| 582 | + msleep(50); | |
| 583 | + } | |
| 580 | 584 | } |
| 581 | 585 | |
| 582 | 586 | validation: |
| @@ -1145,6 +1145,9 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream) · 1144 unmodified lines | ||
| 1145 | 1145 | |
| 1146 | 1146 | static int snd_usbmidi_output_close(struct snd_rawmidi_substream *substream) |
| 1147 | 1147 | { |
| 1148 | + struct usbmidi_out_port *port = substream->runtime->private_data; | |
| 1149 | + | |
| 1150 | + cancel_work_sync(&port->ep->work); | |
| 1148 | 1151 | return substream_open(substream, 0, 0); |
| 1149 | 1152 | } |
| 1150 | 1153 | |
| @@ -439,6 +439,31 @@ static const struct usbmix_name_map msi_mpg_x570s_carbon_max_wifi_alc4080_map[] · 438 unmodified lines | ||
| 439 | 439 | {} |
| 440 | 440 | }; |
| 441 | 441 | |
| 442 | +/* Gigabyte B450/550 Mobo */ | |
| 443 | +static const struct usbmix_name_map gigabyte_b450_map[] = { | |
| 444 | + { 24, NULL }, /* OT, IEC958?, disabled */ | |
| 445 | + { 21, "Speaker" }, /* OT */ | |
| 446 | + { 29, "Speaker Playback" }, /* FU */ | |
| 447 | + { 22, "Headphone" }, /* OT */ | |
| 448 | + { 30, "Headphone Playback" }, /* FU */ | |
| 449 | + { 11, "Line" }, /* IT */ | |
| 450 | + { 27, "Line Capture" }, /* FU */ | |
| 451 | + { 12, "Mic" }, /* IT */ | |
| 452 | + { 28, "Mic Capture" }, /* FU */ | |
| 453 | + { 9, "Front Mic" }, /* IT */ | |
| 454 | + { 25, "Front Mic Capture" }, /* FU */ | |
| 455 | + {} | |
| 456 | +}; | |
| 457 | + | |
| 458 | +static const struct usbmix_connector_map gigabyte_b450_connector_map[] = { | |
| 459 | + { 13, 21 }, /* Speaker */ | |
| 460 | + { 14, 22 }, /* Headphone */ | |
| 461 | + { 19, 11 }, /* Line */ | |
| 462 | + { 20, 12 }, /* Mic */ | |
| 463 | + { 17, 9 }, /* Front Mic */ | |
| 464 | + {} | |
| 465 | +}; | |
| 466 | + | |
| 442 | 467 | /* |
| 443 | 468 | * Control map entries |
| 444 | 469 | */ |
| @@ -581,6 +606,11 @@ static const struct usbmix_ctl_map usbmix_ctl_maps[] = { · 136 unmodified lines | ||
| 581 | 606 | .map = trx40_mobo_map, |
| 582 | 607 | .connector_map = trx40_mobo_connector_map, |
| 583 | 608 | }, |
| 609 | + { /* Gigabyte B450/550 Mobo */ | |
| 610 | + .id = USB_ID(0x0414, 0xa00d), | |
| 611 | + .map = gigabyte_b450_map, | |
| 612 | + .connector_map = gigabyte_b450_connector_map, | |
| 613 | + }, | |
| 584 | 614 | { /* ASUS ROG Zenith II */ |
| 585 | 615 | .id = USB_ID(0x0b05, 0x1916), |
| 586 | 616 | .map = asus_rog_map, |
| @@ -3,6 +3,9 @@ · 2 unmodified lines | ||
| 3 | 3 | |
| 4 | 4 | CFLAGS += $(shell pkg-config --cflags alsa) |
| 5 | 5 | LDLIBS += $(shell pkg-config --libs alsa) |
| 6 | +ifeq ($(LDLIBS),) | |
| 7 | +LDLIBS += -lasound | |
| 8 | +endif | |
| 6 | 9 | |
| 7 | 10 | TEST_GEN_PROGS := mixer-test |
| 8 | 11 | |