of_dma.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #ifndef __LINUX_OF_DMA_H
  13. #define __LINUX_OF_DMA_H
  14. #include <linux/of.h>
  15. #include <linux/dmaengine.h>
  16. struct device_node;
  17. struct of_dma {
  18. struct list_head of_dma_controllers;
  19. struct device_node *of_node;
  20. int of_dma_nbcells;
  21. struct dma_chan *(*of_dma_xlate)
  22. (struct of_phandle_args *, struct of_dma *);
  23. void *of_dma_data;
  24. };
  25. struct of_dma_filter_info {
  26. dma_cap_mask_t dma_cap;
  27. dma_filter_fn filter_fn;
  28. };
  29. extern int of_dma_controller_register(struct device_node *np,
  30. struct dma_chan *(*of_dma_xlate)
  31. (struct of_phandle_args *, struct of_dma *),
  32. void *data);
  33. extern void of_dma_controller_free(struct device_node *np);
  34. extern struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
  35. char *name);
  36. extern struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec,
  37. struct of_dma *ofdma);
  38. #endif /* __LINUX_OF_DMA_H */