max9860.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*
  2. * Driver for the MAX9860 Mono Audio Voice Codec
  3. *
  4. * Author: Peter Rosin <peda@axentia.s>
  5. * Copyright 2016 Axentia Technologies
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * version 2 as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. */
  16. #ifndef _SND_SOC_MAX9860
  17. #define _SND_SOC_MAX9860
  18. #define MAX9860_INTRSTATUS 0x00
  19. #define MAX9860_MICREADBACK 0x01
  20. #define MAX9860_INTEN 0x02
  21. #define MAX9860_SYSCLK 0x03
  22. #define MAX9860_AUDIOCLKHIGH 0x04
  23. #define MAX9860_AUDIOCLKLOW 0x05
  24. #define MAX9860_IFC1A 0x06
  25. #define MAX9860_IFC1B 0x07
  26. #define MAX9860_VOICEFLTR 0x08
  27. #define MAX9860_DACATTN 0x09
  28. #define MAX9860_ADCLEVEL 0x0a
  29. #define MAX9860_DACGAIN 0x0b
  30. #define MAX9860_MICGAIN 0x0c
  31. #define MAX9860_RESERVED 0x0d
  32. #define MAX9860_MICADC 0x0e
  33. #define MAX9860_NOISEGATE 0x0f
  34. #define MAX9860_PWRMAN 0x10
  35. #define MAX9860_REVISION 0xff
  36. #define MAX9860_MAX_REGISTER 0xff
  37. /* INTRSTATUS */
  38. #define MAX9860_CLD 0x80
  39. #define MAX9860_SLD 0x40
  40. #define MAX9860_ULK 0x20
  41. /* MICREADBACK */
  42. #define MAX9860_NG 0xe0
  43. #define MAX9860_AGC 0x1f
  44. /* INTEN */
  45. #define MAX9860_ICLD 0x80
  46. #define MAX9860_ISLD 0x40
  47. #define MAX9860_IULK 0x20
  48. /* SYSCLK */
  49. #define MAX9860_PSCLK 0x30
  50. #define MAX9860_PSCLK_OFF 0x00
  51. #define MAX9860_PSCLK_SHIFT 4
  52. #define MAX9860_FREQ 0x06
  53. #define MAX9860_FREQ_NORMAL 0x00
  54. #define MAX9860_FREQ_12MHZ 0x02
  55. #define MAX9860_FREQ_13MHZ 0x04
  56. #define MAX9860_FREQ_19_2MHZ 0x06
  57. #define MAX9860_16KHZ 0x01
  58. /* AUDIOCLKHIGH */
  59. #define MAX9860_PLL 0x80
  60. #define MAX9860_NHI 0x7f
  61. /* AUDIOCLKLOW */
  62. #define MAX9860_NLO 0xff
  63. /* IFC1A */
  64. #define MAX9860_MASTER 0x80
  65. #define MAX9860_WCI 0x40
  66. #define MAX9860_DBCI 0x20
  67. #define MAX9860_DDLY 0x10
  68. #define MAX9860_HIZ 0x08
  69. #define MAX9860_TDM 0x04
  70. /* IFC1B */
  71. #define MAX9860_ABCI 0x20
  72. #define MAX9860_ADLY 0x10
  73. #define MAX9860_ST 0x08
  74. #define MAX9860_BSEL 0x07
  75. #define MAX9860_BSEL_OFF 0x00
  76. #define MAX9860_BSEL_64X 0x01
  77. #define MAX9860_BSEL_48X 0x02
  78. #define MAX9860_BSEL_PCLK_2 0x04
  79. #define MAX9860_BSEL_PCLK_4 0x05
  80. #define MAX9860_BSEL_PCLK_8 0x06
  81. #define MAX9860_BSEL_PCLK_16 0x07
  82. /* VOICEFLTR */
  83. #define MAX9860_AVFLT 0xf0
  84. #define MAX9860_AVFLT_SHIFT 4
  85. #define MAX9860_AVFLT_COUNT 6
  86. #define MAX9860_DVFLT 0x0f
  87. #define MAX9860_DVFLT_SHIFT 0
  88. #define MAX9860_DVFLT_COUNT 6
  89. /* DACATTN */
  90. #define MAX9860_DVA 0xfe
  91. #define MAX9860_DVA_SHIFT 1
  92. #define MAX9860_DVA_MUTE 0x5e
  93. /* ADCLEVEL */
  94. #define MAX9860_ADCRL 0xf0
  95. #define MAX9860_ADCRL_SHIFT 4
  96. #define MAX9860_ADCLL 0x0f
  97. #define MAX9860_ADCLL_SHIFT 0
  98. #define MAX9860_ADCxL_MIN 15
  99. /* DACGAIN */
  100. #define MAX9860_DVG 0x60
  101. #define MAX9860_DVG_SHIFT 5
  102. #define MAX9860_DVG_MAX 3
  103. #define MAX9860_DVST 0x1f
  104. #define MAX9860_DVST_SHIFT 0
  105. #define MAX9860_DVST_MIN 31
  106. /* MICGAIN */
  107. #define MAX9860_PAM 0x60
  108. #define MAX9860_PAM_SHIFT 5
  109. #define MAX9860_PAM_MAX 3
  110. #define MAX9860_PGAM 0x1f
  111. #define MAX9860_PGAM_SHIFT 0
  112. #define MAX9860_PGAM_MIN 20
  113. /* MICADC */
  114. #define MAX9860_AGCSRC 0x80
  115. #define MAX9860_AGCSRC_SHIFT 7
  116. #define MAX9860_AGCSRC_COUNT 2
  117. #define MAX9860_AGCRLS 0x70
  118. #define MAX9860_AGCRLS_SHIFT 4
  119. #define MAX9860_AGCRLS_COUNT 8
  120. #define MAX9860_AGCATK 0x0c
  121. #define MAX9860_AGCATK_SHIFT 2
  122. #define MAX9860_AGCATK_COUNT 4
  123. #define MAX9860_AGCHLD 0x03
  124. #define MAX9860_AGCHLD_OFF 0x00
  125. #define MAX9860_AGCHLD_SHIFT 0
  126. #define MAX9860_AGCHLD_COUNT 4
  127. /* NOISEGATE */
  128. #define MAX9860_ANTH 0xf0
  129. #define MAX9860_ANTH_SHIFT 4
  130. #define MAX9860_ANTH_MAX 15
  131. #define MAX9860_AGCTH 0x0f
  132. #define MAX9860_AGCTH_SHIFT 0
  133. #define MAX9860_AGCTH_MIN 15
  134. /* PWRMAN */
  135. #define MAX9860_SHDN 0x80
  136. #define MAX9860_DACEN 0x08
  137. #define MAX9860_DACEN_SHIFT 3
  138. #define MAX9860_ADCLEN 0x02
  139. #define MAX9860_ADCLEN_SHIFT 1
  140. #define MAX9860_ADCREN 0x01
  141. #define MAX9860_ADCREN_SHIFT 0
  142. #endif /* _SND_SOC_MAX9860 */