]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: SAMSUNG: Add device tree support for pl330 dma engine wrappers
authorThomas Abraham <thomas.abraham@linaro.org>
Mon, 24 Oct 2011 09:43:38 +0000 (11:43 +0200)
committerKukjin Kim <kgene.kim@samsung.com>
Fri, 23 Dec 2011 01:07:05 +0000 (10:07 +0900)
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: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/plat-samsung/dma-ops.c
arch/arm/plat-samsung/include/plat/dma-ops.h
arch/arm/plat-samsung/include/plat/dma-pl330.h

index 889c2c22325ec43475784773f9d1f200e9da4b6c..2cded872f22b3debd634282a408d67169ceff981 100644 (file)
@@ -24,11 +24,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));
index 4c1a363526cf368cb995a0ee159db96c875d6da9..22eafc310bd7858a8fb10b39087fc6064e78e04c 100644 (file)
@@ -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 {
index 2e55e595867425ad0a6801bfa99ab220686c56c3..c5eaad529de57d4dbdf94a2fdb96bef820ae70fd 100644 (file)
@@ -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,