dma-ops.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. struct samsung_dma_prep_info {
  16. enum dma_transaction_type cap;
  17. enum dma_data_direction direction;
  18. dma_addr_t buf;
  19. unsigned long period;
  20. unsigned long len;
  21. void (*fp)(void *data);
  22. void *fp_param;
  23. };
  24. struct samsung_dma_info {
  25. enum dma_transaction_type cap;
  26. enum dma_data_direction direction;
  27. enum dma_slave_buswidth width;
  28. dma_addr_t fifo;
  29. struct s3c2410_dma_client *client;
  30. };
  31. struct samsung_dma_ops {
  32. unsigned (*request)(enum dma_ch ch, struct samsung_dma_info *info);
  33. int (*release)(unsigned ch, struct s3c2410_dma_client *client);
  34. int (*prepare)(unsigned ch, struct samsung_dma_prep_info *info);
  35. int (*trigger)(unsigned ch);
  36. int (*started)(unsigned ch);
  37. int (*flush)(unsigned ch);
  38. int (*stop)(unsigned ch);
  39. };
  40. extern void *samsung_dmadev_get_ops(void);
  41. extern void *s3c_dma_get_ops(void);
  42. static inline void *__samsung_dma_get_ops(void)
  43. {
  44. if (samsung_dma_is_dmadev())
  45. return samsung_dmadev_get_ops();
  46. else
  47. return s3c_dma_get_ops();
  48. }
  49. /*
  50. * samsung_dma_get_ops
  51. * get the set of samsung dma operations
  52. */
  53. #define samsung_dma_get_ops() __samsung_dma_get_ops()
  54. #endif /* __SAMSUNG_DMA_OPS_H_ */