dma-ops.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. struct property *dt_dmach_prop;
  31. };
  32. struct samsung_dma_ops {
  33. unsigned (*request)(enum dma_ch ch, struct samsung_dma_info *info);
  34. int (*release)(unsigned ch, struct s3c2410_dma_client *client);
  35. int (*prepare)(unsigned ch, struct samsung_dma_prep_info *info);
  36. int (*trigger)(unsigned ch);
  37. int (*started)(unsigned ch);
  38. int (*flush)(unsigned ch);
  39. int (*stop)(unsigned ch);
  40. };
  41. extern void *samsung_dmadev_get_ops(void);
  42. extern void *s3c_dma_get_ops(void);
  43. static inline void *__samsung_dma_get_ops(void)
  44. {
  45. if (samsung_dma_is_dmadev())
  46. return samsung_dmadev_get_ops();
  47. else
  48. return s3c_dma_get_ops();
  49. }
  50. /*
  51. * samsung_dma_get_ops
  52. * get the set of samsung dma operations
  53. */
  54. #define samsung_dma_get_ops() __samsung_dma_get_ops()
  55. #endif /* __SAMSUNG_DMA_OPS_H_ */