dai.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #ifndef __DAI_H__
  14. #define __DAI_H__
  15. struct dai_dma_params {
  16. u8 *buffer;
  17. uint32_t src_start;
  18. uint32_t bus_id;
  19. int buffer_size;
  20. int period_size;
  21. int channels;
  22. };
  23. enum {
  24. DAI_SPKR = 0,
  25. DAI_MIC,
  26. DAI_MI2S,
  27. DAI_SEC_SPKR,
  28. DAI_SEC_MIC,
  29. };
  30. /* Function Prototypes */
  31. int dai_open(uint32_t dma_ch);
  32. void dai_close(uint32_t dma_ch);
  33. int dai_start(uint32_t dma_ch);
  34. int dai_stop(uint32_t dma_ch);
  35. int dai_set_params(uint32_t dma_ch, struct dai_dma_params *params);
  36. uint32_t dai_get_dma_pos(uint32_t dma_ch);
  37. void register_dma_irq_handler(int dma_ch,
  38. irqreturn_t (*callback) (int intrSrc, void *private_data),
  39. void *private_data);
  40. void unregister_dma_irq_handler(int dma_ch);
  41. void dai_set_master_mode(uint32_t dma_ch, int mode);
  42. int dai_start_hdmi(uint32_t dma_ch);
  43. int wait_for_dma_cnt_stop(uint32_t dma_ch);
  44. void dai_stop_hdmi(uint32_t dma_ch);
  45. #endif