1 /* SPDX-License-Identifier: GPL-2.0 */ 1 2 /* 3 * OF helpers for DMA request / controller 4 * 5 * Based on of_gpio.h 6 * 7 * Copyright (C) 2012 Texas Instruments Incorp 8 */ 9 10 #ifndef __LINUX_OF_DMA_H 11 #define __LINUX_OF_DMA_H 12 13 #include <linux/of.h> 14 #include <linux/dmaengine.h> 15 16 struct device_node; 17 18 struct of_dma { 19 struct list_head of_dma_control 20 struct device_node *of_node; 21 struct dma_chan *(*of_dma_xlat 22 (struct of_pha 23 void *(*of_dma_rout 24 (struct of_pha 25 struct dma_router *dma_router; 26 void *of_dma_data; 27 }; 28 29 struct of_dma_filter_info { 30 dma_cap_mask_t dma_cap; 31 dma_filter_fn filter_fn; 32 }; 33 34 #ifdef CONFIG_DMA_OF 35 extern int of_dma_controller_register(struct d 36 struct dma_chan *(*of_dma_xlat 37 (struct of_phandle_args *, str 38 void *data); 39 extern void of_dma_controller_free(struct devi 40 41 extern int of_dma_router_register(struct devic 42 void *(*of_dma_route_allocate) 43 (struct of_phandle_args *, str 44 struct dma_router *dma_router) 45 #define of_dma_router_free of_dma_controller_f 46 47 extern struct dma_chan *of_dma_request_slave_c 48 49 extern struct dma_chan *of_dma_simple_xlate(st 50 struct of_dma *ofdma); 51 extern struct dma_chan *of_dma_xlate_by_chan_i 52 struct of_dma *ofdma); 53 54 #else 55 static inline int of_dma_controller_register(s 56 struct dma_chan *(*of_dma_xlat 57 (struct of_phandle_args *, str 58 void *data) 59 { 60 return -ENODEV; 61 } 62 63 static inline void of_dma_controller_free(stru 64 { 65 } 66 67 static inline int of_dma_router_register(struc 68 void *(*of_dma_route_allocate) 69 (struct of_phandle_args *, str 70 struct dma_router *dma_router) 71 { 72 return -ENODEV; 73 } 74 75 #define of_dma_router_free of_dma_controller_f 76 77 static inline struct dma_chan *of_dma_request_ 78 79 { 80 return ERR_PTR(-ENODEV); 81 } 82 83 static inline struct dma_chan *of_dma_simple_x 84 struct of_dma *ofdma) 85 { 86 return NULL; 87 } 88 89 #define of_dma_xlate_by_chan_id NULL 90 91 #endif 92 93 #endif /* __LINUX_OF_DMA_H */ 94
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.