From patchwork Wed May 15 09:52:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16956 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 35B072396C for ; Wed, 15 May 2013 09:54:00 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id d1sf723493qcz.8 for ; Wed, 15 May 2013 02:53:23 -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=5C6edABo7EC7y8Pos6I8T8MeMcZPMohdScFEDbtp/Mk=; b=iensdd76O9woxySctN7YHvQ6k27Ll33WsdxbX4zdwSgK7XLeRpu6eDhAiWRiaICICI sZhnL8v+ppbj5ABxYFV03svf9rpKBNmToJdJ4yr4On8qMFD5OeuZx8/+0vOpG3G1pr/X 37MLOsQ7fCy6s+fyeQQTiquXPgHB17xMTePPJs2LkDTAS1tc33LkIwwd055feqb9pnae Th0Q7pIYDw67ScMy/yLemKkqBQeMGnpx3tMvPJ0pCdIByRnxRK81Cilnfh49WFIaWPxp uR+qae9HlQ1lu/28pNJDyNV50VfgozmxiCXfJdRnRlSK+iiza01wEhFbFVfkIPeAD50k tyiQ== X-Received: by 10.224.165.130 with SMTP id i2mr23042458qay.2.1368611603615; Wed, 15 May 2013 02:53:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.41.7 with SMTP id b7ls609224qel.12.gmail; Wed, 15 May 2013 02:53:23 -0700 (PDT) X-Received: by 10.58.243.102 with SMTP id wx6mr14593570vec.26.1368611603448; Wed, 15 May 2013 02:53:23 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id sc6si1015062vdc.125.2013.05.15.02.53.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 02:53:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 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.176; Received: by mail-vc0-f176.google.com with SMTP id ib11so1598936vcb.7 for ; Wed, 15 May 2013 02:53:23 -0700 (PDT) X-Received: by 10.58.144.170 with SMTP id sn10mr23901996veb.7.1368611603267; Wed, 15 May 2013 02:53:23 -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.220.217.15 with SMTP id hk15csp11396vcb; Wed, 15 May 2013 02:53:22 -0700 (PDT) X-Received: by 10.180.109.84 with SMTP id hq20mr13278774wib.11.1368611602280; Wed, 15 May 2013 02:53:22 -0700 (PDT) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [2a00:1450:400c:c05::236]) by mx.google.com with ESMTPS id q9si518367wje.107.2013.05.15.02.53.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 02:53:22 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::236 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::236; Received: by mail-wi0-f182.google.com with SMTP id c10so1415809wiw.15 for ; Wed, 15 May 2013 02:53:21 -0700 (PDT) X-Received: by 10.180.90.43 with SMTP id bt11mr12751779wib.30.1368611601737; Wed, 15 May 2013 02:53:21 -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 q13sm2898210wie.8.2013.05.15.02.53.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 02:53:21 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, balbi@ti.com, linux-usb@vger.kernel.org, linux-crypto@vger.kernel.org, davem@davemloft.net, herbert@gondor.apana.org.au, vinod.koul@intel.com Cc: arnd@arndb.de, linus.walleij@stericsson.com, srinidhi.kasagar@stericsson.com, Lee Jones , Dan Williams , Per Forlin , Rabin Vincent Subject: [PATCH 39/39] dmaengine: ste_dma40: Fetch disabled channels from DT Date: Wed, 15 May 2013 10:52:02 +0100 Message-Id: <1368611522-9984-40-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1368611522-9984-1-git-send-email-lee.jones@linaro.org> References: <1368611522-9984-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQlBdLCboiJ2GvhBf9gLB6nbTYsW9UavsS6HSWOD0ohFtPb6bKygu+g5b8Ks9oEe/umniaRY X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 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 Acked-by: Arnd Bergmann Signed-off-by: Lee Jones --- Documentation/devicetree/bindings/dma/ste-dma40.txt | 2 ++ drivers/dma/ste_dma40.c | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/dma/ste-dma40.txt b/Documentation/devicetree/bindings/dma/ste-dma40.txt index aa272d8..bea5b73 100644 --- a/Documentation/devicetree/bindings/dma/ste-dma40.txt +++ b/Documentation/devicetree/bindings/dma/ste-dma40.txt @@ -11,6 +11,7 @@ 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 Example: @@ -23,6 +24,7 @@ Example: #dma-cells = <2>; memcpy-channels = <56 57 58 59 60>; + disabled-channels = <12>; dma-channels = <8>; }; diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 4e528dd..ffac822 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -3482,7 +3482,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; const const __be32 *list; pdata = devm_kzalloc(&pdev->dev, @@ -3511,6 +3511,21 @@ static int __init d40_of_probe(struct platform_device *pdev, dma40_memcpy_channels, num_memcpy); + list = of_get_property(np, "disabled-channels", &num_disabled); + num_disabled /= sizeof(*list); + + 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; + pdev->dev.platform_data = pdata; return 0;