- 02 8月, 2021 1 次提交
-
-
由 Takashi Iwai 提交于
PCM buffers might be allocated dynamically when the buffer preallocation failed or a larger buffer is requested, and it's not guaranteed that substream->dma_buffer points to the actually used buffer. The driver needs to refer to substream->runtime->dma_addr instead for the buffer address. Cc: <stable@vger.kernel.org> Signed-off-by: NTakashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20210731084331.32225-1-tiwai@suse.deSigned-off-by: NMark Brown <broonie@kernel.org>
-
- 24 7月, 2020 1 次提交
-
-
由 Kuninori Morimoto 提交于
Now we can use asoc_substream_to_rtd() macro, let's use it. Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87ft9n0ytv.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: NMark Brown <broonie@kernel.org>
-
- 11 12月, 2019 2 次提交
-
-
由 Takashi Iwai 提交于
ASoC PCM core deals the empty ioctl field now as default. Let's kill the redundant lines. Signed-off-by: NTakashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20191210145406.21419-2-tiwai@suse.deSigned-off-by: NMark Brown <broonie@kernel.org>
-
由 Takashi Iwai 提交于
Clean up the drivers with the new managed buffer allocation API. The superfluous snd_pcm_lib_malloc_pages() and snd_pcm_lib_free_pages() calls are dropped. Signed-off-by: NTakashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20191210142614.19405-2-tiwai@suse.deSigned-off-by: NMark Brown <broonie@kernel.org>
-
- 08 10月, 2019 1 次提交
-
-
由 Kuninori Morimoto 提交于
snd_pcm_ops is no longer needed. Let's use component driver callback. Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87imp7af1t.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: NMark Brown <broonie@kernel.org>
-
- 04 9月, 2019 1 次提交
-
-
由 YueHaibing 提交于
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: NHulk Robot <hulkci@huawei.com> Signed-off-by: NYueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20190904074833.23572-1-yuehaibing@huawei.comSigned-off-by: NMark Brown <broonie@kernel.org>
-
- 05 6月, 2019 1 次提交
-
-
由 Thomas Gleixner 提交于
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms and conditions of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 263 file(s). Signed-off-by: NThomas Gleixner <tglx@linutronix.de> Reviewed-by: NAllison Randal <allison@lohutok.net> Reviewed-by: NAlexios Zavras <alexios.zavras@intel.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141901.208660670@linutronix.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 07 2月, 2019 1 次提交
-
-
由 Takashi Iwai 提交于
snd_pcm_lib_preallocate_pages() and co always succeed, so the error check is simply redundant. Drop it. Reviewed-by: NJaroslav Kysela <perex@perex.cz> Acked-by: NMark Brown <broonie@kernel.org> Signed-off-by: NTakashi Iwai <tiwai@suse.de>
-
- 06 12月, 2018 2 次提交
-
-
由 Yu Zhao 提交于
AMD platform device acp_audio_dma can only be created by parent PCI device driver (drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c). Pass struct device of the parent to snd_pcm_lib_preallocate_pages() so dma_alloc_coherent() can use correct dma_ops. Otherwise, it will use default dma_ops which is nommu_dma_ops on x86_64 even when IOMMU is enabled and set to non passthrough mode. Though platform device inherits some dma related fields during its creation in mfd_add_device(), we can't simply pass its struct device to snd_pcm_lib_preallocate_pages() because dma_ops is not among the inherited fields. Even it were, drivers/iommu/amd_iommu.c would ignore it because get_device_id() doesn't handle platform device. This change shouldn't give us any trouble even struct device of the parent becomes null or represents some non PCI device in the future, because get_dma_ops() correctly handles null struct device or uses the default dma_ops if struct device doesn't have it set. Signed-off-by: NYu Zhao <yuzhao@google.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Yu Zhao 提交于
We shouldn't assume CPU physical address we get from page_to_phys() is same as DMA address we get from dma_alloc_coherent(). On x86_64, we won't run into any problem with the assumption when dma_ops is nommu_dma_ops. However, DMA address is IOVA when IOMMU is enabled. And it's most likely different from CPU physical address when AMD IOMMU is not in passthrough mode. Signed-off-by: NYu Zhao <yuzhao@google.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 19 9月, 2018 1 次提交
-
-
由 Akshu Agrawal 提交于
alsa_conformance_test -C hw:0,4 -p 1024 --debug would sometime show: TIME_DIFF(s) HW_LEVEL READ RATE 0.000095970 1024 1024 10670001.041992 0.042609555 1024 2048 24032.168372 0.021330364 1024 3072 48006.681930 0.021339559 1024 4096 47985.996337 The issue is that in dma pointer function we can have stale value of the register for current descriptor of channel. The register retains the number of the last descriptor that was transferred. Fix ensures that we report position, 0, till the one period worth of data is transferred. After one period of data, in handler of period completion interrupt we update the config and correct value of descriptor starts reflecting. Signed-off-by: NAkshu Agrawal <akshu.agrawal@amd.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 11 9月, 2018 1 次提交
-
-
由 Akshu Agrawal 提交于
If capture and playback are started on different channel (I2S/BT) there is a possibilty that channel information passed from machine driver is overwritten before the configuration is done in dma driver. Example: 113.597588: cz_max_startup: ---playback sets BT channel 113.597694: cz_dmic1_startup: ---capture sets I2S channel 113.597979: acp_dma_hw_params: ---configures capture for I2S channel 113.598114: acp_dma_hw_params: ---configures playback for I2S channel This is fixed by having 2 separate instance for playback and capture. Signed-off-by: NAkshu Agrawal <akshu.agrawal@amd.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 10 9月, 2018 1 次提交
-
-
由 Akshu Agrawal 提交于
HW register descriptions says: "DMA Channel Reset...Software must confirm that this bit is cleared before reprogramming any of the channel configuration registers." There could be cases where dma stop errored out leaving dma channel in reset state. We need to ensure that before the start of another dma, channel is out of the reset state. Signed-off-by: NAkshu Agrawal <akshu.agrawal@amd.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 07 8月, 2018 3 次提交
-
-
由 Akshu Agrawal 提交于
ACP->SYSMEM DMA happens at every I2S->SYSMEM period completion. Thus, there is delay of x frames till I2S->SYSMEM reaches a period length. This delay is communicated to user space. Signed-off-by: NAkshu Agrawal <akshu.agrawal@amd.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Mukunda, Vijendar 提交于
Give position on ACP->SYSMEM DMA channel for the number of bytes that have been transferred on the basis of current descriptor under service. Signed-off-by: NVijendar Mukunda <Vijendar.Mukunda@amd.com> Signed-off-by: NAkshu Agrawal <akshu.agrawal@amd.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Akshu Agrawal 提交于
In capture case we don't want ACP to SYSMEM dma to be circular. This is because if an in place DSP filter is applied to captured output then circular DMA can overwrite the filter value with stale data. Signed-off-by: NAkshu Agrawal <akshu.agrawal@amd.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 16 7月, 2018 2 次提交
-
-
由 Agrawal, Akshu 提交于
Having interrupts enabled for ACP<->SYSMEM DMA transfer, we are in for an interrupt storm. For both playback and capture interrupts should be enabled for I2S<->ACP DMA. Signed-off-by: NAkshu Agrawal <akshu.agrawal@amd.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Agrawal, Akshu 提交于
Earlier, ch1 was used to define ACP-SYSMEM transfer and ch2 for ACP-I2S transfer. With recent patches ch1 is used to define channel order number 1 and ch2 as channel order number 2. Thus, Playback: ch1:SYSMEM->ACP ch2:ACP->I2S Capture: ch1:I2S->ACP ch1:ACP->SYSMEM Signed-off-by: NAkshu Agrawal <akshu.agrawal@amd.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 03 7月, 2018 6 次提交
-
-
由 Daniel Kurtz 提交于
Now that the I2S channel names are fixed, and DMA data flow order is consistent (ch1 then ch2), we can simplify channel start order: start the upstream channel and then the downstream channel for both playback and capture cases. Signed-off-by: NDaniel Kurtz <djkurtz@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Daniel Kurtz 提交于
The pointer() callback gets its value by reading the I2S BYTE_COUNT register. This is a 64-bit runnning transaction counter. If a transaction was aborted in the middle of a sample buffer, the counter will stop counting on a number divisible by the buffer size. Since we actually use it as a pointer into an aligned buffer, however, we do want to ensure that it always starts at a number divisible by the buffer size when starting a transaction, hence we reset it whenever starting a transaction. To accomplish this, it wasn't necessary to zero bytescount at the termination of each transaction, so remove this unnecessary code. Signed-off-by: NDaniel Kurtz <djkurtz@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Daniel Kurtz 提交于
On capture, audio data is first copied from I2S to ACP memory, and then from ACP to SYSRAM. The I2S_TO_ACP_DMA interrupt fires on every sample transferred from I2S to ACP memory. That is it fires ~48000 times per second when capturing @ 48 kHz. Since we don't do anything on this interrupt anyway, disable it to save quite a few unnecessary interrupts. The real "work" (calling snd_pcm_period_elapsed()) is done when transfer from ACP to SYSRAM is complete. Signed-off-by: NDaniel Kurtz <djkurtz@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Daniel Kurtz 提交于
On capture, audio data is first copied from I2S to ACP memory, and then to SYSRAM. For each step the channel number increases, so the names in the driver were wrong. Signed-off-by: NDaniel Kurtz <djkurtz@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Daniel Kurtz 提交于
It is always correct to subtract out the starting bytescount value. Even in the case of 2^64 byte rollover (292 Million Years in the future @ 48000 Hz) the math still works out. Signed-off-by: NDaniel Kurtz <djkurtz@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Daniel Kurtz 提交于
Commit 6b116dfb ("ASoC: AMD: make channel 1 dma as circular") made both channels circular, so this comment and logic no longer applies. Always stop ch2 (the channel closest to the output) before ch1. This ensures that the downstream circular DMA channel does not continue to play/capture repeated samples after the upstream circular DMA channel has already stopped. Signed-off-by: NDaniel Kurtz <djkurtz@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 22 6月, 2018 1 次提交
-
-
由 Akshu Agrawal 提交于
ST/CZ SoC have 2 channels for capture in the I2SSP path. The DMA though these channels is done using the same dma descriptors. We configure the channel and enable it on the basis of channel selected by machine driver. Machine driver knows which codec sits on which channel and thus sends the information to dma driver. Signed-off-by: NAkshu Agrawal <akshu.agrawal@amd.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 18 6月, 2018 1 次提交
-
-
由 Agrawal, Akshu 提交于
Fix crash in those platforms whose machine driver does not expose platform_info. For those platforms we rely on default value and select I2SSP channel. Signed-off-by: NAkshu Agrawal <akshu.agrawal@amd.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 29 5月, 2018 1 次提交
-
-
由 Agrawal, Akshu 提交于
channel 1: SYSMEM<->ACP channel 2: ACP<->I2S Instead of waiting on period interrupt of ch 2 and then starting dma on ch1, we make ch1 dma as circular. This removes dependency of period granularity on hw pointer. Signed-off-by: NAkshu Agrawal <akshu.agrawal@amd.com> Reviewed-by: NDaniel Kurtz <djkurtz@chromium.org> Tested-by: NDaniel Kurtz <djkurtz@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 21 5月, 2018 4 次提交
-
-
由 Mukunda, Vijendar 提交于
With in ACP, There are three I2S controllers can be configured/enabled ( I2S SP, I2S MICSP, I2S BT). Default enabled I2S controller instance is I2S SP. This patch provides required changes to support I2S BT controller Instance. Signed-off-by: NVijendar Mukunda <Vijendar.Mukunda@amd.com> Reviewed-by: NDaniel Kurtz <djkurtz@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Mukunda, Vijendar 提交于
rtd structure freed early may result in kernel panic in dma close call back. moved releasing memory for rtd structure to the end of dma close callback. Signed-off-by: NVijendar Mukunda <Vijendar.Mukunda@amd.com> Reviewed-by: NDaniel Kurtz <djkurtz@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Mukunda, Vijendar 提交于
Added sram bank variable to audio_substream_data structure. Signed-off-by: NVijendar Mukunda <Vijendar.Mukunda@amd.com> Reviewed-by: NDaniel Kurtz <djkurtz@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Mukunda, Vijendar 提交于
Added pte offset variable in audio_substream_data structure. Added Stoney related PTE offset macros in acp header file. Modified hw_params callback to assign the pte offset value based on asic_type. PTE Offset macros used to calculate no of PTE entries need to be programmed when memory allocated for audio buffer. Depending upon allocated audio buffer size, PTE offset values will change. Compared to CZ, Stoney has SRAM memory limitation i.e 48k It is required to define separate PTE Offset macros for Stoney. Signed-off-by: NVijendar Mukunda <Vijendar.Mukunda@amd.com> Reviewed-by: NDaniel Kurtz <djkurtz@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 11 5月, 2018 3 次提交
-
-
由 Vijendar Mukunda 提交于
Removed separate byte count variables for playback and capture. Signed-off-by: NVijendar Mukunda <Vijendar.Mukunda@amd.com> Reviewed-by: NDaniel Kurtz <djkurtz@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Vijendar Mukunda 提交于
Added byte count register offset variables to audio_substream_data structure. Modified dma pointer callback. Signed-off-by: NVijendar Mukunda <Vijendar.Mukunda@amd.com> Reviewed-by: NDaniel Kurtz <djkurtz@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Vijendar Mukunda 提交于
Added dma configuration parameters to rtd structure. Moved dma configuration parameters initialization to hw_params callback. Removed hard coding in prepare and trigger callbacks. Signed-off-by: NVijendar Mukunda <Vijendar.Mukunda@amd.com> Reviewed-by: NDaniel Kurtz <djkurtz@chromium.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 02 5月, 2018 1 次提交
-
-
由 Colin Ian King 提交于
Trivial fix to spelling mistake in dev_err error message Signed-off-by: NColin Ian King <colin.king@canonical.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 26 4月, 2018 1 次提交
-
-
由 Mukunda, Vijendar 提交于
In order to make audio_substream_data structure variable consistent throughout the code, changed the name from audio_config to rtd wherever applicable. Signed-off-by: NVijendar Mukunda <Vijendar.Mukunda@amd.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 18 4月, 2018 1 次提交
-
-
由 Mukunda, Vijendar 提交于
fixed checkpatch pl warnings. Signed-off-by: NVijendar Mukunda <Vijendar.Mukunda@amd.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 09 3月, 2018 2 次提交
-
-
由 Vijendar Mukunda 提交于
As per design, non-circular dma also need to be stopped explicitly for both playback and capture scenarios. Signed-off-by: NVijendar Mukunda <Vijendar.Mukunda@amd.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Vijendar Mukunda 提交于
Moved 16bit resolution condition check for stoney platform to acp_hw_params.Depending upon substream required register value need to be programmed rather than enabling 16bit resolution support all time in acp init. Signed-off-by: NVijendar Mukunda <Vijendar.Mukunda@amd.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 19 2月, 2018 1 次提交
-
-
由 Mukunda, Vijendar 提交于
Removed hardcoding in dma descriptor programming api's. These changes are required to extend the logic to support dma descriptor programming for multiple i2s controller instances. Signed-off-by: NVijendar Mukunda <Vijendar.Mukunda@amd.com> Reviewed-by: NAlex Deucher <alexander.deucher@amd.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-