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: 2571681 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 80DB93FC5A for ; Wed, 15 May 2013 10:54:18 +0000 (UTC) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UcYa4-00023t-6W; Wed, 15 May 2013 10:05:14 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UcYT9-0004fe-7H; Wed, 15 May 2013 09:57:59 +0000 Received: from mail-wg0-x22a.google.com ([2a00:1450:400c:c00::22a]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UcYP2-0004Em-Ou for linux-arm-kernel@lists.infradead.org; Wed, 15 May 2013 09:53:46 +0000 Received: by mail-wg0-f42.google.com with SMTP id j13so4920886wgh.3 for ; Wed, 15 May 2013 02:53:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=5C6edABo7EC7y8Pos6I8T8MeMcZPMohdScFEDbtp/Mk=; b=b9Jx4HzKTUrtb2HMOAfSDJFkVQyZ6hDxa1QH3aISYv4xC0sYbUthkEXDMdBV1HZAmu qfcI9/FcWnxZ5O11uafswCyY1dVslV+q5+l7CsnADyM2DKlpAimZfREs5W/BXdnF+uLz HIspTRSJAbfExnQ7tdTAU8L799yJury8abLgR8fBLfFg+S1QmfLMn7QkKtgRNKMicrhA ie5cNsG77VQHAekOAbPrykPe+UnOGD7JwZkok8rHLu5KoaUfS3Uuud7zOjm6Cwc+ZqrP KPsUbpfnBu7RxGcZGKWolOWyecLjFdlkSUcsawCzkQG65Nnj0m9NPF+fvJEnd7hBpF2Y k9Vg== 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 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: ALoCoQkAHvEENdCWvk73HQMWaDZQB1H0H+HRyoEZc92dhdcVmlHMHeaUetd9JRGLkn84kTnQcYjq X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130515_055344_966978_891E9152 X-CRM114-Status: GOOD ( 14.46 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Rabin Vincent , linus.walleij@stericsson.com, arnd@arndb.de, srinidhi.kasagar@stericsson.com, Per Forlin , Dan Williams , Lee Jones X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 Acked-by: Vinod Koul --- 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;