diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2013-01-04 08:12:13 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-01-07 11:36:37 -0500 |
commit | d70a8ed3121e67da8e8bb713d592d9498916c58e (patch) | |
tree | 4527da2094e41f2d3cfb5a7a948f4669b0301fca | |
parent | 03b5357c3005e097f314136bade3683a0525b68f (diff) |
dma: coh901318: merge header files
We do not need two header files for the two parts of the driver
to talk to each other so merge them into one.
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/dma/coh901318.c | 1 | ||||
-rw-r--r-- | drivers/dma/coh901318.h | 108 | ||||
-rw-r--r-- | drivers/dma/coh901318_lli.c | 1 | ||||
-rw-r--r-- | drivers/dma/coh901318_lli.h | 122 |
4 files changed, 108 insertions, 124 deletions
diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c index f7100dc6b8e2..0604273deafb 100644 --- a/drivers/dma/coh901318.c +++ b/drivers/dma/coh901318.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/platform_data/dma-coh901318.h> | 24 | #include <linux/platform_data/dma-coh901318.h> |
25 | 25 | ||
26 | #include "coh901318.h" | 26 | #include "coh901318.h" |
27 | #include "coh901318_lli.h" | ||
28 | #include "dmaengine.h" | 27 | #include "dmaengine.h" |
29 | 28 | ||
30 | #define COH901318_MOD32_MASK (0x1F) | 29 | #define COH901318_MOD32_MASK (0x1F) |
diff --git a/drivers/dma/coh901318.h b/drivers/dma/coh901318.h index 275a36e1afc3..95ce1e2123ec 100644 --- a/drivers/dma/coh901318.h +++ b/drivers/dma/coh901318.h | |||
@@ -11,6 +11,18 @@ | |||
11 | #define MAX_DMA_PACKET_SIZE_SHIFT 11 | 11 | #define MAX_DMA_PACKET_SIZE_SHIFT 11 |
12 | #define MAX_DMA_PACKET_SIZE (1 << MAX_DMA_PACKET_SIZE_SHIFT) | 12 | #define MAX_DMA_PACKET_SIZE (1 << MAX_DMA_PACKET_SIZE_SHIFT) |
13 | 13 | ||
14 | struct device; | ||
15 | |||
16 | struct coh901318_pool { | ||
17 | spinlock_t lock; | ||
18 | struct dma_pool *dmapool; | ||
19 | struct device *dev; | ||
20 | |||
21 | #ifdef CONFIG_DEBUG_FS | ||
22 | int debugfs_pool_counter; | ||
23 | #endif | ||
24 | }; | ||
25 | |||
14 | /** | 26 | /** |
15 | * struct coh901318_lli - linked list item for DMAC | 27 | * struct coh901318_lli - linked list item for DMAC |
16 | * @control: control settings for DMAC | 28 | * @control: control settings for DMAC |
@@ -30,4 +42,100 @@ struct coh901318_lli { | |||
30 | dma_addr_t phy_this; | 42 | dma_addr_t phy_this; |
31 | }; | 43 | }; |
32 | 44 | ||
45 | /** | ||
46 | * coh901318_pool_create() - Creates an dma pool for lli:s | ||
47 | * @pool: pool handle | ||
48 | * @dev: dma device | ||
49 | * @lli_nbr: number of lli:s in the pool | ||
50 | * @algin: address alignemtn of lli:s | ||
51 | * returns 0 on success otherwise none zero | ||
52 | */ | ||
53 | int coh901318_pool_create(struct coh901318_pool *pool, | ||
54 | struct device *dev, | ||
55 | size_t lli_nbr, size_t align); | ||
56 | |||
57 | /** | ||
58 | * coh901318_pool_destroy() - Destroys the dma pool | ||
59 | * @pool: pool handle | ||
60 | * returns 0 on success otherwise none zero | ||
61 | */ | ||
62 | int coh901318_pool_destroy(struct coh901318_pool *pool); | ||
63 | |||
64 | /** | ||
65 | * coh901318_lli_alloc() - Allocates a linked list | ||
66 | * | ||
67 | * @pool: pool handle | ||
68 | * @len: length to list | ||
69 | * return: none NULL if success otherwise NULL | ||
70 | */ | ||
71 | struct coh901318_lli * | ||
72 | coh901318_lli_alloc(struct coh901318_pool *pool, | ||
73 | unsigned int len); | ||
74 | |||
75 | /** | ||
76 | * coh901318_lli_free() - Returns the linked list items to the pool | ||
77 | * @pool: pool handle | ||
78 | * @lli: reference to lli pointer to be freed | ||
79 | */ | ||
80 | void coh901318_lli_free(struct coh901318_pool *pool, | ||
81 | struct coh901318_lli **lli); | ||
82 | |||
83 | /** | ||
84 | * coh901318_lli_fill_memcpy() - Prepares the lli:s for dma memcpy | ||
85 | * @pool: pool handle | ||
86 | * @lli: allocated lli | ||
87 | * @src: src address | ||
88 | * @size: transfer size | ||
89 | * @dst: destination address | ||
90 | * @ctrl_chained: ctrl for chained lli | ||
91 | * @ctrl_last: ctrl for the last lli | ||
92 | * returns number of CPU interrupts for the lli, negative on error. | ||
93 | */ | ||
94 | int | ||
95 | coh901318_lli_fill_memcpy(struct coh901318_pool *pool, | ||
96 | struct coh901318_lli *lli, | ||
97 | dma_addr_t src, unsigned int size, | ||
98 | dma_addr_t dst, u32 ctrl_chained, u32 ctrl_last); | ||
99 | |||
100 | /** | ||
101 | * coh901318_lli_fill_single() - Prepares the lli:s for dma single transfer | ||
102 | * @pool: pool handle | ||
103 | * @lli: allocated lli | ||
104 | * @buf: transfer buffer | ||
105 | * @size: transfer size | ||
106 | * @dev_addr: address of periphal | ||
107 | * @ctrl_chained: ctrl for chained lli | ||
108 | * @ctrl_last: ctrl for the last lli | ||
109 | * @dir: direction of transfer (to or from device) | ||
110 | * returns number of CPU interrupts for the lli, negative on error. | ||
111 | */ | ||
112 | int | ||
113 | coh901318_lli_fill_single(struct coh901318_pool *pool, | ||
114 | struct coh901318_lli *lli, | ||
115 | dma_addr_t buf, unsigned int size, | ||
116 | dma_addr_t dev_addr, u32 ctrl_chained, u32 ctrl_last, | ||
117 | enum dma_transfer_direction dir); | ||
118 | |||
119 | /** | ||
120 | * coh901318_lli_fill_single() - Prepares the lli:s for dma scatter list transfer | ||
121 | * @pool: pool handle | ||
122 | * @lli: allocated lli | ||
123 | * @sg: scatter gather list | ||
124 | * @nents: number of entries in sg | ||
125 | * @dev_addr: address of periphal | ||
126 | * @ctrl_chained: ctrl for chained lli | ||
127 | * @ctrl: ctrl of middle lli | ||
128 | * @ctrl_last: ctrl for the last lli | ||
129 | * @dir: direction of transfer (to or from device) | ||
130 | * @ctrl_irq_mask: ctrl mask for CPU interrupt | ||
131 | * returns number of CPU interrupts for the lli, negative on error. | ||
132 | */ | ||
133 | int | ||
134 | coh901318_lli_fill_sg(struct coh901318_pool *pool, | ||
135 | struct coh901318_lli *lli, | ||
136 | struct scatterlist *sg, unsigned int nents, | ||
137 | dma_addr_t dev_addr, u32 ctrl_chained, | ||
138 | u32 ctrl, u32 ctrl_last, | ||
139 | enum dma_transfer_direction dir, u32 ctrl_irq_mask); | ||
140 | |||
33 | #endif /* COH901318_H */ | 141 | #endif /* COH901318_H */ |
diff --git a/drivers/dma/coh901318_lli.c b/drivers/dma/coh901318_lli.c index b2e284f78c73..3e96610e18e2 100644 --- a/drivers/dma/coh901318_lli.c +++ b/drivers/dma/coh901318_lli.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <linux/dmaengine.h> | 14 | #include <linux/dmaengine.h> |
15 | 15 | ||
16 | #include "coh901318.h" | 16 | #include "coh901318.h" |
17 | #include "coh901318_lli.h" | ||
18 | 17 | ||
19 | #if (defined(CONFIG_DEBUG_FS) && defined(CONFIG_U300_DEBUG)) | 18 | #if (defined(CONFIG_DEBUG_FS) && defined(CONFIG_U300_DEBUG)) |
20 | #define DEBUGFS_POOL_COUNTER_RESET(pool) (pool->debugfs_pool_counter = 0) | 19 | #define DEBUGFS_POOL_COUNTER_RESET(pool) (pool->debugfs_pool_counter = 0) |
diff --git a/drivers/dma/coh901318_lli.h b/drivers/dma/coh901318_lli.h deleted file mode 100644 index 0c7caceef63b..000000000000 --- a/drivers/dma/coh901318_lli.h +++ /dev/null | |||
@@ -1,122 +0,0 @@ | |||
1 | /* | ||
2 | * driver/dma/coh901318_lli.h | ||
3 | * | ||
4 | * Copyright (C) 2007-2009 ST-Ericsson | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | * Support functions for handling lli for coh901318 | ||
7 | * Author: Per Friden <per.friden@stericsson.com> | ||
8 | */ | ||
9 | |||
10 | #ifndef COH901318_LLI_H | ||
11 | #define COH901318_LLI_H | ||
12 | |||
13 | struct device; | ||
14 | |||
15 | struct coh901318_pool { | ||
16 | spinlock_t lock; | ||
17 | struct dma_pool *dmapool; | ||
18 | struct device *dev; | ||
19 | |||
20 | #ifdef CONFIG_DEBUG_FS | ||
21 | int debugfs_pool_counter; | ||
22 | #endif | ||
23 | }; | ||
24 | |||
25 | struct device; | ||
26 | /** | ||
27 | * coh901318_pool_create() - Creates an dma pool for lli:s | ||
28 | * @pool: pool handle | ||
29 | * @dev: dma device | ||
30 | * @lli_nbr: number of lli:s in the pool | ||
31 | * @algin: address alignemtn of lli:s | ||
32 | * returns 0 on success otherwise none zero | ||
33 | */ | ||
34 | int coh901318_pool_create(struct coh901318_pool *pool, | ||
35 | struct device *dev, | ||
36 | size_t lli_nbr, size_t align); | ||
37 | |||
38 | /** | ||
39 | * coh901318_pool_destroy() - Destroys the dma pool | ||
40 | * @pool: pool handle | ||
41 | * returns 0 on success otherwise none zero | ||
42 | */ | ||
43 | int coh901318_pool_destroy(struct coh901318_pool *pool); | ||
44 | |||
45 | /** | ||
46 | * coh901318_lli_alloc() - Allocates a linked list | ||
47 | * | ||
48 | * @pool: pool handle | ||
49 | * @len: length to list | ||
50 | * return: none NULL if success otherwise NULL | ||
51 | */ | ||
52 | struct coh901318_lli * | ||
53 | coh901318_lli_alloc(struct coh901318_pool *pool, | ||
54 | unsigned int len); | ||
55 | |||
56 | /** | ||
57 | * coh901318_lli_free() - Returns the linked list items to the pool | ||
58 | * @pool: pool handle | ||
59 | * @lli: reference to lli pointer to be freed | ||
60 | */ | ||
61 | void coh901318_lli_free(struct coh901318_pool *pool, | ||
62 | struct coh901318_lli **lli); | ||
63 | |||
64 | /** | ||
65 | * coh901318_lli_fill_memcpy() - Prepares the lli:s for dma memcpy | ||
66 | * @pool: pool handle | ||
67 | * @lli: allocated lli | ||
68 | * @src: src address | ||
69 | * @size: transfer size | ||
70 | * @dst: destination address | ||
71 | * @ctrl_chained: ctrl for chained lli | ||
72 | * @ctrl_last: ctrl for the last lli | ||
73 | * returns number of CPU interrupts for the lli, negative on error. | ||
74 | */ | ||
75 | int | ||
76 | coh901318_lli_fill_memcpy(struct coh901318_pool *pool, | ||
77 | struct coh901318_lli *lli, | ||
78 | dma_addr_t src, unsigned int size, | ||
79 | dma_addr_t dst, u32 ctrl_chained, u32 ctrl_last); | ||
80 | |||
81 | /** | ||
82 | * coh901318_lli_fill_single() - Prepares the lli:s for dma single transfer | ||
83 | * @pool: pool handle | ||
84 | * @lli: allocated lli | ||
85 | * @buf: transfer buffer | ||
86 | * @size: transfer size | ||
87 | * @dev_addr: address of periphal | ||
88 | * @ctrl_chained: ctrl for chained lli | ||
89 | * @ctrl_last: ctrl for the last lli | ||
90 | * @dir: direction of transfer (to or from device) | ||
91 | * returns number of CPU interrupts for the lli, negative on error. | ||
92 | */ | ||
93 | int | ||
94 | coh901318_lli_fill_single(struct coh901318_pool *pool, | ||
95 | struct coh901318_lli *lli, | ||
96 | dma_addr_t buf, unsigned int size, | ||
97 | dma_addr_t dev_addr, u32 ctrl_chained, u32 ctrl_last, | ||
98 | enum dma_transfer_direction dir); | ||
99 | |||
100 | /** | ||
101 | * coh901318_lli_fill_single() - Prepares the lli:s for dma scatter list transfer | ||
102 | * @pool: pool handle | ||
103 | * @lli: allocated lli | ||
104 | * @sg: scatter gather list | ||
105 | * @nents: number of entries in sg | ||
106 | * @dev_addr: address of periphal | ||
107 | * @ctrl_chained: ctrl for chained lli | ||
108 | * @ctrl: ctrl of middle lli | ||
109 | * @ctrl_last: ctrl for the last lli | ||
110 | * @dir: direction of transfer (to or from device) | ||
111 | * @ctrl_irq_mask: ctrl mask for CPU interrupt | ||
112 | * returns number of CPU interrupts for the lli, negative on error. | ||
113 | */ | ||
114 | int | ||
115 | coh901318_lli_fill_sg(struct coh901318_pool *pool, | ||
116 | struct coh901318_lli *lli, | ||
117 | struct scatterlist *sg, unsigned int nents, | ||
118 | dma_addr_t dev_addr, u32 ctrl_chained, | ||
119 | u32 ctrl, u32 ctrl_last, | ||
120 | enum dma_transfer_direction dir, u32 ctrl_irq_mask); | ||
121 | |||
122 | #endif /* COH901318_LLI_H */ | ||