2 * OF helpers for DMA request / controller
6 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
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.
13 #ifndef __LINUX_OF_DMA_H
14 #define __LINUX_OF_DMA_H
17 #include <linux/dmaengine.h>
22 struct list_head of_dma_controllers;
23 struct device_node *of_node;
25 struct dma_chan *(*of_dma_xlate)
26 (struct of_phandle_args *, struct of_dma *);
31 struct of_dma_filter_info {
32 dma_cap_mask_t dma_cap;
33 dma_filter_fn filter_fn;
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 *),
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,
44 extern struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec,
45 struct of_dma *ofdma);
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 *),
55 static inline int of_dma_controller_free(struct device_node *np)
60 static inline struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
66 static inline struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec,
74 #endif /* __LINUX_OF_DMA_H */