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

Pull sound fixes from Takashi Iwai:
"A collection of small fixes. Nothing really stands out, fortunately.

- Follow-up fixes for the new compress offload API extension

- A few ASoC SOF, AMD and Mediatek quirks and fixes

- A regression fix in legacy SH driver cleanup

- Fix DMA mapping error handling in the helper code

- Fix kselftest dependency"

* tag 'sound-6.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: sh: Fix wrong argument order for copy_from_iter()
selftests/alsa: Fix circular dependency involving global-timer
ALSA: memalloc: prefer dma_mapping_error() over explicit address checking
ALSA: compress_offload: improve file descriptors installation for dma-buf
ALSA: compress_offload: use safe list iteration in snd_compr_task_seq()
ALSA: compress_offload: avoid 64-bit get_user()
ALSA: compress_offload: import DMA_BUF namespace
ASoC: mediatek: disable buffer pre-allocation
ASoC: rt722: add delay time to wait for the calibration procedure
ASoC: SOF: Intel: hda-dai: Do not release the link DMA on STOP
ASoC: dt-bindings: realtek,rt5645: Fix CPVDD voltage comment
ASoC: Intel: sof_sdw: Fix DMI match for Lenovo 21QA and 21QB
ASoC: Intel: sof_sdw: Fix DMI match for Lenovo 21Q6 and 21Q7
ASoC: amd: ps: Fix for enabling DMIC on acp63 platform via _DSD entry

