ASoC: rockchip: pcm: Adjust min/max value for pcm config

- the original config is too strict to satisfy general usage.
- adds CONFIG_SND_SOC_ROCKCHIP_PREALLOC_BUFFER_SIZE for flexible
  buffer size.

Change-Id: I1f060269cb1887c17a2cd83701f0263993be8ec7
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
This commit is contained in:
Sugar Zhang
2019-11-15 11:50:15 +08:00
committed by Tao Huang
parent 8ce747aebf
commit 213457f1ef
2 changed files with 13 additions and 5 deletions

View File

@@ -6,6 +6,14 @@ config SND_SOC_ROCKCHIP
the Rockchip SoCs' Audio interfaces. You will also need to the Rockchip SoCs' Audio interfaces. You will also need to
select the audio interfaces to support below. select the audio interfaces to support below.
config SND_SOC_ROCKCHIP_PREALLOC_BUFFER_SIZE
int "Default prealloc buffer size (kbytes)"
depends on SND_SOC_ROCKCHIP
default "512"
help
The default value is 512 kilobytes. Only change this if you know
what you are doing.
config SND_SOC_ROCKCHIP_I2S config SND_SOC_ROCKCHIP_I2S
tristate "Rockchip I2S Device Driver" tristate "Rockchip I2S Device Driver"
depends on CLKDEV_LOOKUP && SND_SOC_ROCKCHIP depends on CLKDEV_LOOKUP && SND_SOC_ROCKCHIP

View File

@@ -24,17 +24,17 @@ static const struct snd_pcm_hardware snd_rockchip_hardware = {
SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_INTERLEAVED, SNDRV_PCM_INFO_INTERLEAVED,
.period_bytes_min = 32, .period_bytes_min = 32,
.period_bytes_max = 8192, .period_bytes_max = SIZE_MAX,
.periods_min = 1, .periods_min = 2,
.periods_max = 52, .periods_max = 4096,
.buffer_bytes_max = 64 * 1024, .buffer_bytes_max = SIZE_MAX,
.fifo_size = 32, .fifo_size = 32,
}; };
static const struct snd_dmaengine_pcm_config rk_dmaengine_pcm_config = { static const struct snd_dmaengine_pcm_config rk_dmaengine_pcm_config = {
.pcm_hardware = &snd_rockchip_hardware, .pcm_hardware = &snd_rockchip_hardware,
.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
.prealloc_buffer_size = 32 * 1024, .prealloc_buffer_size = CONFIG_SND_SOC_ROCKCHIP_PREALLOC_BUFFER_SIZE * 1024,
}; };
int rockchip_pcm_platform_register(struct device *dev) int rockchip_pcm_platform_register(struct device *dev)