mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
ASoC: rockchip: add support for sram audio buffer
This patch force the use of sram buffer for pcm buffer, default is disabled. Change-Id: I2e6936e1071347f767c67066126b22e39fb477c5 Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
This commit is contained in:
@@ -192,6 +192,9 @@ int snd_dma_alloc_pages(int type, struct device *device, size_t size,
|
||||
snd_malloc_dev_iram(dmab, size);
|
||||
if (dmab->area)
|
||||
break;
|
||||
#ifdef CONFIG_SND_SOC_ROCKCHIP_FORCE_SRAM
|
||||
break;
|
||||
#endif
|
||||
/* Internal memory might have limited size and no enough space,
|
||||
* so if we fail to malloc, try to fetch memory traditionally.
|
||||
*/
|
||||
|
||||
@@ -6,6 +6,13 @@ config SND_SOC_ROCKCHIP
|
||||
the Rockchip SoCs' Audio interfaces. You will also need to
|
||||
select the audio interfaces to support below.
|
||||
|
||||
config SND_SOC_ROCKCHIP_FORCE_SRAM
|
||||
bool "Rockchip force using sram buffer"
|
||||
def_bool n
|
||||
help
|
||||
Say Y if you want to force using sram buffer for pcm buffer,
|
||||
but the sram size is limited.
|
||||
|
||||
config SND_SOC_ROCKCHIP_I2S
|
||||
tristate "Rockchip I2S Device Driver"
|
||||
depends on CLKDEV_LOOKUP && SND_SOC_ROCKCHIP
|
||||
|
||||
@@ -267,6 +267,9 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd)
|
||||
max_buffer_size = SIZE_MAX;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SND_SOC_ROCKCHIP_FORCE_SRAM
|
||||
prealloc_buffer_size = 32 * 1024;
|
||||
#endif
|
||||
|
||||
for (i = SNDRV_PCM_STREAM_PLAYBACK; i <= SNDRV_PCM_STREAM_CAPTURE; i++) {
|
||||
substream = rtd->pcm->streams[i].substream;
|
||||
|
||||
Reference in New Issue
Block a user