Commit d6ef8b40 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 23db0ed3 8cbd01ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ properties:
    description: Power supply for AVDD, providing 1.8V.

  cpvdd-supply:
    description: Power supply for CPVDD, providing 3.5V.
    description: Power supply for CPVDD, providing 1.8V.

  hp-detect-gpios:
    description: 
+21 −12
Original line number Diff line number Diff line
@@ -1025,7 +1025,7 @@ static u64 snd_compr_seqno_next(struct snd_compr_stream *stream)
static int snd_compr_task_new(struct snd_compr_stream *stream, struct snd_compr_task *utask)
{
	struct snd_compr_task_runtime *task;
	int retval;
	int retval, fd_i, fd_o;

	if (stream->runtime->total_tasks >= stream->runtime->fragments)
		return -EBUSY;
@@ -1039,16 +1039,24 @@ static int snd_compr_task_new(struct snd_compr_stream *stream, struct snd_compr_
	retval = stream->ops->task_create(stream, task);
	if (retval < 0)
		goto cleanup;
	utask->input_fd = dma_buf_fd(task->input, O_WRONLY|O_CLOEXEC);
	if (utask->input_fd < 0) {
		retval = utask->input_fd;
	/* similar functionality as in dma_buf_fd(), but ensure that both
	   file descriptors are allocated before fd_install() */
	if (!task->input || !task->input->file || !task->output || !task->output->file) {
		retval = -EINVAL;
		goto cleanup;
	}
	utask->output_fd = dma_buf_fd(task->output, O_RDONLY|O_CLOEXEC);
	if (utask->output_fd < 0) {
		retval = utask->output_fd;
	fd_i = get_unused_fd_flags(O_WRONLY|O_CLOEXEC);
	if (fd_i < 0)
		goto cleanup;
	fd_o = get_unused_fd_flags(O_RDONLY|O_CLOEXEC);
	if (fd_o < 0) {
		put_unused_fd(fd_i);
		goto cleanup;
	}
	fd_install(fd_i, task->input->file);
	fd_install(fd_o, task->output->file);
	utask->input_fd = fd_i;
	utask->output_fd = fd_o;
	/* keep dmabuf reference until freed with task free ioctl */
	dma_buf_get(utask->input_fd);
	dma_buf_get(utask->output_fd);
@@ -1174,18 +1182,18 @@ typedef void (*snd_compr_seq_func_t)(struct snd_compr_stream *stream,
static int snd_compr_task_seq(struct snd_compr_stream *stream, unsigned long arg,
					snd_compr_seq_func_t fcn)
{
	struct snd_compr_task_runtime *task;
	struct snd_compr_task_runtime *task, *temp;
	__u64 seqno;
	int retval;

	if (stream->runtime->state != SNDRV_PCM_STATE_SETUP)
		return -EPERM;
	retval = get_user(seqno, (__u64 __user *)arg);
	if (retval < 0)
		return retval;
	retval = copy_from_user(&seqno, (__u64 __user *)arg, sizeof(seqno));
	if (retval)
		return -EFAULT;
	retval = 0;
	if (seqno == 0) {
		list_for_each_entry_reverse(task, &stream->runtime->tasks, list)
		list_for_each_entry_safe_reverse(task, temp, &stream->runtime->tasks, list)
			fcn(stream, task);
	} else {
		task = snd_compr_find_task(stream, seqno);
@@ -1247,6 +1255,7 @@ void snd_compr_task_finished(struct snd_compr_stream *stream,
}
EXPORT_SYMBOL_GPL(snd_compr_task_finished);

MODULE_IMPORT_NS("DMA_BUF");
#endif /* CONFIG_SND_COMPRESS_ACCEL */

static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
+1 −1
Original line number Diff line number Diff line
@@ -505,7 +505,7 @@ static void *snd_dma_wc_alloc(struct snd_dma_buffer *dmab, size_t size)
	if (!p)
		return NULL;
	dmab->addr = dma_map_single(dmab->dev.dev, p, size, DMA_BIDIRECTIONAL);
	if (dmab->addr == DMA_MAPPING_ERROR) {
	if (dma_mapping_error(dmab->dev.dev, dmab->addr)) {
		do_free_pages(dmab->area, size, true);
		return NULL;
	}
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ static int snd_sh_dac_pcm_copy(struct snd_pcm_substream *substream,
	/* channel is not used (interleaved data) */
	struct snd_sh_dac *chip = snd_pcm_substream_chip(substream);

	if (copy_from_iter(chip->data_buffer + pos, src, count) != count)
	if (copy_from_iter(chip->data_buffer + pos, count, src) != count)
		return -EFAULT;
	chip->buffer_end = chip->data_buffer + pos + count;

+16 −1
Original line number Diff line number Diff line
@@ -375,11 +375,18 @@ static int get_acp63_device_config(struct pci_dev *pci, struct acp63_dev_data *a
{
	struct acpi_device *pdm_dev;
	const union acpi_object *obj;
	acpi_handle handle;
	acpi_integer dmic_status;
	u32 config;
	bool is_dmic_dev = false;
	bool is_sdw_dev = false;
	bool wov_en, dmic_en;
	int ret;

	/* IF WOV entry not found, enable dmic based on acp-audio-device-type entry*/
	wov_en = true;
	dmic_en = false;

	config = readl(acp_data->acp63_base + ACP_PIN_CONFIG);
	switch (config) {
	case ACP_CONFIG_4:
@@ -412,10 +419,18 @@ static int get_acp63_device_config(struct pci_dev *pci, struct acp63_dev_data *a
			if (!acpi_dev_get_property(pdm_dev, "acp-audio-device-type",
						   ACPI_TYPE_INTEGER, &obj) &&
						   obj->integer.value == ACP_DMIC_DEV)
				is_dmic_dev = true;
				dmic_en = true;
		}

		handle = ACPI_HANDLE(&pci->dev);
		ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
		if (!ACPI_FAILURE(ret))
			wov_en = dmic_status;
	}

	if (dmic_en && wov_en)
		is_dmic_dev = true;

	if (acp_data->is_sdw_config) {
		ret = acp_scan_sdw_devices(&pci->dev, ACP63_SDW_ADDR);
		if (!ret && acp_data->info.link_mask)
Loading