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

Pull sound fixes from Takashi Iwai:
"A slightly large collection of fixes, spread over various drivers.

Almost all are small and device-specific fixes and quirks in ASoC SOF
Intel and AMD, Renesas, Cirrus, HD-audio, in addition to a small fix
for MIDI 2.0"

* tag 'sound-6.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (41 commits)
ALSA: seq: Drop UMP events when no UMP-conversion is set
ALSA: hda/conexant: Add quirk for HP ProBook 450 G4 mute LED
ALSA: hda/cirrus: Reduce codec resume time
ALSA: hda/cirrus: Correct the full scale volume set logic
virtio_snd.h: clarify that `controls` depends on VIRTIO_SND_F_CTLS
ALSA: hda: Add error check for snd_ctl_rename_id() in snd_hda_create_dig_out_ctls()
ALSA: hda/tas2781: Fix index issue in tas2781 hda SPI driver
ASoC: imx-audmix: remove cpu_mclk which is from cpu dai device
ALSA: hda/realtek: Fixup ALC225 depop procedure
ALSA: hda/tas2781: Update tas2781 hda SPI driver
ASoC: cs35l41: Fix acpi_device_hid() not found
ASoC: SOF: amd: Add branch prediction hint in ACP IRQ handler
ASoC: SOF: amd: Handle IPC replies before FW_BOOT_COMPLETE
ASoC: SOF: amd: Drop unused includes from Vangogh driver
ASoC: SOF: amd: Add post_fw_run_delay ACP quirk
ASoC: Intel: soc-acpi-intel-ptl-match: revise typo of rt713_vb_l2_rt1320_l13
ASoC: Intel: soc-acpi-intel-ptl-match: revise typo of rt712_vb + rt1320 support
ALSA: Switch to use hrtimer_setup()
ALSA: hda: hda-intel: add Panther Lake-H support
ASoC: SOF: Intel: pci-ptl: Add support for PTL-H
...

