From patchwork Fri Mar 27 12:26:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 6106611 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 854019F2A9 for ; Fri, 27 Mar 2015 12:28:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A98232041B for ; Fri, 27 Mar 2015 12:28:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD32E2042B for ; Fri, 27 Mar 2015 12:28:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752809AbbC0M1v (ORCPT ); Fri, 27 Mar 2015 08:27:51 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:56922 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752391AbbC0M1r (ORCPT ); Fri, 27 Mar 2015 08:27:47 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t2RCRG0Q029477; Fri, 27 Mar 2015 07:27:16 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t2RCRF7E017427; Fri, 27 Mar 2015 07:27:15 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Fri, 27 Mar 2015 07:27:15 -0500 Received: from dlep32.itg.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t2RCQsHo017958; Fri, 27 Mar 2015 07:27:12 -0500 From: Peter Ujfalusi To: , , CC: , , , , , , , Subject: [PATCH v3 5/7] dmaengine: omap-dma: Take DMA request number from DT if it is available Date: Fri, 27 Mar 2015 14:26:51 +0200 Message-ID: <1427459213-14611-6-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.3.3 In-Reply-To: <1427459213-14611-1-git-send-email-peter.ujfalusi@ti.com> References: <1427459213-14611-1-git-send-email-peter.ujfalusi@ti.com> MIME-Version: 1.0 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 56c33e93dd24..2b30acaa721f 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]; @@ -1118,7 +1119,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++) { + 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); + od->dma_requests = OMAP_SDMA_REQUESTS; + } + + for (i = 0; i < od->dma_requests; i++) { rc = omap_dma_chan_init(od, i); if (rc) { omap_dma_free(od);