From patchwork Tue Apr 30 15:41:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16537 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 314FB20065 for ; Tue, 30 Apr 2013 15:41:59 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id w15sf1008032vbb.10 for ; Tue, 30 Apr 2013 08:41:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=+UyTnhRK7cQce4EyDtY1bwpfumASAmGu1bz2AvR1Ggk=; b=EomshWqLm/zfNTtdXmMuWAClbdellTUEpW4a5ImuFBQMf1IFTP5t0A1yJw/YqT7FeW pGurTBW/ZmJI9UGFswpcEh8C6RBHAH6lRe8qalnI0EnulRKBKY2k9Zix9CQLWRDrcW8y C3E/WhWf8ZnHArKAvKBk0/3EiUakwdlsGJUHryqJVcTCp7c/pTp7N/eQZ119tTwcDZLE KU1UbFSf8YyfTIERpqD2naUraUmq6vkKg9eGalWgbrzp9J6SRnbwUP5aqCH8JLBNVAdx 0xegHRxthMN02UPRCBvabCXsXIXqnxMik1y5unfwAMac8u/Q3qIoqdA102aU9q0hAFgH +MGw== X-Received: by 10.236.117.178 with SMTP id j38mr10181088yhh.45.1367336516101; Tue, 30 Apr 2013 08:41:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.13.40 with SMTP id e8ls299215qec.77.gmail; Tue, 30 Apr 2013 08:41:55 -0700 (PDT) X-Received: by 10.52.98.105 with SMTP id eh9mr3771458vdb.125.1367336515723; Tue, 30 Apr 2013 08:41:55 -0700 (PDT) Received: from mail-ve0-x22a.google.com (mail-ve0-x22a.google.com [2607:f8b0:400c:c01::22a]) by mx.google.com with ESMTPS id d4si12280786vcl.66.2013.04.30.08.41.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Apr 2013 08:41:55 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22a is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22a; Received: by mail-ve0-f170.google.com with SMTP id 15so513151vea.15 for ; Tue, 30 Apr 2013 08:41:55 -0700 (PDT) X-Received: by 10.52.66.101 with SMTP id e5mr2820402vdt.57.1367336515574; Tue, 30 Apr 2013 08:41:55 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp112978veb; Tue, 30 Apr 2013 08:41:55 -0700 (PDT) X-Received: by 10.194.78.204 with SMTP id d12mr13296967wjx.42.1367336514664; Tue, 30 Apr 2013 08:41:54 -0700 (PDT) Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [2a00:1450:400c:c00::22a]) by mx.google.com with ESMTPS id nh15si5831631wic.76.2013.04.30.08.41.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Apr 2013 08:41:54 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::22a is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c00::22a; Received: by mail-wg0-f42.google.com with SMTP id m15so3134595wgh.3 for ; Tue, 30 Apr 2013 08:41:54 -0700 (PDT) X-Received: by 10.180.73.173 with SMTP id m13mr25296558wiv.27.1367336514220; Tue, 30 Apr 2013 08:41:54 -0700 (PDT) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPSA id g4sm29734819wib.11.2013.04.30.08.41.52 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Apr 2013 08:41:53 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, srinidhi.kasagar@stericsson.com, Lee Jones , Vinod Koul , Dan Williams , Per Forlin , Rabin Vincent Subject: [PATCH 4/5] dmaengine: ste_dma40: Fetch the number of physical channels from DT Date: Tue, 30 Apr 2013 16:41:36 +0100 Message-Id: <1367336497-10650-4-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1367336497-10650-1-git-send-email-lee.jones@linaro.org> References: <1367336497-10650-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQlY5g3aAtSCrLP68uZ0t5/S5lqTSSzpeKdRuzMPHM/kNj8UQgGKXlGbYRO60C0qNRiLRfMS X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22a is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Some platforms insist on obscure physical channel availability. This information is currently passed though platform data in internal BSP kernels. Once those platforms land, they'll need to configure them appropriately, so we may as well add the infrastructure. Cc: Vinod Koul Cc: Dan Williams Cc: Per Forlin Cc: Rabin Vincent Signed-off-by: Lee Jones --- drivers/dma/ste_dma40.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 4769141..dbdd67b 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -3464,7 +3464,7 @@ static int __init d40_of_probe(struct platform_device *pdev, struct device_node *np) { struct stedma40_platform_data *pdata; - int num_memcpy = 0; + int num_phy = 0, num_memcpy = 0; pdata = devm_kzalloc(&pdev->dev, sizeof(struct stedma40_platform_data), @@ -3472,6 +3472,11 @@ static int __init d40_of_probe(struct platform_device *pdev, if (!pdata) return -ENOMEM; + /* If absent this value will be obtained from h/w. */ + of_property_read_u32(np, "dma-channels", &num_phy); + if (num_phy > 0) + pdata->num_of_phy_chans = num_phy; + of_property_read_u32(np, "memcpy-num-chans", &num_memcpy); if (num_memcpy > D40_MEMCPY_MAX_CHANS || num_memcpy <= 0) {