+88 -31
+1 -1
Documentation/devicetree/bindings/sound/realtek,rt5645.yaml
··· 51 51 description: Power supply for AVDD, providing 1.8V. 52 52 53 53 cpvdd-supply: 54 - description: Power supply for CPVDD, providing 3.5V. 54 + description: Power supply for CPVDD, providing 1.8V. 55 55 56 56 hp-detect-gpios: 57 57 description:
+21 -12
sound/core/compress_offload.c
··· 1025 1025 static int snd_compr_task_new(struct snd_compr_stream *stream, struct snd_compr_task *utask) 1026 1026 { 1027 1027 struct snd_compr_task_runtime *task; 1028 - int retval; 1028 + int retval, fd_i, fd_o; 1029 1029 1030 1030 if (stream->runtime->total_tasks >= stream->runtime->fragments) 1031 1031 return -EBUSY; ··· 1039 1039 retval = stream->ops->task_create(stream, task); 1040 1040 if (retval < 0) 1041 1041 goto cleanup; 1042 - utask->input_fd = dma_buf_fd(task->input, O_WRONLY|O_CLOEXEC); 1043 - if (utask->input_fd < 0) { 1044 - retval = utask->input_fd; 1042 + /* similar functionality as in dma_buf_fd(), but ensure that both 1043 + file descriptors are allocated before fd_install() */ 1044 + if (!task->input || !task->input->file || !task->output || !task->output->file) { 1045 + retval = -EINVAL; 1045 1046 goto cleanup; 1046 1047 } 1047 - utask->output_fd = dma_buf_fd(task->output, O_RDONLY|O_CLOEXEC); 1048 - if (utask->output_fd < 0) { 1049 - retval = utask->output_fd; 1048 + fd_i = get_unused_fd_flags(O_WRONLY|O_CLOEXEC); 1049 + if (fd_i < 0) 1050 + goto cleanup; 1051 + fd_o = get_unused_fd_flags(O_RDONLY|O_CLOEXEC); 1052 + if (fd_o < 0) { 1053 + put_unused_fd(fd_i); 1050 1054 goto cleanup; 1051 1055 } 1056 + fd_install(fd_i, task->input->file); 1057 + fd_install(fd_o, task->output->file); 1058 + utask->input_fd = fd_i; 1059 + utask->output_fd = fd_o; 1052 1060 /* keep dmabuf reference until freed with task free ioctl */ 1053 1061 dma_buf_get(utask->input_fd); 1054 1062 dma_buf_get(utask->output_fd); ··· 1182 1174 static int snd_compr_task_seq(struct snd_compr_stream *stream, unsigned long arg, 1183 1175 snd_compr_seq_func_t fcn) 1184 1176 { 1185 - struct snd_compr_task_runtime *task; 1177 + struct snd_compr_task_runtime *task, *temp; 1186 1178 __u64 seqno; 1187 1179 int retval; 1188 1180 1189 1181 if (stream->runtime->state != SNDRV_PCM_STATE_SETUP) 1190 1182 return -EPERM; 1191 - retval = get_user(seqno, (__u64 __user *)arg); 1192 - if (retval < 0) 1193 - return retval; 1183 + retval = copy_from_user(&seqno, (__u64 __user *)arg, sizeof(seqno)); 1184 + if (retval) 1185 + return -EFAULT; 1194 1186 retval = 0; 1195 1187 if (seqno == 0) { 1196 - list_for_each_entry_reverse(task, &stream->runtime->tasks, list) 1188 + list_for_each_entry_safe_reverse(task, temp, &stream->runtime->tasks, list) 1197 1189 fcn(stream, task); 1198 1190 } else { 1199 1191 task = snd_compr_find_task(stream, seqno); ··· 1255 1247 } 1256 1248 EXPORT_SYMBOL_GPL(snd_compr_task_finished); 1257 1249 1250 + MODULE_IMPORT_NS("DMA_BUF"); 1258 1251 #endif /* CONFIG_SND_COMPRESS_ACCEL */ 1259 1252 1260 1253 static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
+1 -1
sound/core/memalloc.c
··· 505 505 if (!p) 506 506 return NULL; 507 507 dmab->addr = dma_map_single(dmab->dev.dev, p, size, DMA_BIDIRECTIONAL); 508 - if (dmab->addr == DMA_MAPPING_ERROR) { 508 + if (dma_mapping_error(dmab->dev.dev, dmab->addr)) { 509 509 do_free_pages(dmab->area, size, true); 510 510 return NULL; 511 511 }
+1 -1
sound/sh/sh_dac_audio.c
··· 163 163 /* channel is not used (interleaved data) */ 164 164 struct snd_sh_dac *chip = snd_pcm_substream_chip(substream); 165 165 166 - if (copy_from_iter(chip->data_buffer + pos, src, count) != count) 166 + if (copy_from_iter(chip->data_buffer + pos, count, src) != count) 167 167 return -EFAULT; 168 168 chip->buffer_end = chip->data_buffer + pos + count; 169 169
+16 -1
sound/soc/amd/ps/pci-ps.c
··· 375 375 { 376 376 struct acpi_device *pdm_dev; 377 377 const union acpi_object *obj; 378 + acpi_handle handle; 379 + acpi_integer dmic_status; 378 380 u32 config; 379 381 bool is_dmic_dev = false; 380 382 bool is_sdw_dev = false; 383 + bool wov_en, dmic_en; 381 384 int ret; 385 + 386 + /* IF WOV entry not found, enable dmic based on acp-audio-device-type entry*/ 387 + wov_en = true; 388 + dmic_en = false; 382 389 383 390 config = readl(acp_data->acp63_base + ACP_PIN_CONFIG); 384 391 switch (config) { ··· 419 412 if (!acpi_dev_get_property(pdm_dev, "acp-audio-device-type", 420 413 ACPI_TYPE_INTEGER, &obj) && 421 414 obj->integer.value == ACP_DMIC_DEV) 422 - is_dmic_dev = true; 415 + dmic_en = true; 423 416 } 417 + 418 + handle = ACPI_HANDLE(&pci->dev); 419 + ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status); 420 + if (!ACPI_FAILURE(ret)) 421 + wov_en = dmic_status; 424 422 } 423 + 424 + if (dmic_en && wov_en) 425 + is_dmic_dev = true; 425 426 426 427 if (acp_data->is_sdw_config) { 427 428 ret = acp_scan_sdw_devices(&pci->dev, ACP63_SDW_ADDR);
+6 -1
sound/soc/codecs/rt722-sdca.c
··· 1468 1468 0x008d); 1469 1469 /* check HP calibration FSM status */ 1470 1470 for (loop_check = 0; loop_check < chk_cnt; loop_check++) { 1471 + usleep_range(10000, 11000); 1471 1472 ret = rt722_sdca_index_read(rt722, RT722_VENDOR_CALI, 1472 1473 RT722_DAC_DC_CALI_CTL3, &calib_status); 1473 - if (ret < 0 || loop_check == chk_cnt) 1474 + if (ret < 0) 1474 1475 dev_dbg(&rt722->slave->dev, "calibration failed!, ret=%d\n", ret); 1475 1476 if ((calib_status & 0x0040) == 0x0) 1476 1477 break; 1477 1478 } 1479 + 1480 + if (loop_check == chk_cnt) 1481 + dev_dbg(&rt722->slave->dev, "%s, calibration time-out!\n", __func__); 1482 + 1478 1483 /* Set ADC09 power entity floating control */ 1479 1484 rt722_sdca_index_write(rt722, RT722_VENDOR_HDA_CTL, RT722_ADC0A_08_PDE_FLOAT_CTL, 1480 1485 0x2a12);
+20 -3
sound/soc/intel/boards/sof_sdw.c
··· 632 632 .callback = sof_sdw_quirk_cb, 633 633 .matches = { 634 634 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 635 - DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "233C") 635 + DMI_MATCH(DMI_PRODUCT_NAME, "21QB") 636 636 }, 637 637 /* Note this quirk excludes the CODEC mic */ 638 638 .driver_data = (void *)(SOC_SDW_CODEC_MIC), ··· 641 641 .callback = sof_sdw_quirk_cb, 642 642 .matches = { 643 643 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 644 - DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "233B") 644 + DMI_MATCH(DMI_PRODUCT_NAME, "21QA") 645 645 }, 646 - .driver_data = (void *)(SOC_SDW_SIDECAR_AMPS), 646 + /* Note this quirk excludes the CODEC mic */ 647 + .driver_data = (void *)(SOC_SDW_CODEC_MIC), 648 + }, 649 + { 650 + .callback = sof_sdw_quirk_cb, 651 + .matches = { 652 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 653 + DMI_MATCH(DMI_PRODUCT_NAME, "21Q6") 654 + }, 655 + .driver_data = (void *)(SOC_SDW_SIDECAR_AMPS | SOC_SDW_CODEC_MIC), 656 + }, 657 + { 658 + .callback = sof_sdw_quirk_cb, 659 + .matches = { 660 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 661 + DMI_MATCH(DMI_PRODUCT_NAME, "21Q7") 662 + }, 663 + .driver_data = (void *)(SOC_SDW_SIDECAR_AMPS | SOC_SDW_CODEC_MIC), 647 664 }, 648 665 649 666 /* ArrowLake devices */
+2 -2
sound/soc/mediatek/common/mtk-afe-platform-driver.c
··· 120 120 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); 121 121 122 122 size = afe->mtk_afe_hardware->buffer_bytes_max; 123 - snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, 124 - afe->dev, size, size); 123 + snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, afe->dev, 0, size); 124 + 125 125 return 0; 126 126 } 127 127 EXPORT_SYMBOL_GPL(mtk_afe_pcm_new);
+19 -6
sound/soc/sof/intel/hda-dai.c
··· 103 103 return sdai->platform_private; 104 104 } 105 105 106 - int hda_link_dma_cleanup(struct snd_pcm_substream *substream, struct hdac_ext_stream *hext_stream, 107 - struct snd_soc_dai *cpu_dai) 106 + static int 107 + hda_link_dma_cleanup(struct snd_pcm_substream *substream, 108 + struct hdac_ext_stream *hext_stream, 109 + struct snd_soc_dai *cpu_dai, bool release) 108 110 { 109 111 const struct hda_dai_widget_dma_ops *ops = hda_dai_get_ops(substream, cpu_dai); 110 112 struct sof_intel_hda_stream *hda_stream; ··· 128 126 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 129 127 stream_tag = hdac_stream(hext_stream)->stream_tag; 130 128 snd_hdac_ext_bus_link_clear_stream_id(hlink, stream_tag); 129 + } 130 + 131 + if (!release) { 132 + /* 133 + * Force stream reconfiguration without releasing the channel on 134 + * subsequent stream restart (without free), including LinkDMA 135 + * reset. 136 + * The stream is released via hda_dai_hw_free() 137 + */ 138 + hext_stream->link_prepared = 0; 139 + return 0; 131 140 } 132 141 133 142 if (ops->release_hext_stream) ··· 224 211 if (!hext_stream) 225 212 return 0; 226 213 227 - return hda_link_dma_cleanup(substream, hext_stream, cpu_dai); 214 + return hda_link_dma_cleanup(substream, hext_stream, cpu_dai, true); 228 215 } 229 216 230 217 static int __maybe_unused hda_dai_hw_params_data(struct snd_pcm_substream *substream, ··· 317 304 switch (cmd) { 318 305 case SNDRV_PCM_TRIGGER_STOP: 319 306 case SNDRV_PCM_TRIGGER_SUSPEND: 320 - ret = hda_link_dma_cleanup(substream, hext_stream, dai); 307 + ret = hda_link_dma_cleanup(substream, hext_stream, dai, 308 + cmd == SNDRV_PCM_TRIGGER_STOP ? false : true); 321 309 if (ret < 0) { 322 310 dev_err(sdev->dev, "%s: failed to clean up link DMA\n", __func__); 323 311 return ret; ··· 674 660 } 675 661 676 662 ret = hda_link_dma_cleanup(hext_stream->link_substream, 677 - hext_stream, 678 - cpu_dai); 663 + hext_stream, cpu_dai, true); 679 664 if (ret < 0) 680 665 return ret; 681 666 }
-2
sound/soc/sof/intel/hda.h
··· 1038 1038 hda_select_dai_widget_ops(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget); 1039 1039 int hda_dai_config(struct snd_soc_dapm_widget *w, unsigned int flags, 1040 1040 struct snd_sof_dai_config_data *data); 1041 - int hda_link_dma_cleanup(struct snd_pcm_substream *substream, struct hdac_ext_stream *hext_stream, 1042 - struct snd_soc_dai *cpu_dai); 1043 1041 1044 1042 static inline struct snd_sof_dev *widget_to_sdev(struct snd_soc_dapm_widget *w) 1045 1043 {
+1 -1
tools/testing/selftests/alsa/Makefile
··· 27 27 $(OUTPUT)/libatest.so: conf.c alsa-local.h 28 28 $(CC) $(CFLAGS) -shared -fPIC $< $(LDLIBS) -o $@ 29 29 30 - $(OUTPUT)/%: %.c $(TEST_GEN_PROGS_EXTENDED) alsa-local.h 30 + $(OUTPUT)/%: %.c $(OUTPUT)/libatest.so alsa-local.h 31 31 $(CC) $(CFLAGS) $< $(LDLIBS) -latest -o $@