Root/
1 | /* |
2 | * OF helpers for DMA request / controller |
3 | * |
4 | * Based on of_gpio.h |
5 | * |
6 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ |
7 | * |
8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 2 as |
10 | * published by the Free Software Foundation. |
11 | */ |
12 | |
13 | #ifndef __LINUX_OF_DMA_H |
14 | #define __LINUX_OF_DMA_H |
15 | |
16 | #include <linux/of.h> |
17 | #include <linux/dmaengine.h> |
18 | |
19 | struct device_node; |
20 | |
21 | struct of_dma { |
22 | struct list_head of_dma_controllers; |
23 | struct device_node *of_node; |
24 | int of_dma_nbcells; |
25 | struct dma_chan *(*of_dma_xlate) |
26 | (struct of_phandle_args *, struct of_dma *); |
27 | void *of_dma_data; |
28 | int use_count; |
29 | }; |
30 | |
31 | struct of_dma_filter_info { |
32 | dma_cap_mask_t dma_cap; |
33 | dma_filter_fn filter_fn; |
34 | }; |
35 | |
36 | #ifdef CONFIG_OF |
37 | extern int of_dma_controller_register(struct device_node *np, |
38 | struct dma_chan *(*of_dma_xlate) |
39 | (struct of_phandle_args *, struct of_dma *), |
40 | void *data); |
41 | extern int of_dma_controller_free(struct device_node *np); |
42 | extern struct dma_chan *of_dma_request_slave_channel(struct device_node *np, |
43 | const char *name); |
44 | extern struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec, |
45 | struct of_dma *ofdma); |
46 | #else |
47 | static inline int of_dma_controller_register(struct device_node *np, |
48 | struct dma_chan *(*of_dma_xlate) |
49 | (struct of_phandle_args *, struct of_dma *), |
50 | void *data) |
51 | { |
52 | return -ENODEV; |
53 | } |
54 | |
55 | static inline int of_dma_controller_free(struct device_node *np) |
56 | { |
57 | return -ENODEV; |
58 | } |
59 | |
60 | static inline struct dma_chan *of_dma_request_slave_channel(struct device_node *np, |
61 | const char *name) |
62 | { |
63 | return NULL; |
64 | } |
65 | |
66 | static inline struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec, |
67 | struct of_dma *ofdma) |
68 | { |
69 | return NULL; |
70 | } |
71 | |
72 | #endif |
73 | |
74 | #endif /* __LINUX_OF_DMA_H */ |
75 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9