tegra-alt: Increase max period bytes

Max buffer bytes is increase through DT but
this does not get reflected in max period bytes.

Change max_period_bytes if max buffer bytes are updated by DT

Bug 2448519
Bug 200463529

Change-Id: I079615df7139228731b7a29461ae03407ecd19c0
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1961715
(cherry picked from commit 21d9f725aef8d4405eaf24a7a52efa962be4e2e6)
Reviewed-on: https://git-master.nvidia.com/r/1963255
(cherry picked from commit db8f94ae8de2f6468d9066afa8d7cc5d864405d6)
Reviewed-on: https://git-master.nvidia.com/r/1996558
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Uday Gupta
2018-11-29 16:12:45 +05:30
committed by Sameer Pujar
parent ddbf36f10e
commit d9625a21e3

View File

@@ -2,7 +2,7 @@
* tegra_alt_pcm.c - Tegra PCM driver * tegra_alt_pcm.c - Tegra PCM driver
* *
* Author: Stephen Warren <swarren@nvidia.com> * Author: Stephen Warren <swarren@nvidia.com>
* Copyright (c) 2011-2017 NVIDIA CORPORATION. All rights reserved. * Copyright (c) 2011-2018 NVIDIA CORPORATION. All rights reserved.
* *
* Based on code copyright/by: * Based on code copyright/by:
* *
@@ -72,8 +72,10 @@ static int tegra_alt_pcm_open(struct snd_pcm_substream *substream)
snd_soc_set_runtime_hwparams(substream, &tegra_alt_pcm_hardware); snd_soc_set_runtime_hwparams(substream, &tegra_alt_pcm_hardware);
/* Update buffer size from device tree */ /* Update buffer size from device tree */
if (dmap->buffer_size > substream->runtime->hw.buffer_bytes_max) if (dmap->buffer_size > substream->runtime->hw.buffer_bytes_max) {
substream->runtime->hw.buffer_bytes_max = dmap->buffer_size; substream->runtime->hw.buffer_bytes_max = dmap->buffer_size;
substream->runtime->hw.period_bytes_max = dmap->buffer_size / 2;
}
/* Ensure period size is multiple of 8 */ /* Ensure period size is multiple of 8 */
ret = snd_pcm_hw_constraint_step(substream->runtime, 0, ret = snd_pcm_hw_constraint_step(substream->runtime, 0,