dma-ops.h 1.6 KB

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