From patchwork Tue Apr 30 15:41:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16538 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C325F20065 for ; Tue, 30 Apr 2013 15:42:01 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id hz10sf1035961vcb.8 for ; Tue, 30 Apr 2013 08:41:58 -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=M78OccmhpZhNjqucL79tUW57weMCjwLS2IV1sXozd+o=; b=gggHGY5aeVCJw3QyGro7kHPmhKykHBcDOPmPn/S/0mHSl/DgKn4/vJXwnYFsIUsSoB UGYT5HTr6yJc1PVLMmZFc3dAoL0y+qWn1jRDxQDUYiMKhEW/vymIIOhp8xQ9xV0kTZHc 6J3nDeFE3dkXR7xCks04stwWcVQFGi52F9RhhLRqbWB8D5XRuvj5iXU2l61+X0NAfp/C lbyXW+yCZohdMGrNpadoJNxLNhrPUxfUy9q0ZWFAA2UAjTaaegJC/HEIy554tnFXFGQk zvWOKgdt+vKYFzYdFYIpE02JA6TFRih2uPZIaDQn4IKmYlt/VvyaYoJ31OrO3G4k/fsK kaIQ== X-Received: by 10.236.61.42 with SMTP id v30mr11969729yhc.15.1367336518679; Tue, 30 Apr 2013 08:41:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.133.162 with SMTP id pd2ls287395qeb.91.gmail; Tue, 30 Apr 2013 08:41:58 -0700 (PDT) X-Received: by 10.220.154.14 with SMTP id m14mr6934047vcw.21.1367336518304; Tue, 30 Apr 2013 08:41:58 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id n6si12295787vcw.35.2013.04.30.08.41.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Apr 2013 08:41:58 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id gf12so539937vcb.8 for ; Tue, 30 Apr 2013 08:41:58 -0700 (PDT) X-Received: by 10.52.228.71 with SMTP id sg7mr28940540vdc.51.1367336518201; Tue, 30 Apr 2013 08:41:58 -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 nf2csp112983veb; Tue, 30 Apr 2013 08:41:57 -0700 (PDT) X-Received: by 10.180.182.110 with SMTP id ed14mr25407458wic.6.1367336517214; Tue, 30 Apr 2013 08:41:57 -0700 (PDT) Received: from mail-wg0-x229.google.com (mail-wg0-x229.google.com [2a00:1450:400c:c00::229]) by mx.google.com with ESMTPS id fa8si8971825wjd.46.2013.04.30.08.41.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Apr 2013 08:41:57 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::229 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c00::229; Received: by mail-wg0-f41.google.com with SMTP id e11so3133673wgh.4 for ; Tue, 30 Apr 2013 08:41:56 -0700 (PDT) X-Received: by 10.180.183.139 with SMTP id em11mr4057703wic.16.1367336516579; Tue, 30 Apr 2013 08:41:56 -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.54 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Apr 2013 08:41:55 -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 5/5] dmaengine: ste_dma40: Fetch disabled channels from DT Date: Tue, 30 Apr 2013 16:41:37 +0100 Message-Id: <1367336497-10650-5-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: ALoCoQnwjvksp/0qwFAxOsFpUWiKR3ILVRthA8AzMGpDUyveTVpFCosI94TWv9l4QmMCN4ekpmIh X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.177 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 have channels which are not available for normal use. 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 --- Documentation/devicetree/bindings/dma/ste-dma40.txt | 4 ++++ drivers/dma/ste_dma40.c | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/dma/ste-dma40.txt b/Documentation/devicetree/bindings/dma/ste-dma40.txt index 02e87e7..f234c75 100644 --- a/Documentation/devicetree/bindings/dma/ste-dma40.txt +++ b/Documentation/devicetree/bindings/dma/ste-dma40.txt @@ -12,6 +12,8 @@ Required properties: Optional properties: - dma-channels: Number of channels supported by hardware - if not present the driver will attempt to obtain the information from H/W +- disabled-channels: Channels which can not be used +- disabled-num-chans: Number of channels which can not be used Example: @@ -25,6 +27,8 @@ Example: #dma-cells = <2>; memcpy-channels = <56, 57, 58, 59, 60>; memcpy-num-chans = <5>; + disabled-channels = <12>; + disabled-num-chans = <1>; dma-channels = <8>; }; diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index dbdd67b..b045eb2 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_phy = 0, num_memcpy = 0; + int num_phy = 0, num_memcpy = 0, num_disabled = 0; pdata = devm_kzalloc(&pdev->dev, sizeof(struct stedma40_platform_data), @@ -3493,6 +3493,20 @@ static int __init d40_of_probe(struct platform_device *pdev, pdev->dev.platform_data = pdata; + of_property_read_u32(np, "disabled-num-chans", &num_disabled); + + if (num_disabled > STEDMA40_MAX_PHYS || num_disabled < 0) { + d40_err(&pdev->dev, + "Invalid number of disabled channels specified (%d)\n", + num_disabled); + return -EINVAL; + } + + of_property_read_u32_array(np, "disabled-channels", + pdata->disabled_channels, + num_disabled); + pdata->disabled_channels[num_disabled] = -1; + return 0; }