Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754228AbbDHNQH (ORCPT ); Wed, 8 Apr 2015 09:16:07 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:33162 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754092AbbDHNPs (ORCPT ); Wed, 8 Apr 2015 09:15:48 -0400 From: Peter Ujfalusi To: , , CC: , , , , , , , , Subject: [PATCH v4 5/8] dmaengine: omap-dma: Take DMA request number from DT if it is available Date: Wed, 8 Apr 2015 16:14:49 +0300 Message-ID: <1428498892-28471-6-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1428498892-28471-1-git-send-email-peter.ujfalusi@ti.com> References: <1428498892-28471-1-git-send-email-peter.ujfalusi@ti.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1582 Lines: 47 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 --- drivers/dma/omap-dma.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index 4065963fbffb..8c41cdb55a4b 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c @@ -34,6 +34,7 @@ struct omap_dmadev { const struct omap_dma_reg *reg_map; struct omap_system_dma_plat_info *plat; bool legacy; + unsigned dma_requests; spinlock_t irq_lock; uint32_t irq_enable_mask; struct omap_chan *lch_map[OMAP_SDMA_CHANNELS]; @@ -1119,7 +1120,16 @@ static int omap_dma_probe(struct platform_device *pdev) tasklet_init(&od->task, omap_dma_sched, (unsigned long)od); - for (i = 0; i < OMAP_SDMA_REQUESTS; i++) { + od->dma_requests = OMAP_SDMA_REQUESTS; + if (pdev->dev.of_node && of_property_read_u32(pdev->dev.of_node, + "dma-requests", + &od->dma_requests)) { + dev_info(&pdev->dev, + "Missing dma-requests property, using %u.\n", + OMAP_SDMA_REQUESTS); + } + + for (i = 0; i < od->dma_requests; i++) { rc = omap_dma_chan_init(od, i); if (rc) { omap_dma_free(od); -- 2.3.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/