From: Thomas Abraham <thomas.abraham@linaro.org>
To: devicetree-discuss@lists.ozlabs.org, vinod.koul@intel.com
Cc: grant.likely@secretlab.ca, linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com,
robherring2@gmail.com, patches@linaro.org,
jassisinghbrar@gmail.com, boojin.kim@samsung.com
Subject: [PATCH 5/6] ARM: SAMSUNG: Add device tree support for pl330 dma engine wrappers
Date: Mon, 19 Sep 2011 11:59:01 +0530 [thread overview]
Message-ID: <1316413742-23535-6-git-send-email-thomas.abraham@linaro.org> (raw)
In-Reply-To: <1316413742-23535-5-git-send-email-thomas.abraham@linaro.org>
A new dma request id 'DMACH_DT_PROP' is introduced for client drivers
requesting a dma channel. This request indicates that a device tree
node property represting the dma channel is available in
'struct samsung_dma_info'. The dma channel request wrapper uses the
node property value as the value for the filter parameter.
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/arm/plat-samsung/dma-ops.c | 9 ++++++++-
arch/arm/plat-samsung/include/plat/dma-ops.h | 1 +
arch/arm/plat-samsung/include/plat/dma-pl330.h | 3 ++-
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/arch/arm/plat-samsung/dma-ops.c b/arch/arm/plat-samsung/dma-ops.c
index 8d18425..b1135dd 100644
--- a/arch/arm/plat-samsung/dma-ops.c
+++ b/arch/arm/plat-samsung/dma-ops.c
@@ -23,11 +23,18 @@ static unsigned samsung_dmadev_request(enum dma_ch dma_ch,
struct dma_chan *chan;
dma_cap_mask_t mask;
struct dma_slave_config slave_config;
+ void *filter_param;
dma_cap_zero(mask);
dma_cap_set(info->cap, mask);
- chan = dma_request_channel(mask, pl330_filter, (void *)dma_ch);
+ /*
+ * If a dma channel property of a device node from device tree is
+ * specified, use that as the fliter parameter.
+ */
+ filter_param = (dma_ch == DMACH_DT_PROP) ? (void *)info->dt_dmach_prop :
+ (void *)dma_ch;
+ chan = dma_request_channel(mask, pl330_filter, filter_param);
if (info->direction == DMA_FROM_DEVICE) {
memset(&slave_config, 0, sizeof(struct dma_slave_config));
diff --git a/arch/arm/plat-samsung/include/plat/dma-ops.h b/arch/arm/plat-samsung/include/plat/dma-ops.h
index 4c1a363..22eafc3 100644
--- a/arch/arm/plat-samsung/include/plat/dma-ops.h
+++ b/arch/arm/plat-samsung/include/plat/dma-ops.h
@@ -31,6 +31,7 @@ struct samsung_dma_info {
enum dma_slave_buswidth width;
dma_addr_t fifo;
struct s3c2410_dma_client *client;
+ struct property *dt_dmach_prop;
};
struct samsung_dma_ops {
diff --git a/arch/arm/plat-samsung/include/plat/dma-pl330.h b/arch/arm/plat-samsung/include/plat/dma-pl330.h
index 2e55e59..c5eaad5 100644
--- a/arch/arm/plat-samsung/include/plat/dma-pl330.h
+++ b/arch/arm/plat-samsung/include/plat/dma-pl330.h
@@ -21,7 +21,8 @@
* use these just as IDs.
*/
enum dma_ch {
- DMACH_UART0_RX,
+ DMACH_DT_PROP = -1,
+ DMACH_UART0_RX = 0,
DMACH_UART0_TX,
DMACH_UART1_RX,
DMACH_UART1_TX,
--
1.6.6.rc2
next prev parent reply other threads:[~2011-09-19 6:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-19 6:28 [PATCH v4 0/6] Add device tree support for PL330 dma controller driver Thomas Abraham
2011-09-19 6:28 ` [PATCH 1/6] DMA: PL330: move filter function into driver Thomas Abraham
2011-09-19 6:28 ` [PATCH 2/6] DMA: PL330: Infer transfer direction from transfer request instead of platform data Thomas Abraham
2011-09-19 6:28 ` [PATCH 3/6] ARM: EXYNOS4: Modify platform data for pl330 driver Thomas Abraham
2011-09-19 6:29 ` [PATCH 4/6] DMA: PL330: Add device tree support Thomas Abraham
2011-09-19 6:29 ` Thomas Abraham [this message]
2011-09-19 6:29 ` [PATCH 6/6] ARM: EXYNOS4: Limit usage of pl330 device instance to non-dt build Thomas Abraham
-- strict thread matches above, loose matches on Subject: below --
2011-08-26 8:40 [PATCH 0/6] Add device tree support for PL330 dma controller driver Thomas Abraham
2011-08-26 8:40 ` [PATCH 1/6] DMA: PL330: move filter function into driver Thomas Abraham
2011-08-26 8:40 ` [PATCH 2/6] DMA: PL330: Infer transfer direction from transfer request instead of platform data Thomas Abraham
2011-08-26 8:40 ` [PATCH 3/6] ARM: EXYNOS4: Modify platform data for pl330 driver Thomas Abraham
2011-08-26 8:40 ` [PATCH 4/6] DMA: PL330: Add device tree support Thomas Abraham
2011-08-26 8:40 ` [PATCH 5/6] ARM: SAMSUNG: Add device tree support for pl330 dma engine wrappers Thomas Abraham
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=1316413742-23535-6-git-send-email-thomas.abraham@linaro.org \
--to=thomas.abraham@linaro.org \
--cc=boojin.kim@samsung.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=jassisinghbrar@gmail.com \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=patches@linaro.org \
--cc=robherring2@gmail.com \
--cc=vinod.koul@intel.com \
/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).