+319 -186
+1
include/linux/pci_ids.h
··· 3134 3134 #define PCI_DEVICE_ID_INTEL_HDA_LNL_P 0xa828 3135 3135 #define PCI_DEVICE_ID_INTEL_S21152BB 0xb152 3136 3136 #define PCI_DEVICE_ID_INTEL_HDA_BMG 0xe2f7 3137 + #define PCI_DEVICE_ID_INTEL_HDA_PTL_H 0xe328 3137 3138 #define PCI_DEVICE_ID_INTEL_HDA_PTL 0xe428 3138 3139 #define PCI_DEVICE_ID_INTEL_HDA_CML_R 0xf0c8 3139 3140 #define PCI_DEVICE_ID_INTEL_HDA_RKL_S 0xf1c8
+1 -1
include/uapi/linux/virtio_snd.h
··· 25 25 __le32 streams; 26 26 /* # of available channel maps */ 27 27 __le32 chmaps; 28 - /* # of available control elements */ 28 + /* # of available control elements (if VIRTIO_SND_F_CTLS) */ 29 29 __le32 controls; 30 30 }; 31 31
+1 -2
sound/core/hrtimer.c
··· 66 66 stime = kzalloc(sizeof(*stime), GFP_KERNEL); 67 67 if (!stime) 68 68 return -ENOMEM; 69 - hrtimer_init(&stime->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 70 69 stime->timer = t; 71 - stime->hrt.function = snd_hrtimer_callback; 70 + hrtimer_setup(&stime->hrt, snd_hrtimer_callback, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 72 71 t->private_data = stime; 73 72 return 0; 74 73 }
+9 -3
sound/core/seq/seq_clientmgr.c
··· 678 678 dest_port->time_real); 679 679 680 680 #if IS_ENABLED(CONFIG_SND_SEQ_UMP) 681 - if (!(dest->filter & SNDRV_SEQ_FILTER_NO_CONVERT)) { 682 - if (snd_seq_ev_is_ump(event)) { 681 + if (snd_seq_ev_is_ump(event)) { 682 + if (!(dest->filter & SNDRV_SEQ_FILTER_NO_CONVERT)) { 683 683 result = snd_seq_deliver_from_ump(client, dest, dest_port, 684 684 event, atomic, hop); 685 685 goto __skip; 686 - } else if (snd_seq_client_is_ump(dest)) { 686 + } else if (dest->type == USER_CLIENT && 687 + !snd_seq_client_is_ump(dest)) { 688 + result = 0; // drop the event 689 + goto __skip; 690 + } 691 + } else if (snd_seq_client_is_ump(dest)) { 692 + if (!(dest->filter & SNDRV_SEQ_FILTER_NO_CONVERT)) { 687 693 result = snd_seq_deliver_to_ump(client, dest, dest_port, 688 694 event, atomic, hop); 689 695 goto __skip;
+1 -2
sound/drivers/dummy.c
··· 457 457 if (!dpcm) 458 458 return -ENOMEM; 459 459 substream->runtime->private_data = dpcm; 460 - hrtimer_init(&dpcm->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT); 461 - dpcm->timer.function = dummy_hrtimer_callback; 460 + hrtimer_setup(&dpcm->timer, dummy_hrtimer_callback, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT); 462 461 dpcm->substream = substream; 463 462 atomic_set(&dpcm->running, 0); 464 463 return 0;
+1 -2
sound/drivers/pcsp/pcsp.c
··· 103 103 if (devnum != 0) 104 104 return -EINVAL; 105 105 106 - hrtimer_init(&pcsp_chip.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 107 - pcsp_chip.timer.function = pcsp_do_timer; 106 + hrtimer_setup(&pcsp_chip.timer, pcsp_do_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 108 107 109 108 err = snd_devm_card_new(dev, index, id, THIS_MODULE, 0, &card); 110 109 if (err < 0)
+5
sound/hda/intel-dsp-config.c
··· 539 539 .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, 540 540 .device = PCI_DEVICE_ID_INTEL_HDA_PTL, 541 541 }, 542 + { 543 + .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, 544 + .device = PCI_DEVICE_ID_INTEL_HDA_PTL_H, 545 + }, 546 + 542 547 #endif 543 548 544 549 };
+3 -1
sound/pci/hda/hda_codec.c
··· 2470 2470 break; 2471 2471 id = kctl->id; 2472 2472 id.index = spdif_index; 2473 - snd_ctl_rename_id(codec->card, &kctl->id, &id); 2473 + err = snd_ctl_rename_id(codec->card, &kctl->id, &id); 2474 + if (err < 0) 2475 + return err; 2474 2476 } 2475 2477 bus->primary_dig_out_type = HDA_PCM_TYPE_HDMI; 2476 2478 }
+2
sound/pci/hda/hda_intel.c
··· 2496 2496 { PCI_DEVICE_DATA(INTEL, HDA_ARL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) }, 2497 2497 /* Panther Lake */ 2498 2498 { PCI_DEVICE_DATA(INTEL, HDA_PTL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_LNL) }, 2499 + /* Panther Lake-H */ 2500 + { PCI_DEVICE_DATA(INTEL, HDA_PTL_H, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_LNL) }, 2499 2501 /* Apollolake (Broxton-P) */ 2500 2502 { PCI_DEVICE_DATA(INTEL, HDA_APL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON) }, 2501 2503 /* Gemini-Lake */
+1
sound/pci/hda/patch_conexant.c
··· 1090 1090 SND_PCI_QUIRK(0x103c, 0x814f, "HP ZBook 15u G3", CXT_FIXUP_MUTE_LED_GPIO), 1091 1091 SND_PCI_QUIRK(0x103c, 0x8174, "HP Spectre x360", CXT_FIXUP_HP_SPECTRE), 1092 1092 SND_PCI_QUIRK(0x103c, 0x822e, "HP ProBook 440 G4", CXT_FIXUP_MUTE_LED_GPIO), 1093 + SND_PCI_QUIRK(0x103c, 0x8231, "HP ProBook 450 G4", CXT_FIXUP_MUTE_LED_GPIO), 1093 1094 SND_PCI_QUIRK(0x103c, 0x828c, "HP EliteBook 840 G4", CXT_FIXUP_HP_DOCK), 1094 1095 SND_PCI_QUIRK(0x103c, 0x8299, "HP 800 G3 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE), 1095 1096 SND_PCI_QUIRK(0x103c, 0x829a, "HP 800 G3 DM", CXT_FIXUP_HP_MIC_NO_PRESENCE),
+6 -6
sound/pci/hda/patch_cs8409-tables.c
··· 121 121 { CS42L42_MIXER_CHA_VOL, 0x3F }, 122 122 { CS42L42_MIXER_CHB_VOL, 0x3F }, 123 123 { CS42L42_MIXER_ADC_VOL, 0x3f }, 124 - { CS42L42_HP_CTL, 0x03 }, 124 + { CS42L42_HP_CTL, 0x0D }, 125 125 { CS42L42_MIC_DET_CTL1, 0xB6 }, 126 126 { CS42L42_TIPSENSE_CTL, 0xC2 }, 127 127 { CS42L42_HS_CLAMP_DISABLE, 0x01 }, ··· 131 131 { CS42L42_RSENSE_CTL3, 0x00 }, 132 132 { CS42L42_TSENSE_CTL, 0x80 }, 133 133 { CS42L42_HS_BIAS_CTL, 0xC0 }, 134 - { CS42L42_PWR_CTL1, 0x02 }, 134 + { CS42L42_PWR_CTL1, 0x02, 10000 }, 135 135 { CS42L42_ADC_OVFL_INT_MASK, 0xff }, 136 136 { CS42L42_MIXER_INT_MASK, 0xff }, 137 137 { CS42L42_SRC_INT_MASK, 0xff }, ··· 315 315 { CS42L42_ASP_TX_SZ_EN, 0x01 }, 316 316 { CS42L42_PWR_CTL1, 0x0A }, 317 317 { CS42L42_PWR_CTL2, 0x84 }, 318 - { CS42L42_HP_CTL, 0x03 }, 318 + { CS42L42_HP_CTL, 0x0D }, 319 319 { CS42L42_MIXER_CHA_VOL, 0x3F }, 320 320 { CS42L42_MIXER_CHB_VOL, 0x3F }, 321 321 { CS42L42_MIXER_ADC_VOL, 0x3f }, ··· 328 328 { CS42L42_RSENSE_CTL3, 0x00 }, 329 329 { CS42L42_TSENSE_CTL, 0x80 }, 330 330 { CS42L42_HS_BIAS_CTL, 0xC0 }, 331 - { CS42L42_PWR_CTL1, 0x02 }, 331 + { CS42L42_PWR_CTL1, 0x02, 10000 }, 332 332 { CS42L42_ADC_OVFL_INT_MASK, 0xff }, 333 333 { CS42L42_MIXER_INT_MASK, 0xff }, 334 334 { CS42L42_SRC_INT_MASK, 0xff }, ··· 371 371 { CS42L42_ASP_TX_SZ_EN, 0x00 }, 372 372 { CS42L42_PWR_CTL1, 0x0E }, 373 373 { CS42L42_PWR_CTL2, 0x84 }, 374 - { CS42L42_HP_CTL, 0x01 }, 374 + { CS42L42_HP_CTL, 0x0D }, 375 375 { CS42L42_MIXER_CHA_VOL, 0x3F }, 376 376 { CS42L42_MIXER_CHB_VOL, 0x3F }, 377 377 { CS42L42_MIXER_ADC_VOL, 0x3f }, ··· 384 384 { CS42L42_RSENSE_CTL3, 0x00 }, 385 385 { CS42L42_TSENSE_CTL, 0x80 }, 386 386 { CS42L42_HS_BIAS_CTL, 0xC0 }, 387 - { CS42L42_PWR_CTL1, 0x06 }, 387 + { CS42L42_PWR_CTL1, 0x06, 10000 }, 388 388 { CS42L42_ADC_OVFL_INT_MASK, 0xff }, 389 389 { CS42L42_MIXER_INT_MASK, 0xff }, 390 390 { CS42L42_SRC_INT_MASK, 0xff },
+16 -10
sound/pci/hda/patch_cs8409.c
··· 346 346 347 347 if (cs8409_i2c_wait_complete(codec) < 0) 348 348 goto error; 349 + /* Certain use cases may require a delay 350 + * after a write operation before proceeding. 351 + */ 352 + if (seq[i].delay) 353 + fsleep(seq[i].delay); 349 354 } 350 355 351 356 mutex_unlock(&spec->i2c_mux); ··· 881 876 { CS42L42_DET_INT_STATUS2, 0x00 }, 882 877 { CS42L42_TSRS_PLUG_STATUS, 0x00 }, 883 878 }; 884 - int fsv_old, fsv_new; 879 + unsigned int fsv; 885 880 886 881 /* Bring CS42L42 out of Reset */ 887 882 spec->gpio_data = snd_hda_codec_read(codec, CS8409_PIN_AFG, 0, AC_VERB_GET_GPIO_DATA, 0); ··· 893 888 894 889 /* Initialize CS42L42 companion codec */ 895 890 cs8409_i2c_bulk_write(cs42l42, cs42l42->init_seq, cs42l42->init_seq_num); 896 - msleep(CS42L42_INIT_TIMEOUT_MS); 897 891 898 892 /* Clear interrupts, by reading interrupt status registers */ 899 893 cs8409_i2c_bulk_read(cs42l42, irq_regs, ARRAY_SIZE(irq_regs)); 900 894 901 - fsv_old = cs8409_i2c_read(cs42l42, CS42L42_HP_CTL); 902 - if (cs42l42->full_scale_vol == CS42L42_FULL_SCALE_VOL_0DB) 903 - fsv_new = fsv_old & ~CS42L42_FULL_SCALE_VOL_MASK; 904 - else 905 - fsv_new = fsv_old & CS42L42_FULL_SCALE_VOL_MASK; 906 - if (fsv_new != fsv_old) 907 - cs8409_i2c_write(cs42l42, CS42L42_HP_CTL, fsv_new); 895 + fsv = cs8409_i2c_read(cs42l42, CS42L42_HP_CTL); 896 + if (cs42l42->full_scale_vol) { 897 + // Set the full scale volume bit 898 + fsv |= CS42L42_FULL_SCALE_VOL_MASK; 899 + cs8409_i2c_write(cs42l42, CS42L42_HP_CTL, fsv); 900 + } 901 + // Unmute analog channels A and B 902 + fsv = (fsv & ~CS42L42_ANA_MUTE_AB); 903 + cs8409_i2c_write(cs42l42, CS42L42_HP_CTL, fsv); 908 904 909 905 /* we have to explicitly allow unsol event handling even during the 910 906 * resume phase so that the jack event is processed properly ··· 926 920 { CS42L42_MIXER_CHA_VOL, 0x3F }, 927 921 { CS42L42_MIXER_ADC_VOL, 0x3F }, 928 922 { CS42L42_MIXER_CHB_VOL, 0x3F }, 929 - { CS42L42_HP_CTL, 0x0F }, 923 + { CS42L42_HP_CTL, 0x0D }, 930 924 { CS42L42_ASP_RX_DAI0_EN, 0x00 }, 931 925 { CS42L42_ASP_CLK_CFG, 0x00 }, 932 926 { CS42L42_PWR_CTL1, 0xFE },
+4 -3
sound/pci/hda/patch_cs8409.h
··· 229 229 #define CS42L42_I2C_SLEEP_US (2000) 230 230 #define CS42L42_PDN_TIMEOUT_US (250000) 231 231 #define CS42L42_PDN_SLEEP_US (2000) 232 - #define CS42L42_INIT_TIMEOUT_MS (45) 232 + #define CS42L42_ANA_MUTE_AB (0x0C) 233 233 #define CS42L42_FULL_SCALE_VOL_MASK (2) 234 - #define CS42L42_FULL_SCALE_VOL_0DB (1) 235 - #define CS42L42_FULL_SCALE_VOL_MINUS6DB (0) 234 + #define CS42L42_FULL_SCALE_VOL_0DB (0) 235 + #define CS42L42_FULL_SCALE_VOL_MINUS6DB (1) 236 236 237 237 /* Dell BULLSEYE / WARLOCK / CYBORG Specific Definitions */ 238 238 ··· 290 290 struct cs8409_i2c_param { 291 291 unsigned int addr; 292 292 unsigned int value; 293 + unsigned int delay; 293 294 }; 294 295 295 296 struct cs8409_cir_param {
+2
sound/pci/hda/patch_realtek.c
··· 3788 3788 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); 3789 3789 3790 3790 msleep(75); 3791 + alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); 3791 3792 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ 3792 3793 } 3793 3794 } ··· 11046 11045 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC), 11047 11046 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC), 11048 11047 SND_PCI_QUIRK(0x1f66, 0x0105, "Ayaneo Portable Game Player", ALC287_FIXUP_CS35L41_I2C_2), 11048 + SND_PCI_QUIRK(0x2014, 0x800a, "Positivo ARN50", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 11049 11049 SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 11050 11050 SND_PCI_QUIRK(0x2782, 0x0228, "Infinix ZERO BOOK 13", ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13), 11051 11051 SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
+14 -13
sound/pci/hda/tas2781_hda_spi.c
··· 912 912 struct tasdevice_priv *tas_priv = context; 913 913 struct tas2781_hda *tas_hda = dev_get_drvdata(tas_priv->dev); 914 914 struct hda_codec *codec = tas_priv->codec; 915 - int i, j, ret; 915 + int i, j, ret, val; 916 916 917 917 pm_runtime_get_sync(tas_priv->dev); 918 918 guard(mutex)(&tas_priv->codec_lock); ··· 981 981 982 982 /* Perform AMP reset before firmware download. */ 983 983 tas_priv->rcabin.profile_cfg_id = TAS2781_PRE_POST_RESET_CFG; 984 - tasdevice_spi_tuning_switch(tas_priv, 0); 985 984 tas2781_spi_reset(tas_priv); 986 985 tas_priv->rcabin.profile_cfg_id = 0; 987 - tasdevice_spi_tuning_switch(tas_priv, 1); 988 986 989 987 tas_priv->fw_state = TASDEVICE_DSP_FW_ALL_OK; 990 - ret = tasdevice_spi_prmg_load(tas_priv, 0); 988 + ret = tasdevice_spi_dev_read(tas_priv, TAS2781_REG_CLK_CONFIG, &val); 989 + if (ret < 0) 990 + goto out; 991 + 992 + if (val == TAS2781_REG_CLK_CONFIG_RESET) 993 + ret = tasdevice_spi_prmg_load(tas_priv, 0); 991 994 if (ret < 0) { 992 995 dev_err(tas_priv->dev, "FW download failed = %d\n", ret); 993 996 goto out; ··· 1004 1001 * If calibrated data occurs error, dsp will still works with default 1005 1002 * calibrated data inside algo. 1006 1003 */ 1007 - tas_priv->save_calibration(tas_priv); 1008 1004 1009 1005 out: 1010 1006 if (fmw) ··· 1162 1160 1163 1161 guard(mutex)(&tas_hda->priv->codec_lock); 1164 1162 1165 - tasdevice_spi_tuning_switch(tas_hda->priv, 1); 1163 + if (tas_hda->priv->playback_started) 1164 + tasdevice_spi_tuning_switch(tas_hda->priv, 1); 1166 1165 1167 1166 tas_hda->priv->cur_book = -1; 1168 1167 tas_hda->priv->cur_conf = -1; ··· 1177 1174 1178 1175 guard(mutex)(&tas_hda->priv->codec_lock); 1179 1176 1180 - tasdevice_spi_tuning_switch(tas_hda->priv, 0); 1177 + if (tas_hda->priv->playback_started) 1178 + tasdevice_spi_tuning_switch(tas_hda->priv, 0); 1181 1179 1182 1180 return 0; 1183 1181 } ··· 1193 1189 return ret; 1194 1190 1195 1191 /* Shutdown chip before system suspend */ 1196 - tasdevice_spi_tuning_switch(tas_hda->priv, 1); 1197 - tas2781_spi_reset(tas_hda->priv); 1198 - /* 1199 - * Reset GPIO may be shared, so cannot reset here. 1200 - * However beyond this point, amps may be powered down. 1201 - */ 1192 + if (tas_hda->priv->playback_started) 1193 + tasdevice_spi_tuning_switch(tas_hda->priv, 1); 1194 + 1202 1195 return 0; 1203 1196 } 1204 1197
+5 -5
sound/pci/hda/tas2781_spi_fwlib.c
··· 2 2 // 3 3 // TAS2781 HDA SPI driver 4 4 // 5 - // Copyright 2024 Texas Instruments, Inc. 5 + // Copyright 2024-2025 Texas Instruments, Inc. 6 6 // 7 7 // Author: Baojun Xu <baojun.xu@ti.com> 8 8 ··· 771 771 switch (subblk_typ) { 772 772 case TASDEVICE_CMD_SING_W: 773 773 subblk_offset = tasdevice_single_byte_wr(tas_priv, 774 - dev_idx & 0x4f, data, sublocksize); 774 + dev_idx & 0x3f, data, sublocksize); 775 775 break; 776 776 case TASDEVICE_CMD_BURST: 777 777 subblk_offset = tasdevice_burst_wr(tas_priv, 778 - dev_idx & 0x4f, data, sublocksize); 778 + dev_idx & 0x3f, data, sublocksize); 779 779 break; 780 780 case TASDEVICE_CMD_DELAY: 781 781 subblk_offset = tasdevice_delay(tas_priv, 782 - dev_idx & 0x4f, data, sublocksize); 782 + dev_idx & 0x3f, data, sublocksize); 783 783 break; 784 784 case TASDEVICE_CMD_FIELD_W: 785 785 subblk_offset = tasdevice_field_wr(tas_priv, 786 - dev_idx & 0x4f, data, sublocksize); 786 + dev_idx & 0x3f, data, sublocksize); 787 787 break; 788 788 default: 789 789 subblk_offset = 2;
+1 -2
sound/sh/sh_dac_audio.c
··· 312 312 313 313 chip->card = card; 314 314 315 - hrtimer_init(&chip->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 316 - chip->hrtimer.function = sh_dac_audio_timer; 315 + hrtimer_setup(&chip->hrtimer, sh_dac_audio_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 317 316 318 317 dac_audio_reset(chip); 319 318 chip->rate = 8000;
+7 -7
sound/soc/codecs/arizona.c
··· 967 967 case ARIZONA_OUT3L_ENA_SHIFT: 968 968 case ARIZONA_OUT3R_ENA_SHIFT: 969 969 priv->out_up_pending++; 970 - priv->out_up_delay += 17; 970 + priv->out_up_delay += 17000; 971 971 break; 972 972 case ARIZONA_OUT4L_ENA_SHIFT: 973 973 case ARIZONA_OUT4R_ENA_SHIFT: ··· 977 977 case WM8997: 978 978 break; 979 979 default: 980 - priv->out_up_delay += 10; 980 + priv->out_up_delay += 10000; 981 981 break; 982 982 } 983 983 break; ··· 999 999 if (!priv->out_up_pending && priv->out_up_delay) { 1000 1000 dev_dbg(component->dev, "Power up delay: %d\n", 1001 1001 priv->out_up_delay); 1002 - msleep(priv->out_up_delay); 1002 + fsleep(priv->out_up_delay); 1003 1003 priv->out_up_delay = 0; 1004 1004 } 1005 1005 break; ··· 1017 1017 case ARIZONA_OUT3L_ENA_SHIFT: 1018 1018 case ARIZONA_OUT3R_ENA_SHIFT: 1019 1019 priv->out_down_pending++; 1020 - priv->out_down_delay++; 1020 + priv->out_down_delay += 1000; 1021 1021 break; 1022 1022 case ARIZONA_OUT4L_ENA_SHIFT: 1023 1023 case ARIZONA_OUT4R_ENA_SHIFT: ··· 1028 1028 break; 1029 1029 case WM8998: 1030 1030 case WM1814: 1031 - priv->out_down_delay += 5; 1031 + priv->out_down_delay += 5000; 1032 1032 break; 1033 1033 default: 1034 - priv->out_down_delay++; 1034 + priv->out_down_delay += 1000; 1035 1035 break; 1036 1036 } 1037 1037 break; ··· 1053 1053 if (!priv->out_down_pending && priv->out_down_delay) { 1054 1054 dev_dbg(component->dev, "Power down delay: %d\n", 1055 1055 priv->out_down_delay); 1056 - msleep(priv->out_down_delay); 1056 + fsleep(priv->out_down_delay); 1057 1057 priv->out_down_delay = 0; 1058 1058 } 1059 1059 break;
+23 -7
sound/soc/codecs/cs35l41.c
··· 1148 1148 return ret; 1149 1149 } 1150 1150 1151 + #ifdef CONFIG_ACPI 1151 1152 static int cs35l41_acpi_get_name(struct cs35l41_private *cs35l41) 1152 1153 { 1153 - acpi_handle handle = ACPI_HANDLE(cs35l41->dev); 1154 + struct acpi_device *adev = ACPI_COMPANION(cs35l41->dev); 1155 + acpi_handle handle = acpi_device_handle(adev); 1156 + const char *hid; 1154 1157 const char *sub; 1155 1158 1156 - /* If there is no ACPI_HANDLE, there is no ACPI for this system, return 0 */ 1157 - if (!handle) 1159 + /* If there is no acpi_device, there is no ACPI for this system, return 0 */ 1160 + if (!adev) 1158 1161 return 0; 1159 1162 1160 1163 sub = acpi_get_subsystem_id(handle); 1161 1164 if (IS_ERR(sub)) { 1162 - /* If bad ACPI, return 0 and fallback to legacy firmware path, otherwise fail */ 1163 - if (PTR_ERR(sub) == -ENODATA) 1164 - return 0; 1165 - else 1165 + /* If no _SUB, fallback to _HID, otherwise fail */ 1166 + if (PTR_ERR(sub) == -ENODATA) { 1167 + hid = acpi_device_hid(adev); 1168 + /* If dummy hid, return 0 and fallback to legacy firmware path */ 1169 + if (!strcmp(hid, "device")) 1170 + return 0; 1171 + sub = kstrdup(hid, GFP_KERNEL); 1172 + if (!sub) 1173 + sub = ERR_PTR(-ENOMEM); 1174 + 1175 + } else 1166 1176 return PTR_ERR(sub); 1167 1177 } 1168 1178 ··· 1181 1171 1182 1172 return 0; 1183 1173 } 1174 + #else 1175 + static int cs35l41_acpi_get_name(struct cs35l41_private *cs35l41) 1176 + { 1177 + return 0; 1178 + } 1179 + #endif /* CONFIG_ACPI */ 1184 1180 1185 1181 int cs35l41_probe(struct cs35l41_private *cs35l41, const struct cs35l41_hw_cfg *hw_cfg) 1186 1182 {
+5 -5
sound/soc/codecs/madera.c
··· 2323 2323 case CS42L92: 2324 2324 case CS47L92: 2325 2325 case CS47L93: 2326 - out_up_delay = 6; 2326 + out_up_delay = 6000; 2327 2327 break; 2328 2328 default: 2329 - out_up_delay = 17; 2329 + out_up_delay = 17000; 2330 2330 break; 2331 2331 } 2332 2332 ··· 2357 2357 case MADERA_OUT3R_ENA_SHIFT: 2358 2358 priv->out_up_pending--; 2359 2359 if (!priv->out_up_pending) { 2360 - msleep(priv->out_up_delay); 2360 + fsleep(priv->out_up_delay); 2361 2361 priv->out_up_delay = 0; 2362 2362 } 2363 2363 break; ··· 2376 2376 case MADERA_OUT3L_ENA_SHIFT: 2377 2377 case MADERA_OUT3R_ENA_SHIFT: 2378 2378 priv->out_down_pending++; 2379 - priv->out_down_delay++; 2379 + priv->out_down_delay += 1000; 2380 2380 break; 2381 2381 default: 2382 2382 break; ··· 2393 2393 case MADERA_OUT3R_ENA_SHIFT: 2394 2394 priv->out_down_pending--; 2395 2395 if (!priv->out_down_pending) { 2396 - msleep(priv->out_down_delay); 2396 + fsleep(priv->out_down_delay); 2397 2397 priv->out_down_delay = 0; 2398 2398 } 2399 2399 break;
+1 -3
sound/soc/codecs/tas2781-i2c.c
··· 2 2 // 3 3 // ALSA SoC Texas Instruments TAS2563/TAS2781 Audio Smart Amplifier 4 4 // 5 - // Copyright (C) 2022 - 2024 Texas Instruments Incorporated 5 + // Copyright (C) 2022 - 2025 Texas Instruments Incorporated 6 6 // https://www.ti.com 7 7 // 8 8 // The TAS2563/TAS2781 driver implements a flexible and configurable ··· 1260 1260 (cali_data->cali_dat_sz_per_dev + 1) + 1 + 15 + 1; 1261 1261 priv->cali_data.total_sz = priv->ndev * 1262 1262 (cali_data->cali_dat_sz_per_dev + 1); 1263 - priv->cali_data.data = devm_kzalloc(priv->dev, 1264 - ext_cali_data->max, GFP_KERNEL); 1265 1263 cali_ctrls[i].name = cali_name; 1266 1264 cali_ctrls[i].iface = SNDRV_CTL_ELEM_IFACE_MIXER; 1267 1265 cali_ctrls[i].info = snd_soc_bytes_info_ext;
+4 -4
sound/soc/codecs/wm5110.c
··· 302 302 } else { 303 303 wseq = wm5110_no_dre_left_enable; 304 304 nregs = ARRAY_SIZE(wm5110_no_dre_left_enable); 305 - priv->out_up_delay += 10; 305 + priv->out_up_delay += 10000; 306 306 } 307 307 break; 308 308 case ARIZONA_OUT1R_ENA_SHIFT: ··· 312 312 } else { 313 313 wseq = wm5110_no_dre_right_enable; 314 314 nregs = ARRAY_SIZE(wm5110_no_dre_right_enable); 315 - priv->out_up_delay += 10; 315 + priv->out_up_delay += 10000; 316 316 } 317 317 break; 318 318 default: ··· 338 338 snd_soc_component_update_bits(component, 339 339 ARIZONA_SPARE_TRIGGERS, 340 340 ARIZONA_WS_TRG1, 0); 341 - priv->out_down_delay += 27; 341 + priv->out_down_delay += 27000; 342 342 } 343 343 break; 344 344 case ARIZONA_OUT1R_ENA_SHIFT: ··· 350 350 snd_soc_component_update_bits(component, 351 351 ARIZONA_SPARE_TRIGGERS, 352 352 ARIZONA_WS_TRG2, 0); 353 - priv->out_down_delay += 27; 353 + priv->out_down_delay += 27000; 354 354 } 355 355 break; 356 356 default:
+2
sound/soc/fsl/fsl_micfil.c
··· 183 183 case QUALITY_VLOW2: 184 184 qsel = MICFIL_QSEL_VLOW2_QUALITY; 185 185 break; 186 + default: 187 + return -EINVAL; 186 188 } 187 189 188 190 return regmap_update_bits(micfil->regmap, REG_MICFIL_CTRL2,
-31
sound/soc/fsl/imx-audmix.c
··· 23 23 struct snd_soc_card card; 24 24 struct platform_device *audmix_pdev; 25 25 struct platform_device *out_pdev; 26 - struct clk *cpu_mclk; 27 26 int num_dai; 28 27 struct snd_soc_dai_link *dai; 29 28 int num_dai_conf; ··· 31 32 struct snd_soc_dapm_route *dapm_routes; 32 33 }; 33 34 34 - static const u32 imx_audmix_rates[] = { 35 - 8000, 12000, 16000, 24000, 32000, 48000, 64000, 96000, 36 - }; 37 - 38 - static const struct snd_pcm_hw_constraint_list imx_audmix_rate_constraints = { 39 - .count = ARRAY_SIZE(imx_audmix_rates), 40 - .list = imx_audmix_rates, 41 - }; 42 - 43 35 static int imx_audmix_fe_startup(struct snd_pcm_substream *substream) 44 36 { 45 - struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 46 - struct imx_audmix *priv = snd_soc_card_get_drvdata(rtd->card); 47 37 struct snd_pcm_runtime *runtime = substream->runtime; 48 - struct device *dev = rtd->card->dev; 49 - unsigned long clk_rate = clk_get_rate(priv->cpu_mclk); 50 38 int ret; 51 - 52 - if (clk_rate % 24576000 == 0) { 53 - ret = snd_pcm_hw_constraint_list(runtime, 0, 54 - SNDRV_PCM_HW_PARAM_RATE, 55 - &imx_audmix_rate_constraints); 56 - if (ret < 0) 57 - return ret; 58 - } else { 59 - dev_warn(dev, "mclk may be not supported %lu\n", clk_rate); 60 - } 61 39 62 40 ret = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_CHANNELS, 63 41 1, 8); ··· 298 322 return -EINVAL; 299 323 } 300 324 put_device(&cpu_pdev->dev); 301 - 302 - priv->cpu_mclk = devm_clk_get(&cpu_pdev->dev, "mclk1"); 303 - if (IS_ERR(priv->cpu_mclk)) { 304 - ret = PTR_ERR(priv->cpu_mclk); 305 - dev_err(&cpu_pdev->dev, "failed to get DAI mclk1: %d\n", ret); 306 - return ret; 307 - } 308 325 309 326 priv->audmix_pdev = audmix_pdev; 310 327 priv->out_pdev = cpu_pdev;
+1
sound/soc/generic/simple-card-utils.c
··· 1092 1092 args.np = ep; 1093 1093 dai = snd_soc_get_dai_via_args(&args); 1094 1094 if (dai) { 1095 + dlc->of_node = node; 1095 1096 dlc->dai_name = snd_soc_dai_name_get(dai); 1096 1097 dlc->dai_args = snd_soc_copy_dai_args(dev, &args); 1097 1098 if (!dlc->dai_args)
+35 -6
sound/soc/intel/boards/sof_sdw.c
··· 13 13 #include <linux/soundwire/sdw.h> 14 14 #include <linux/soundwire/sdw_type.h> 15 15 #include <linux/soundwire/sdw_intel.h> 16 + #include <sound/core.h> 16 17 #include <sound/soc-acpi.h> 17 18 #include "sof_sdw_common.h" 18 19 #include "../../codecs/rt711.h" ··· 749 748 }, 750 749 .driver_data = (void *)(SOC_SDW_PCH_DMIC), 751 750 }, 751 + { 752 + .callback = sof_sdw_quirk_cb, 753 + .matches = { 754 + DMI_MATCH(DMI_SYS_VENDOR, "Google"), 755 + DMI_MATCH(DMI_PRODUCT_NAME, "Fatcat"), 756 + }, 757 + .driver_data = (void *)(SOC_SDW_PCH_DMIC | 758 + SOF_BT_OFFLOAD_SSP(2) | 759 + SOF_SSP_BT_OFFLOAD_PRESENT), 760 + }, 752 761 {} 753 762 }; 763 + 764 + static const struct snd_pci_quirk sof_sdw_ssid_quirk_table[] = { 765 + SND_PCI_QUIRK(0x1043, 0x1e13, "ASUS Zenbook S14", SOC_SDW_CODEC_MIC), 766 + {} 767 + }; 768 + 769 + static void sof_sdw_check_ssid_quirk(const struct snd_soc_acpi_mach *mach) 770 + { 771 + const struct snd_pci_quirk *quirk_entry; 772 + 773 + quirk_entry = snd_pci_quirk_lookup_id(mach->mach_params.subsystem_vendor, 774 + mach->mach_params.subsystem_device, 775 + sof_sdw_ssid_quirk_table); 776 + 777 + if (quirk_entry) 778 + sof_sdw_quirk = quirk_entry->value; 779 + } 754 780 755 781 static struct snd_soc_dai_link_component platform_component[] = { 756 782 { ··· 1306 1278 1307 1279 snd_soc_card_set_drvdata(card, ctx); 1308 1280 1281 + if (mach->mach_params.subsystem_id_set) { 1282 + snd_soc_card_set_pci_ssid(card, 1283 + mach->mach_params.subsystem_vendor, 1284 + mach->mach_params.subsystem_device); 1285 + sof_sdw_check_ssid_quirk(mach); 1286 + } 1287 + 1309 1288 dmi_check_system(sof_sdw_quirk_table); 1310 1289 1311 1290 if (quirk_override != -1) { ··· 1327 1292 /* reset amp_num to ensure amp_num++ starts from 0 in each probe */ 1328 1293 for (i = 0; i < ctx->codec_info_list_count; i++) 1329 1294 codec_info_list[i].amp_num = 0; 1330 - 1331 - if (mach->mach_params.subsystem_id_set) { 1332 - snd_soc_card_set_pci_ssid(card, 1333 - mach->mach_params.subsystem_vendor, 1334 - mach->mach_params.subsystem_device); 1335 - } 1336 1295 1337 1296 ret = sof_card_dai_links_create(card); 1338 1297 if (ret < 0)
+1 -1
sound/soc/intel/common/soc-acpi-intel-mtl-match.c
··· 330 330 331 331 static const struct snd_soc_acpi_adr_device rt1318_1_single_adr[] = { 332 332 { 333 - .adr = 0x000130025D131801, 333 + .adr = 0x000130025D131801ull, 334 334 .num_endpoints = 1, 335 335 .endpoints = &single_endpoint, 336 336 .name_prefix = "rt1318-1"
+6 -6
sound/soc/intel/common/soc-acpi-intel-ptl-match.c
··· 251 251 {} 252 252 }; 253 253 254 - static const struct snd_soc_acpi_link_adr lnl_sdw_rt713_vb_l2_rt1320_l13[] = { 254 + static const struct snd_soc_acpi_link_adr ptl_sdw_rt713_vb_l2_rt1320_l13[] = { 255 255 { 256 256 .mask = BIT(2), 257 257 .num_adr = ARRAY_SIZE(rt713_vb_2_adr), ··· 270 270 {} 271 271 }; 272 272 273 - static const struct snd_soc_acpi_link_adr lnl_sdw_rt712_vb_l2_rt1320_l1[] = { 273 + static const struct snd_soc_acpi_link_adr ptl_sdw_rt712_vb_l2_rt1320_l1[] = { 274 274 { 275 275 .mask = BIT(2), 276 276 .num_adr = ARRAY_SIZE(rt712_vb_2_group1_adr), ··· 337 337 }, 338 338 { 339 339 .link_mask = BIT(1) | BIT(2), 340 - .links = lnl_sdw_rt712_vb_l2_rt1320_l1, 340 + .links = ptl_sdw_rt712_vb_l2_rt1320_l1, 341 341 .drv_name = "sof_sdw", 342 342 .machine_check = snd_soc_acpi_intel_sdca_is_device_rt712_vb, 343 - .sof_tplg_filename = "sof-lnl-rt712-l2-rt1320-l1.tplg" 343 + .sof_tplg_filename = "sof-ptl-rt712-l2-rt1320-l1.tplg" 344 344 }, 345 345 { 346 346 .link_mask = BIT(1) | BIT(2) | BIT(3), 347 - .links = lnl_sdw_rt713_vb_l2_rt1320_l13, 347 + .links = ptl_sdw_rt713_vb_l2_rt1320_l13, 348 348 .drv_name = "sof_sdw", 349 349 .machine_check = snd_soc_acpi_intel_sdca_is_device_rt712_vb, 350 - .sof_tplg_filename = "sof-lnl-rt713-l2-rt1320-l13.tplg" 350 + .sof_tplg_filename = "sof-ptl-rt713-l2-rt1320-l13.tplg" 351 351 }, 352 352 {}, 353 353 };
+8 -8
sound/soc/intel/common/soc-acpi-intel-tgl-match.c
··· 658 658 659 659 static const struct snd_soc_acpi_adr_device cs35l56_sdw_eight_1_4_fb_adr[] = { 660 660 { 661 - .adr = 0x00003301fa355601, 661 + .adr = 0x00003301fa355601ull, 662 662 .num_endpoints = ARRAY_SIZE(cs35l56_l_fb_endpoints), 663 663 .endpoints = cs35l56_l_fb_endpoints, 664 664 .name_prefix = "AMP1" 665 665 }, 666 666 { 667 - .adr = 0x00003201fa355601, 667 + .adr = 0x00003201fa355601ull, 668 668 .num_endpoints = ARRAY_SIZE(cs35l56_2_fb_endpoints), 669 669 .endpoints = cs35l56_2_fb_endpoints, 670 670 .name_prefix = "AMP2" 671 671 }, 672 672 { 673 - .adr = 0x00003101fa355601, 673 + .adr = 0x00003101fa355601ull, 674 674 .num_endpoints = ARRAY_SIZE(cs35l56_4_fb_endpoints), 675 675 .endpoints = cs35l56_4_fb_endpoints, 676 676 .name_prefix = "AMP3" 677 677 }, 678 678 { 679 - .adr = 0x00003001fa355601, 679 + .adr = 0x00003001fa355601ull, 680 680 .num_endpoints = ARRAY_SIZE(cs35l56_6_fb_endpoints), 681 681 .endpoints = cs35l56_6_fb_endpoints, 682 682 .name_prefix = "AMP4" ··· 685 685 686 686 static const struct snd_soc_acpi_adr_device cs35l56_sdw_eight_5_8_fb_adr[] = { 687 687 { 688 - .adr = 0x00013701fa355601, 688 + .adr = 0x00013701fa355601ull, 689 689 .num_endpoints = ARRAY_SIZE(cs35l56_r_fb_endpoints), 690 690 .endpoints = cs35l56_r_fb_endpoints, 691 691 .name_prefix = "AMP8" 692 692 }, 693 693 { 694 - .adr = 0x00013601fa355601, 694 + .adr = 0x00013601fa355601ull, 695 695 .num_endpoints = ARRAY_SIZE(cs35l56_3_fb_endpoints), 696 696 .endpoints = cs35l56_3_fb_endpoints, 697 697 .name_prefix = "AMP7" 698 698 }, 699 699 { 700 - .adr = 0x00013501fa355601, 700 + .adr = 0x00013501fa355601ull, 701 701 .num_endpoints = ARRAY_SIZE(cs35l56_5_fb_endpoints), 702 702 .endpoints = cs35l56_5_fb_endpoints, 703 703 .name_prefix = "AMP6" 704 704 }, 705 705 { 706 - .adr = 0x00013401fa355601, 706 + .adr = 0x00013401fa355601ull, 707 707 .num_endpoints = ARRAY_SIZE(cs35l56_7_fb_endpoints), 708 708 .endpoints = cs35l56_7_fb_endpoints, 709 709 .name_prefix = "AMP5"
-14
sound/soc/renesas/rcar/core.c
··· 1770 1770 return 1; 1771 1771 } 1772 1772 1773 - int rsnd_kctrl_accept_runtime(struct rsnd_dai_stream *io) 1774 - { 1775 - struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); 1776 - struct rsnd_priv *priv = rsnd_io_to_priv(io); 1777 - struct device *dev = rsnd_priv_to_dev(priv); 1778 - 1779 - if (!runtime) { 1780 - dev_warn(dev, "Can't update kctrl when idle\n"); 1781 - return 0; 1782 - } 1783 - 1784 - return 1; 1785 - } 1786 - 1787 1773 struct rsnd_kctrl_cfg *rsnd_kctrl_init_m(struct rsnd_kctrl_cfg_m *cfg) 1788 1774 { 1789 1775 cfg->cfg.val = cfg->val;
-1
sound/soc/renesas/rcar/rsnd.h
··· 742 742 #define rsnd_kctrl_vals(x) ((x).val) /* = (x).cfg.val[0] */ 743 743 744 744 int rsnd_kctrl_accept_anytime(struct rsnd_dai_stream *io); 745 - int rsnd_kctrl_accept_runtime(struct rsnd_dai_stream *io); 746 745 struct rsnd_kctrl_cfg *rsnd_kctrl_init_m(struct rsnd_kctrl_cfg_m *cfg); 747 746 struct rsnd_kctrl_cfg *rsnd_kctrl_init_s(struct rsnd_kctrl_cfg_s *cfg); 748 747 int rsnd_kctrl_new(struct rsnd_mod *mod,
+93 -23
sound/soc/renesas/rcar/src.c
··· 35 35 struct rsnd_mod *dma; 36 36 struct rsnd_kctrl_cfg_s sen; /* sync convert enable */ 37 37 struct rsnd_kctrl_cfg_s sync; /* sync convert */ 38 + u32 current_sync_rate; 38 39 int irq; 39 40 }; 40 41 ··· 101 100 if (!rsnd_src_sync_is_enabled(mod)) 102 101 return rsnd_io_converted_rate(io); 103 102 104 - convert_rate = src->sync.val; 103 + convert_rate = src->current_sync_rate; 105 104 106 105 if (!convert_rate) 107 106 convert_rate = rsnd_io_converted_rate(io); ··· 202 201 static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io, 203 202 struct rsnd_mod *mod) 204 203 { 204 + struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); 205 + struct rsnd_priv *priv = rsnd_mod_to_priv(mod); 206 + struct rsnd_src *src = rsnd_mod_to_src(mod); 207 + u32 fin, fout, new_rate; 208 + int inc, cnt, rate; 209 + u64 base, val; 210 + 211 + if (!runtime) 212 + return; 213 + 214 + if (!rsnd_src_sync_is_enabled(mod)) 215 + return; 216 + 217 + fin = rsnd_src_get_in_rate(priv, io); 218 + fout = rsnd_src_get_out_rate(priv, io); 219 + 220 + new_rate = src->sync.val; 221 + 222 + if (!new_rate) 223 + new_rate = fout; 224 + 225 + /* Do nothing if no diff */ 226 + if (new_rate == src->current_sync_rate) 227 + return; 228 + 229 + /* 230 + * SRCm_IFSVR::INTIFS can change within 1% 231 + * see 232 + * SRCm_IFSVR::INTIFS Note 233 + */ 234 + inc = fout / 100; 235 + cnt = abs(new_rate - fout) / inc; 236 + if (fout > new_rate) 237 + inc *= -1; 238 + 239 + /* 240 + * After start running SRC, we can update only SRC_IFSVR 241 + * for Synchronous Mode 242 + */ 243 + base = (u64)0x0400000 * fin; 244 + rate = fout; 245 + for (int i = 0; i < cnt; i++) { 246 + val = base; 247 + rate += inc; 248 + do_div(val, rate); 249 + 250 + rsnd_mod_write(mod, SRC_IFSVR, val); 251 + } 252 + val = base; 253 + do_div(val, new_rate); 254 + 255 + rsnd_mod_write(mod, SRC_IFSVR, val); 256 + 257 + /* update current_sync_rate */ 258 + src->current_sync_rate = new_rate; 259 + } 260 + 261 + static void rsnd_src_init_convert_rate(struct rsnd_dai_stream *io, 262 + struct rsnd_mod *mod) 263 + { 264 + struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); 205 265 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); 206 266 struct device *dev = rsnd_priv_to_dev(priv); 207 - struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); 208 267 int is_play = rsnd_io_is_play(io); 209 268 int use_src = 0; 210 269 u32 fin, fout; 211 - u32 ifscr, fsrate, adinr; 270 + u32 ifscr, adinr; 212 271 u32 cr, route; 213 272 u32 i_busif, o_busif, tmp; 214 273 const u32 *bsdsr_table; ··· 306 245 adinr = rsnd_get_adinr_bit(mod, io) | chan; 307 246 308 247 /* 309 - * SRC_IFSCR / SRC_IFSVR 310 - */ 311 - ifscr = 0; 312 - fsrate = 0; 313 - if (use_src) { 314 - u64 n; 315 - 316 - ifscr = 1; 317 - n = (u64)0x0400000 * fin; 318 - do_div(n, fout); 319 - fsrate = n; 320 - } 321 - 322 - /* 248 + * SRC_IFSCR 323 249 * SRC_SRCCR / SRC_ROUTE_MODE0 324 250 */ 251 + ifscr = 0; 325 252 cr = 0x00011110; 326 253 route = 0x0; 327 254 if (use_src) { 328 255 route = 0x1; 256 + ifscr = 0x1; 329 257 330 258 if (rsnd_src_sync_is_enabled(mod)) { 331 259 cr |= 0x1; ··· 385 335 rsnd_mod_write(mod, SRC_SRCIR, 1); /* initialize */ 386 336 rsnd_mod_write(mod, SRC_ADINR, adinr); 387 337 rsnd_mod_write(mod, SRC_IFSCR, ifscr); 388 - rsnd_mod_write(mod, SRC_IFSVR, fsrate); 389 338 rsnd_mod_write(mod, SRC_SRCCR, cr); 390 339 rsnd_mod_write(mod, SRC_BSDSR, bsdsr_table[idx]); 391 340 rsnd_mod_write(mod, SRC_BSISR, bsisr_table[idx]); ··· 396 347 rsnd_mod_write(mod, SRC_BUSIF_DALIGN, rsnd_get_dalign(mod, io)); 397 348 398 349 rsnd_adg_set_src_timesel_gen2(mod, io, fin, fout); 350 + 351 + /* update SRC_IFSVR */ 352 + rsnd_src_set_convert_rate(io, mod); 399 353 400 354 return; 401 355 ··· 519 467 int ret; 520 468 521 469 /* reset sync convert_rate */ 522 - src->sync.val = 0; 470 + src->sync.val = 471 + src->current_sync_rate = 0; 523 472 524 473 ret = rsnd_mod_power_on(mod); 525 474 if (ret < 0) ··· 528 475 529 476 rsnd_src_activation(mod); 530 477 531 - rsnd_src_set_convert_rate(io, mod); 478 + rsnd_src_init_convert_rate(io, mod); 532 479 533 480 rsnd_src_status_clear(mod); 534 481 ··· 546 493 rsnd_mod_power_off(mod); 547 494 548 495 /* reset sync convert_rate */ 549 - src->sync.val = 0; 496 + src->sync.val = 497 + src->current_sync_rate = 0; 550 498 551 499 return 0; 552 500 } ··· 583 529 rsnd_mod_interrupt(mod, __rsnd_src_interrupt); 584 530 585 531 return IRQ_HANDLED; 532 + } 533 + 534 + static int rsnd_src_kctrl_accept_runtime(struct rsnd_dai_stream *io) 535 + { 536 + struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); 537 + 538 + if (!runtime) { 539 + struct rsnd_priv *priv = rsnd_io_to_priv(io); 540 + struct device *dev = rsnd_priv_to_dev(priv); 541 + 542 + dev_warn(dev, "\"SRC Out Rate\" can use during running\n"); 543 + 544 + return 0; 545 + } 546 + 547 + return 1; 586 548 } 587 549 588 550 static int rsnd_src_probe_(struct rsnd_mod *mod, ··· 655 585 "SRC Out Rate Switch" : 656 586 "SRC In Rate Switch", 657 587 rsnd_kctrl_accept_anytime, 658 - rsnd_src_set_convert_rate, 588 + rsnd_src_init_convert_rate, 659 589 &src->sen, 1); 660 590 if (ret < 0) 661 591 return ret; ··· 664 594 rsnd_io_is_play(io) ? 665 595 "SRC Out Rate" : 666 596 "SRC In Rate", 667 - rsnd_kctrl_accept_runtime, 597 + rsnd_src_kctrl_accept_runtime, 668 598 rsnd_src_set_convert_rate, 669 599 &src->sync, 192000); 670 600
+2 -1
sound/soc/renesas/rcar/ssi.c
··· 336 336 return 0; 337 337 338 338 rate_err: 339 - dev_err(dev, "unsupported clock rate\n"); 339 + dev_err(dev, "unsupported clock rate (%d)\n", rate); 340 + 340 341 return ret; 341 342 } 342 343
+2 -2
sound/soc/rockchip/rockchip_i2s_tdm.c
··· 451 451 break; 452 452 case SND_SOC_DAIFMT_DSP_A: 453 453 val = I2S_TXCR_TFS_TDM_PCM; 454 - tdm_val = TDM_SHIFT_CTRL(0); 454 + tdm_val = TDM_SHIFT_CTRL(2); 455 455 break; 456 456 case SND_SOC_DAIFMT_DSP_B: 457 457 val = I2S_TXCR_TFS_TDM_PCM; 458 - tdm_val = TDM_SHIFT_CTRL(2); 458 + tdm_val = TDM_SHIFT_CTRL(4); 459 459 break; 460 460 default: 461 461 ret = -EINVAL;
+17 -8
sound/soc/sof/amd/acp-ipc.c
··· 165 165 int dsp_msg, dsp_ack; 166 166 unsigned int status; 167 167 168 - if (sdev->first_boot && sdev->fw_state != SOF_FW_BOOT_COMPLETE) { 168 + if (unlikely(sdev->first_boot && sdev->fw_state != SOF_FW_BOOT_COMPLETE)) { 169 169 acp_mailbox_read(sdev, sdev->dsp_box.offset, &status, sizeof(status)); 170 + 170 171 if ((status & SOF_IPC_PANIC_MAGIC_MASK) == SOF_IPC_PANIC_MAGIC) { 171 172 snd_sof_dsp_panic(sdev, sdev->dsp_box.offset + sizeof(status), 172 173 true); ··· 189 188 190 189 dsp_ack = snd_sof_dsp_read(sdev, ACP_DSP_BAR, ACP_SCRATCH_REG_0 + dsp_ack_write); 191 190 if (dsp_ack) { 192 - spin_lock_irq(&sdev->ipc_lock); 193 - /* handle immediate reply from DSP core */ 194 - acp_dsp_ipc_get_reply(sdev); 195 - snd_sof_ipc_reply(sdev, 0); 196 - /* set the done bit */ 197 - acp_dsp_ipc_dsp_done(sdev); 198 - spin_unlock_irq(&sdev->ipc_lock); 191 + if (likely(sdev->fw_state == SOF_FW_BOOT_COMPLETE)) { 192 + spin_lock_irq(&sdev->ipc_lock); 193 + 194 + /* handle immediate reply from DSP core */ 195 + acp_dsp_ipc_get_reply(sdev); 196 + snd_sof_ipc_reply(sdev, 0); 197 + /* set the done bit */ 198 + acp_dsp_ipc_dsp_done(sdev); 199 + 200 + spin_unlock_irq(&sdev->ipc_lock); 201 + } else { 202 + dev_dbg_ratelimited(sdev->dev, "IPC reply before FW_BOOT_COMPLETE: %#x\n", 203 + dsp_ack); 204 + } 205 + 199 206 ipc_irq = true; 200 207 } 201 208
+1
sound/soc/sof/amd/acp.c
··· 27 27 static struct acp_quirk_entry quirk_valve_galileo = { 28 28 .signed_fw_image = true, 29 29 .skip_iram_dram_size_mod = true, 30 + .post_fw_run_delay = true, 30 31 }; 31 32 32 33 const struct dmi_system_id acp_sof_quirk_table[] = {
+1
sound/soc/sof/amd/acp.h
··· 220 220 struct acp_quirk_entry { 221 221 bool signed_fw_image; 222 222 bool skip_iram_dram_size_mod; 223 + bool post_fw_run_delay; 223 224 }; 224 225 225 226 /* Common device data struct for ACP devices */
-2
sound/soc/sof/amd/pci-vangogh.c
··· 13 13 14 14 #include <linux/module.h> 15 15 #include <linux/pci.h> 16 - #include <linux/platform_device.h> 17 16 #include <sound/sof.h> 18 17 #include <sound/soc-acpi.h> 19 18 20 - #include "../ops.h" 21 19 #include "../sof-pci-dev.h" 22 20 #include "../../amd/mach-config.h" 23 21 #include "acp.h"
+18 -4
sound/soc/sof/amd/vangogh.c
··· 11 11 * Hardware interface for Audio DSP on Vangogh platform 12 12 */ 13 13 14 - #include <linux/platform_device.h> 14 + #include <linux/delay.h> 15 15 #include <linux/module.h> 16 16 17 - #include "../ops.h" 18 - #include "../sof-audio.h" 19 17 #include "acp.h" 20 - #include "acp-dsp-offset.h" 21 18 22 19 #define I2S_HS_INSTANCE 0 23 20 #define I2S_BT_INSTANCE 1 ··· 133 136 }, 134 137 }; 135 138 139 + static int sof_vangogh_post_fw_run_delay(struct snd_sof_dev *sdev) 140 + { 141 + /* 142 + * Resuming from suspend in some cases my cause the DSP firmware 143 + * to enter an unrecoverable faulty state. Delaying a bit any host 144 + * to DSP transmission right after firmware boot completion seems 145 + * to resolve the issue. 146 + */ 147 + if (!sdev->first_boot) 148 + usleep_range(100, 150); 149 + 150 + return 0; 151 + } 152 + 136 153 /* Vangogh ops */ 137 154 struct snd_sof_dsp_ops sof_vangogh_ops; 138 155 EXPORT_SYMBOL_NS(sof_vangogh_ops, "SND_SOC_SOF_AMD_COMMON"); ··· 168 157 169 158 if (quirks->signed_fw_image) 170 159 sof_vangogh_ops.load_firmware = acp_sof_load_signed_firmware; 160 + 161 + if (quirks->post_fw_run_delay) 162 + sof_vangogh_ops.post_fw_run = sof_vangogh_post_fw_run_delay; 171 163 } 172 164 173 165 return 0;
+1
sound/soc/sof/intel/hda-codec.c
··· 454 454 } 455 455 EXPORT_SYMBOL_NS_GPL(hda_codec_i915_exit, "SND_SOC_SOF_HDA_AUDIO_CODEC_I915"); 456 456 457 + MODULE_SOFTDEP("pre: snd-hda-codec-hdmi"); 457 458 #endif 458 459 459 460 MODULE_LICENSE("Dual BSD/GPL");
+1
sound/soc/sof/intel/pci-ptl.c
··· 50 50 /* PCI IDs */ 51 51 static const struct pci_device_id sof_pci_ids[] = { 52 52 { PCI_DEVICE_DATA(INTEL, HDA_PTL, &ptl_desc) }, /* PTL */ 53 + { PCI_DEVICE_DATA(INTEL, HDA_PTL_H, &ptl_desc) }, /* PTL-H */ 53 54 { 0, } 54 55 }; 55 56 MODULE_DEVICE_TABLE(pci, sof_pci_ids);
+10 -2
sound/soc/sof/ipc4-topology.c
··· 765 765 } 766 766 767 767 list_for_each_entry(w, &sdev->widget_list, list) { 768 - if (w->widget->sname && 768 + struct snd_sof_dai *alh_dai; 769 + 770 + if (!WIDGET_IS_DAI(w->id) || !w->widget->sname || 769 771 strcmp(w->widget->sname, swidget->widget->sname)) 772 + continue; 773 + 774 + alh_dai = w->private; 775 + if (alh_dai->type != SOF_DAI_INTEL_ALH) 770 776 continue; 771 777 772 778 blob->alh_cfg.device_count++; ··· 2067 2061 list_for_each_entry(w, &sdev->widget_list, list) { 2068 2062 u32 node_type; 2069 2063 2070 - if (w->widget->sname && 2064 + if (!WIDGET_IS_DAI(w->id) || !w->widget->sname || 2071 2065 strcmp(w->widget->sname, swidget->widget->sname)) 2072 2066 continue; 2073 2067 2074 2068 dai = w->private; 2069 + if (dai->type != SOF_DAI_INTEL_ALH) 2070 + continue; 2075 2071 alh_copier = (struct sof_ipc4_copier *)dai->private; 2076 2072 alh_data = &alh_copier->data; 2077 2073 node_type = SOF_IPC4_GET_NODE_TYPE(alh_data->gtw_cfg.node_id);
+2
sound/soc/sof/pcm.c
··· 511 511 */ 512 512 } 513 513 514 + spcm->stream[substream->stream].substream = NULL; 515 + 514 516 return 0; 515 517 } 516 518
+5 -1
sound/soc/sof/stream-ipc.c
··· 43 43 return -ESTRPIPE; 44 44 45 45 posn_offset = stream->posn_offset; 46 - } else { 46 + } else if (sps->cstream) { 47 47 48 48 struct sof_compr_stream *sstream = sps->cstream->runtime->private_data; 49 49 ··· 51 51 return -ESTRPIPE; 52 52 53 53 posn_offset = sstream->posn_offset; 54 + 55 + } else { 56 + dev_err(sdev->dev, "%s: No stream opened\n", __func__); 57 + return -EINVAL; 54 58 } 55 59 56 60 snd_sof_dsp_mailbox_read(sdev, posn_offset, p, sz);