aml_pcm.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef __AML_PCM_H__
  2. #define __AML_PCM_H__
  3. //#define debug_printk
  4. #ifdef debug_printk
  5. #define dug_printk(fmt, args...) printk (fmt, ## args)
  6. #else
  7. #define dug_printk(fmt, args...)
  8. #endif
  9. typedef struct audio_stream {
  10. int stream_id;
  11. int active;
  12. unsigned int last_ptr;
  13. unsigned int size;
  14. unsigned int sample_rate;
  15. unsigned int I2S_addr;
  16. spinlock_t lock;
  17. struct snd_pcm_substream *stream;
  18. } audio_stream_t;
  19. typedef struct aml_audio {
  20. struct snd_card *card;
  21. struct snd_pcm *pcm;
  22. audio_stream_t s[2];
  23. } aml_audio_t;
  24. typedef struct audio_mixer_control {
  25. int output_devide;
  26. int input_device;
  27. int direction;
  28. int input_volume;
  29. int output_volume;
  30. } audio_mixer_control_t;
  31. typedef struct audio_tone_control {
  32. unsigned short * tone_source;
  33. unsigned short * tone_data;
  34. int tone_data_len;
  35. int tone_count;
  36. int tone_flag;
  37. }audio_tone_control_t;
  38. struct aml_pcm_dma_params{
  39. char *name; /* stream identifier */
  40. struct snd_pcm_substream *substream;
  41. void (*dma_intr_handler)(u32, struct snd_pcm_substream *);
  42. };
  43. extern struct snd_soc_platform_driver aml_soc_platform;
  44. #endif