ASoC: tegra-alt: add dma buffer size parse

Add dma-buffer-size parsing in device tree for pcm
driver to allocate required size for each pcm node

Bug 200299289

Change-Id: Ia579c66413912dd0ef7fda34cd47887eec3599f7
Signed-off-by: Ahung Cheng <ahcheng@nvidia.com>
Reviewed-on: http://git-master/r/1464607
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
This commit is contained in:
Ahung Cheng
2017-04-18 17:01:51 +08:00
committed by Sameer Pujar
parent bff751a2eb
commit 946277f5b6

View File

@@ -1023,6 +1023,7 @@ static int tegra_admaif_probe(struct platform_device *pdev)
void __iomem *regs; void __iomem *regs;
struct resource *res; struct resource *res;
const struct of_device_id *match; const struct of_device_id *match;
unsigned int buffer_size;
match = of_match_device(tegra_admaif_of_match, &pdev->dev); match = of_match_device(tegra_admaif_of_match, &pdev->dev);
if (!match) { if (!match) {
@@ -1142,6 +1143,15 @@ static int tegra_admaif_probe(struct platform_device *pdev)
ret = -ENODEV; ret = -ENODEV;
goto err_suspend; goto err_suspend;
} }
buffer_size = 0;
if (of_property_read_u32_index(pdev->dev.of_node,
"dma-buffer-size",
(i * 2) + 1,
&buffer_size) < 0) {
dev_dbg(&pdev->dev,
"Missing property nvidia,dma-buffer-size\n");
}
admaif->playback_dma_data[i].buffer_size = buffer_size;
admaif->capture_dma_data[i].wrap = 4; admaif->capture_dma_data[i].wrap = 4;
admaif->capture_dma_data[i].width = 32; admaif->capture_dma_data[i].width = 32;
@@ -1155,6 +1165,15 @@ static int tegra_admaif_probe(struct platform_device *pdev)
ret = -ENODEV; ret = -ENODEV;
goto err_suspend; goto err_suspend;
} }
buffer_size = 0;
if (of_property_read_u32_index(pdev->dev.of_node,
"dma-buffer-size",
(i * 2),
&buffer_size) < 0) {
dev_dbg(&pdev->dev,
"Missing property nvidia,dma-buffer-size\n");
}
admaif->capture_dma_data[i].buffer_size = buffer_size;
} }
ret = snd_soc_register_component(&pdev->dev, ret = snd_soc_register_component(&pdev->dev,