diff options
author | Vinod Koul <vinod.koul@intel.com> | 2015-06-24 23:51:43 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-06-24 23:51:43 -0400 |
commit | 0e0fa66e39db6b2c72dbc0d8975fc2a45533a8eb (patch) | |
tree | 1b538ba40d301ba70a645d405e37e74bb5d70119 /include | |
parent | 9324fdf5267b12f6db660fe52e882bbfffcc109a (diff) | |
parent | a074ae38f859b90bd259f5df43784834b44412d1 (diff) |
Merge branch 'topic/omap' into for-linus
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/dmaengine.h | 17 | ||||
-rw-r--r-- | include/linux/of_dma.h | 21 |
2 files changed, 38 insertions, 0 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 5d99229c2f95..2882a201c1cb 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -231,6 +231,16 @@ struct dma_chan_percpu { | |||
231 | }; | 231 | }; |
232 | 232 | ||
233 | /** | 233 | /** |
234 | * struct dma_router - DMA router structure | ||
235 | * @dev: pointer to the DMA router device | ||
236 | * @route_free: function to be called when the route can be disconnected | ||
237 | */ | ||
238 | struct dma_router { | ||
239 | struct device *dev; | ||
240 | void (*route_free)(struct device *dev, void *route_data); | ||
241 | }; | ||
242 | |||
243 | /** | ||
234 | * struct dma_chan - devices supply DMA channels, clients use them | 244 | * struct dma_chan - devices supply DMA channels, clients use them |
235 | * @device: ptr to the dma device who supplies this channel, always !%NULL | 245 | * @device: ptr to the dma device who supplies this channel, always !%NULL |
236 | * @cookie: last cookie value returned to client | 246 | * @cookie: last cookie value returned to client |
@@ -241,6 +251,8 @@ struct dma_chan_percpu { | |||
241 | * @local: per-cpu pointer to a struct dma_chan_percpu | 251 | * @local: per-cpu pointer to a struct dma_chan_percpu |
242 | * @client_count: how many clients are using this channel | 252 | * @client_count: how many clients are using this channel |
243 | * @table_count: number of appearances in the mem-to-mem allocation table | 253 | * @table_count: number of appearances in the mem-to-mem allocation table |
254 | * @router: pointer to the DMA router structure | ||
255 | * @route_data: channel specific data for the router | ||
244 | * @private: private data for certain client-channel associations | 256 | * @private: private data for certain client-channel associations |
245 | */ | 257 | */ |
246 | struct dma_chan { | 258 | struct dma_chan { |
@@ -256,6 +268,11 @@ struct dma_chan { | |||
256 | struct dma_chan_percpu __percpu *local; | 268 | struct dma_chan_percpu __percpu *local; |
257 | int client_count; | 269 | int client_count; |
258 | int table_count; | 270 | int table_count; |
271 | |||
272 | /* DMA router */ | ||
273 | struct dma_router *router; | ||
274 | void *route_data; | ||
275 | |||
259 | void *private; | 276 | void *private; |
260 | }; | 277 | }; |
261 | 278 | ||
diff --git a/include/linux/of_dma.h b/include/linux/of_dma.h index 56bc026c143f..98ba7525929e 100644 --- a/include/linux/of_dma.h +++ b/include/linux/of_dma.h | |||
@@ -23,6 +23,9 @@ struct of_dma { | |||
23 | struct device_node *of_node; | 23 | struct device_node *of_node; |
24 | struct dma_chan *(*of_dma_xlate) | 24 | struct dma_chan *(*of_dma_xlate) |
25 | (struct of_phandle_args *, struct of_dma *); | 25 | (struct of_phandle_args *, struct of_dma *); |
26 | void *(*of_dma_route_allocate) | ||
27 | (struct of_phandle_args *, struct of_dma *); | ||
28 | struct dma_router *dma_router; | ||
26 | void *of_dma_data; | 29 | void *of_dma_data; |
27 | }; | 30 | }; |
28 | 31 | ||
@@ -37,12 +40,20 @@ extern int of_dma_controller_register(struct device_node *np, | |||
37 | (struct of_phandle_args *, struct of_dma *), | 40 | (struct of_phandle_args *, struct of_dma *), |
38 | void *data); | 41 | void *data); |
39 | extern void of_dma_controller_free(struct device_node *np); | 42 | extern void of_dma_controller_free(struct device_node *np); |
43 | |||
44 | extern int of_dma_router_register(struct device_node *np, | ||
45 | void *(*of_dma_route_allocate) | ||
46 | (struct of_phandle_args *, struct of_dma *), | ||
47 | struct dma_router *dma_router); | ||
48 | #define of_dma_router_free of_dma_controller_free | ||
49 | |||
40 | extern struct dma_chan *of_dma_request_slave_channel(struct device_node *np, | 50 | extern struct dma_chan *of_dma_request_slave_channel(struct device_node *np, |
41 | const char *name); | 51 | const char *name); |
42 | extern struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec, | 52 | extern struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec, |
43 | struct of_dma *ofdma); | 53 | struct of_dma *ofdma); |
44 | extern struct dma_chan *of_dma_xlate_by_chan_id(struct of_phandle_args *dma_spec, | 54 | extern struct dma_chan *of_dma_xlate_by_chan_id(struct of_phandle_args *dma_spec, |
45 | struct of_dma *ofdma); | 55 | struct of_dma *ofdma); |
56 | |||
46 | #else | 57 | #else |
47 | static inline int of_dma_controller_register(struct device_node *np, | 58 | static inline int of_dma_controller_register(struct device_node *np, |
48 | struct dma_chan *(*of_dma_xlate) | 59 | struct dma_chan *(*of_dma_xlate) |
@@ -56,6 +67,16 @@ static inline void of_dma_controller_free(struct device_node *np) | |||
56 | { | 67 | { |
57 | } | 68 | } |
58 | 69 | ||
70 | static inline int of_dma_router_register(struct device_node *np, | ||
71 | void *(*of_dma_route_allocate) | ||
72 | (struct of_phandle_args *, struct of_dma *), | ||
73 | struct dma_router *dma_router) | ||
74 | { | ||
75 | return -ENODEV; | ||
76 | } | ||
77 | |||
78 | #define of_dma_router_free of_dma_controller_free | ||
79 | |||
59 | static inline struct dma_chan *of_dma_request_slave_channel(struct device_node *np, | 80 | static inline struct dma_chan *of_dma_request_slave_channel(struct device_node *np, |
60 | const char *name) | 81 | const char *name) |
61 | { | 82 | { |