sst_dsp.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. #ifndef __SST_DSP_H__
  2. #define __SST_DSP_H__
  3. /*
  4. * sst_dsp.h - Intel SST Driver for audio engine
  5. *
  6. * Copyright (C) 2008-12 Intel Corporation
  7. * Authors: Vinod Koul <vinod.koul@linux.intel.com>
  8. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; version 2 of the License.
  13. *
  14. * This program is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License along
  20. * with this program; if not, write to the Free Software Foundation, Inc.,
  21. * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  22. *
  23. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  24. */
  25. enum sst_codec_types {
  26. /* AUDIO/MUSIC CODEC Type Definitions */
  27. SST_CODEC_TYPE_UNKNOWN = 0,
  28. SST_CODEC_TYPE_PCM, /* Pass through Audio codec */
  29. SST_CODEC_TYPE_MP3,
  30. SST_CODEC_TYPE_MP24,
  31. SST_CODEC_TYPE_AAC,
  32. SST_CODEC_TYPE_AACP,
  33. SST_CODEC_TYPE_eAACP,
  34. };
  35. enum stream_type {
  36. SST_STREAM_TYPE_NONE = 0,
  37. SST_STREAM_TYPE_MUSIC = 1,
  38. };
  39. struct snd_pcm_params {
  40. u16 codec; /* codec type */
  41. u8 num_chan; /* 1=Mono, 2=Stereo */
  42. u8 pcm_wd_sz; /* 16/24 - bit*/
  43. u32 reserved; /* Bitrate in bits per second */
  44. u32 sfreq; /* Sampling rate in Hz */
  45. u8 use_offload_path;
  46. u8 reserved2;
  47. u16 reserved3;
  48. u8 channel_map[8];
  49. } __packed;
  50. /* MP3 Music Parameters Message */
  51. struct snd_mp3_params {
  52. u16 codec;
  53. u8 num_chan; /* 1=Mono, 2=Stereo */
  54. u8 pcm_wd_sz; /* 16/24 - bit*/
  55. u8 crc_check; /* crc_check - disable (0) or enable (1) */
  56. u8 reserved1; /* unused*/
  57. u16 reserved2; /* Unused */
  58. } __packed;
  59. #define AAC_BIT_STREAM_ADTS 0
  60. #define AAC_BIT_STREAM_ADIF 1
  61. #define AAC_BIT_STREAM_RAW 2
  62. /* AAC Music Parameters Message */
  63. struct snd_aac_params {
  64. u16 codec;
  65. u8 num_chan; /* 1=Mono, 2=Stereo*/
  66. u8 pcm_wd_sz; /* 16/24 - bit*/
  67. u8 bdownsample; /*SBR downsampling 0 - disable 1 -enabled AAC+ only */
  68. u8 bs_format; /* input bit stream format adts=0, adif=1, raw=2 */
  69. u16 reser2;
  70. u32 externalsr; /*sampling rate of basic AAC raw bit stream*/
  71. u8 sbr_signalling;/*disable/enable/set automode the SBR tool.AAC+*/
  72. u8 reser1;
  73. u16 reser3;
  74. } __packed;
  75. /* WMA Music Parameters Message */
  76. struct snd_wma_params {
  77. u16 codec;
  78. u8 num_chan; /* 1=Mono, 2=Stereo */
  79. u8 pcm_wd_sz; /* 16/24 - bit*/
  80. u32 brate; /* Use the hard coded value. */
  81. u32 sfreq; /* Sampling freq eg. 8000, 441000, 48000 */
  82. u32 channel_mask; /* Channel Mask */
  83. u16 format_tag; /* Format Tag */
  84. u16 block_align; /* packet size */
  85. u16 wma_encode_opt;/* Encoder option */
  86. u8 op_align; /* op align 0- 16 bit, 1- MSB, 2 LSB */
  87. u8 reserved; /* reserved */
  88. } __packed;
  89. /* Codec params struture */
  90. union snd_sst_codec_params {
  91. struct snd_pcm_params pcm_params;
  92. struct snd_mp3_params mp3_params;
  93. struct snd_aac_params aac_params;
  94. struct snd_wma_params wma_params;
  95. } __packed;
  96. /* Address and size info of a frame buffer */
  97. struct sst_address_info {
  98. u32 addr; /* Address at IA */
  99. u32 size; /* Size of the buffer */
  100. };
  101. struct snd_sst_alloc_params_ext {
  102. struct sst_address_info ring_buf_info[8];
  103. u8 sg_count;
  104. u8 reserved;
  105. u16 reserved2;
  106. u32 frag_size; /*Number of samples after which period elapsed
  107. message is sent valid only if path = 0*/
  108. } __packed;
  109. struct snd_sst_stream_params {
  110. union snd_sst_codec_params uc;
  111. } __packed;
  112. struct snd_sst_params {
  113. u32 stream_id;
  114. u8 codec;
  115. u8 ops;
  116. u8 stream_type;
  117. u8 device_type;
  118. struct snd_sst_stream_params sparams;
  119. struct snd_sst_alloc_params_ext aparams;
  120. };
  121. #endif /* __SST_DSP_H__ */