From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5 v2] dmaengine: ste_dma40: Fetch disabled channels from DT
Date: Wed, 1 May 2013 10:54:06 +0100 [thread overview]
Message-ID: <20130501095406.GE25256@gmail.com> (raw)
In-Reply-To: <1367336497-10650-5-git-send-email-lee.jones@linaro.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 <vinod.koul@intel.com>
Cc: Dan Williams <djbw@fb.com>
Cc: Per Forlin <per.forlin@stericsson.com>
Cc: Rabin Vincent <rabin@rab.in>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
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 b14de16..658b53b 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;
const const __be32 *list;
pdata = devm_kzalloc(&pdev->dev,
@@ -3493,6 +3493,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;
next prev parent reply other threads:[~2013-05-01 9:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-30 15:41 [PATCH 1/5] dmaengine: ste_dma40: Allow memcpy channels to be configured from DT Lee Jones
2013-04-30 15:41 ` [PATCH 2/5] ARM: ux500: Pass DMA memcpy channels though Device Tree Lee Jones
2013-04-30 15:41 ` [PATCH 3/5] ARM: ux500: Stop passing DMA platform data though AUXDATA Lee Jones
2013-04-30 20:43 ` Arnd Bergmann
2013-05-02 11:29 ` Srinidhi Kasagar
2013-04-30 15:41 ` [PATCH 4/5] dmaengine: ste_dma40: Fetch the number of physical channels from DT Lee Jones
2013-04-30 15:41 ` [PATCH 5/5] dmaengine: ste_dma40: Fetch disabled " Lee Jones
2013-05-01 9:54 ` Lee Jones [this message]
2013-05-01 10:27 ` [PATCH 5/5 v2] " Arnd Bergmann
2013-04-30 20:42 ` [PATCH 1/5] dmaengine: ste_dma40: Allow memcpy channels to be configured " Arnd Bergmann
2013-05-01 9:51 ` Lee Jones
2013-05-01 9:52 ` [PATCH 1/5 v2] " Lee Jones
2013-05-01 10:27 ` Arnd Bergmann
2013-05-03 11:16 ` Linus Walleij
2013-05-03 11:57 ` Lee Jones
2013-05-03 12:02 ` Linus Walleij
2013-05-03 12:11 ` Lee Jones
2013-05-03 13:42 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130501095406.GE25256@gmail.com \
--to=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).