AudDrv_Common.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /******************************************************************************
  2. *
  3. *
  4. * Filename:
  5. * ---------
  6. * AudDrv_Common.h
  7. *
  8. * Project:
  9. * --------
  10. * MT6583 FPGA LDVT Audio Driver
  11. *
  12. * Description:
  13. * ------------
  14. * Audio register
  15. *
  16. * Author:
  17. * -------
  18. * Chipeng Chang (MTK02308)
  19. *
  20. *---------------------------------------------------------------------------
  21. *
  22. *
  23. *******************************************************************************/
  24. #ifndef AUDIO_GLOBAL_H
  25. #define AUDIO_GLOBAL_H
  26. #include <linux/kernel.h>
  27. #include <linux/module.h>
  28. #include <linux/slab.h>
  29. #include <linux/fs.h>
  30. #include <linux/mm.h>
  31. #include <linux/delay.h>
  32. #include <linux/vmalloc.h>
  33. #include <linux/wait.h>
  34. #include <linux/spinlock.h>
  35. #include <linux/sched.h>
  36. #include <linux/jiffies.h>
  37. #include <linux/string.h>
  38. #include <linux/mutex.h>
  39. #include <linux/time.h>
  40. #include <linux/timer.h>
  41. #include <mt-plat/sync_write.h>
  42. /* #include <mt-plat/upmu_common.h> */
  43. /* #include <linux/xlog.h> */
  44. /* #include <mach/mt_typedefs.h> */
  45. #include <linux/types.h>
  46. #include "AudDrv_Def.h"
  47. #ifndef CONFIG_MTK_CLKMGR
  48. #include <linux/clk.h>
  49. #else
  50. #include <mach/mt_clkmgr.h>
  51. #endif
  52. typedef uint8_t kal_uint8;
  53. typedef int8_t kal_int8;
  54. typedef uint32_t kal_uint32;
  55. typedef int32_t kal_int32;
  56. typedef uint64_t kal_uint64;
  57. typedef int64_t kal_int64;
  58. typedef struct {
  59. kal_uint32 pucPhysBufAddr;
  60. kal_uint8 *pucVirtBufAddr;
  61. kal_int32 u4BufferSize;
  62. kal_int32 u4DataRemained;
  63. kal_uint32 u4SampleNumMask; /* sample number mask */
  64. kal_uint32 u4SamplesPerInt; /* number of samples to play before interrupting */
  65. kal_int32 u4WriteIdx; /* Previous Write Index */
  66. kal_int32 u4DMAReadIdx; /* Previous DMA Read Index */
  67. kal_uint32 u4MaxCopySize;
  68. kal_uint32 u4fsyncflag;
  69. kal_uint32 uResetFlag;
  70. } AFE_BLOCK_T;
  71. typedef struct substreamList {
  72. struct snd_pcm_substream *substream;
  73. volatile kal_uint32 u4MaxCopySize;
  74. struct substreamList *next;
  75. } substreamList;
  76. typedef struct {
  77. struct file *flip;
  78. substreamList *substreamL;
  79. AFE_BLOCK_T rBlock;
  80. kal_uint32 MemIfNum;
  81. bool interruptTrigger;
  82. spinlock_t substream_lock;
  83. void (*offloadCbk)(void *stream);
  84. void *offloadstream;
  85. } AFE_MEM_CONTROL_T;
  86. struct pcm_afe_info {
  87. struct AFE_BLOCK_T *mAfeBlock;
  88. struct snd_pcm_substream *substream;
  89. };
  90. #endif