aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi2015-04-09 04:35:51 -0500
committerMisael Lopez Cruz2015-06-04 15:59:46 -0500
commit826d3e36319eebfb0e97ec89d90ad9e4d3769630 (patch)
tree625f01a61b1ba5cd0071d1e4f288ffea9e6634fb
parent16f4d1f9dfff0789756d0ce8ac9b7e034a720f42 (diff)
downloadkernel-audio-826d3e36319eebfb0e97ec89d90ad9e4d3769630.tar.gz
kernel-audio-826d3e36319eebfb0e97ec89d90ad9e4d3769630.tar.xz
kernel-audio-826d3e36319eebfb0e97ec89d90ad9e4d3769630.zip
dmaengine: omap-dma: Take DMA request number from DT if it is available
[ Upstream commit de506089e78bc7cea77c64a836f6cfc7fa592219 ] Use the dma-requests property from DT to get the number of DMA requests. In case of legacy boot or failure to find the property, use the default 127 as number of requests. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/omap-dma.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index e54e54790fc4..4ff9f5864808 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -34,6 +34,7 @@ struct omap_dmadev {
34 const struct omap_dma_reg *reg_map; 34 const struct omap_dma_reg *reg_map;
35 struct omap_system_dma_plat_info *plat; 35 struct omap_system_dma_plat_info *plat;
36 bool legacy; 36 bool legacy;
37 unsigned dma_requests;
37 spinlock_t irq_lock; 38 spinlock_t irq_lock;
38 uint32_t irq_enable_mask; 39 uint32_t irq_enable_mask;
39 struct omap_chan *lch_map[OMAP_SDMA_CHANNELS]; 40 struct omap_chan *lch_map[OMAP_SDMA_CHANNELS];
@@ -1160,7 +1161,16 @@ static int omap_dma_probe(struct platform_device *pdev)
1160 1161
1161 tasklet_init(&od->task, omap_dma_sched, (unsigned long)od); 1162 tasklet_init(&od->task, omap_dma_sched, (unsigned long)od);
1162 1163
1163 for (i = 0; i < OMAP_SDMA_REQUESTS; i++) { 1164 od->dma_requests = OMAP_SDMA_REQUESTS;
1165 if (pdev->dev.of_node && of_property_read_u32(pdev->dev.of_node,
1166 "dma-requests",
1167 &od->dma_requests)) {
1168 dev_info(&pdev->dev,
1169 "Missing dma-requests property, using %u.\n",
1170 OMAP_SDMA_REQUESTS);
1171 }
1172
1173 for (i = 0; i < od->dma_requests; i++) {
1164 rc = omap_dma_chan_init(od, i); 1174 rc = omap_dma_chan_init(od, i);
1165 if (rc) { 1175 if (rc) {
1166 omap_dma_free(od); 1176 omap_dma_free(od);