dma-ops.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* arch/arm/plat-samsung/include/plat/dma-ops.h
  2. *
  3. * Copyright (c) 2011 Samsung Electronics Co., Ltd.
  4. * http://www.samsung.com
  5. *
  6. * Samsung DMA support
  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 __SAMSUNG_DMA_OPS_H_
  13. #define __SAMSUNG_DMA_OPS_H_ __FILE__
  14. #include <linux/dmaengine.h>
  15. #include <mach/dma.h>
  16. struct samsung_dma_req {
  17. enum dma_transaction_type cap;
  18. struct property *dt_dmach_prop;
  19. struct s3c2410_dma_client *client;
  20. };
  21. struct samsung_dma_prep {
  22. enum dma_transaction_type cap;
  23. enum dma_transfer_direction direction;
  24. dma_addr_t buf;
  25. unsigned long period;
  26. unsigned long len;
  27. void (*fp)(void *data);
  28. void *fp_param;
  29. };
  30. struct samsung_dma_config {
  31. enum dma_transfer_direction direction;
  32. enum dma_slave_buswidth width;
  33. dma_addr_t fifo;
  34. };
  35. struct samsung_dma_ops {
  36. unsigned (*request)(enum dma_ch ch, struct samsung_dma_req *param,
  37. struct device *dev, char *ch_name);
  38. int (*release)(unsigned ch, void *param);
  39. int (*config)(unsigned ch, struct samsung_dma_config *param);
  40. int (*prepare)(unsigned ch, struct samsung_dma_prep *param);
  41. int (*trigger)(unsigned ch);
  42. int (*started)(unsigned ch);
  43. int (*flush)(unsigned ch);
  44. int (*stop)(unsigned ch);
  45. };
  46. extern void *samsung_dmadev_get_ops(void);
  47. extern void *s3c_dma_get_ops(void);
  48. static inline void *__samsung_dma_get_ops(void)
  49. {
  50. if (samsung_dma_is_dmadev())
  51. return samsung_dmadev_get_ops();
  52. else
  53. return s3c_dma_get_ops();
  54. }
  55. /*
  56. * samsung_dma_get_ops
  57. * get the set of samsung dma operations
  58. */
  59. #define samsung_dma_get_ops() __samsung_dma_get_ops()
  60. #endif /* __SAMSUNG_DMA_OPS_H_ */