ml26124.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. /*
  2. * Copyright (C) 2011 LAPIS Semiconductor Co., Ltd.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; version 2 of the License.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  16. */
  17. #ifndef ML26124_H
  18. #define ML26124_H
  19. /* Clock Control Register */
  20. #define ML26124_SMPLING_RATE 0x00
  21. #define ML26124_PLLNL 0x02
  22. #define ML26124_PLLNH 0x04
  23. #define ML26124_PLLML 0x06
  24. #define ML26124_PLLMH 0x08
  25. #define ML26124_PLLDIV 0x0a
  26. #define ML26124_CLK_EN 0x0c
  27. #define ML26124_CLK_CTL 0x0e
  28. /* System Control Register */
  29. #define ML26124_SW_RST 0x10
  30. #define ML26124_REC_PLYBAK_RUN 0x12
  31. #define ML26124_MIC_TIM 0x14
  32. /* Power Mnagement Register */
  33. #define ML26124_PW_REF_PW_MNG 0x20
  34. #define ML26124_PW_IN_PW_MNG 0x22
  35. #define ML26124_PW_DAC_PW_MNG 0x24
  36. #define ML26124_PW_SPAMP_PW_MNG 0x26
  37. #define ML26124_PW_LOUT_PW_MNG 0x28
  38. #define ML26124_PW_VOUT_PW_MNG 0x2a
  39. #define ML26124_PW_ZCCMP_PW_MNG 0x2e
  40. /* Analog Reference Control Register */
  41. #define ML26124_PW_MICBIAS_VOL 0x30
  42. /* Input/Output Amplifier Control Register */
  43. #define ML26124_PW_MIC_IN_VOL 0x32
  44. #define ML26124_PW_MIC_BOST_VOL 0x38
  45. #define ML26124_PW_SPK_AMP_VOL 0x3a
  46. #define ML26124_PW_AMP_VOL_FUNC 0x48
  47. #define ML26124_PW_AMP_VOL_FADE 0x4a
  48. /* Analog Path Control Register */
  49. #define ML26124_SPK_AMP_OUT 0x54
  50. #define ML26124_MIC_IF_CTL 0x5a
  51. #define ML26124_MIC_SELECT 0xe8
  52. /* Audio Interface Control Register */
  53. #define ML26124_SAI_TRANS_CTL 0x60
  54. #define ML26124_SAI_RCV_CTL 0x62
  55. #define ML26124_SAI_MODE_SEL 0x64
  56. /* DSP Control Register */
  57. #define ML26124_FILTER_EN 0x66
  58. #define ML26124_DVOL_CTL 0x68
  59. #define ML26124_MIXER_VOL_CTL 0x6a
  60. #define ML26124_RECORD_DIG_VOL 0x6c
  61. #define ML26124_PLBAK_DIG_VOL 0x70
  62. #define ML26124_DIGI_BOOST_VOL 0x72
  63. #define ML26124_EQ_GAIN_BRAND0 0x74
  64. #define ML26124_EQ_GAIN_BRAND1 0x76
  65. #define ML26124_EQ_GAIN_BRAND2 0x78
  66. #define ML26124_EQ_GAIN_BRAND3 0x7a
  67. #define ML26124_EQ_GAIN_BRAND4 0x7c
  68. #define ML26124_HPF2_CUTOFF 0x7e
  69. #define ML26124_EQBRAND0_F0L 0x80
  70. #define ML26124_EQBRAND0_F0H 0x82
  71. #define ML26124_EQBRAND0_F1L 0x84
  72. #define ML26124_EQBRAND0_F1H 0x86
  73. #define ML26124_EQBRAND1_F0L 0x88
  74. #define ML26124_EQBRAND1_F0H 0x8a
  75. #define ML26124_EQBRAND1_F1L 0x8c
  76. #define ML26124_EQBRAND1_F1H 0x8e
  77. #define ML26124_EQBRAND2_F0L 0x90
  78. #define ML26124_EQBRAND2_F0H 0x92
  79. #define ML26124_EQBRAND2_F1L 0x94
  80. #define ML26124_EQBRAND2_F1H 0x96
  81. #define ML26124_EQBRAND3_F0L 0x98
  82. #define ML26124_EQBRAND3_F0H 0x9a
  83. #define ML26124_EQBRAND3_F1L 0x9c
  84. #define ML26124_EQBRAND3_F1H 0x9e
  85. #define ML26124_EQBRAND4_F0L 0xa0
  86. #define ML26124_EQBRAND4_F0H 0xa2
  87. #define ML26124_EQBRAND4_F1L 0xa4
  88. #define ML26124_EQBRAND4_F1H 0xa6
  89. /* ALC Control Register */
  90. #define ML26124_ALC_MODE 0xb0
  91. #define ML26124_ALC_ATTACK_TIM 0xb2
  92. #define ML26124_ALC_DECAY_TIM 0xb4
  93. #define ML26124_ALC_HOLD_TIM 0xb6
  94. #define ML26124_ALC_TARGET_LEV 0xb8
  95. #define ML26124_ALC_MAXMIN_GAIN 0xba
  96. #define ML26124_NOIS_GATE_THRSH 0xbc
  97. #define ML26124_ALC_ZERO_TIMOUT 0xbe
  98. /* Playback Limiter Control Register */
  99. #define ML26124_PL_ATTACKTIME 0xc0
  100. #define ML26124_PL_DECAYTIME 0xc2
  101. #define ML26124_PL_TARGETTIME 0xc4
  102. #define ML26124_PL_MAXMIN_GAIN 0xc6
  103. #define ML26124_PLYBAK_BOST_VOL 0xc8
  104. #define ML26124_PL_0CROSS_TIMOUT 0xca
  105. /* Video Amplifer Control Register */
  106. #define ML26124_VIDEO_AMP_GAIN_CTL 0xd0
  107. #define ML26124_VIDEO_AMP_SETUP1 0xd2
  108. #define ML26124_VIDEO_AMP_CTL2 0xd4
  109. /* Clock select for machine driver */
  110. #define ML26124_USE_PLL 0
  111. #define ML26124_USE_MCLKI_256FS 1
  112. #define ML26124_USE_MCLKI_512FS 2
  113. #define ML26124_USE_MCLKI_1024FS 3
  114. /* Register Mask */
  115. #define ML26124_R0_MASK 0xf
  116. #define ML26124_R2_MASK 0xff
  117. #define ML26124_R4_MASK 0x1
  118. #define ML26124_R6_MASK 0xf
  119. #define ML26124_R8_MASK 0x3f
  120. #define ML26124_Ra_MASK 0x1f
  121. #define ML26124_Rc_MASK 0x1f
  122. #define ML26124_Re_MASK 0x7
  123. #define ML26124_R10_MASK 0x1
  124. #define ML26124_R12_MASK 0x17
  125. #define ML26124_R14_MASK 0x3f
  126. #define ML26124_R20_MASK 0x47
  127. #define ML26124_R22_MASK 0xa
  128. #define ML26124_R24_MASK 0x2
  129. #define ML26124_R26_MASK 0x1f
  130. #define ML26124_R28_MASK 0x2
  131. #define ML26124_R2a_MASK 0x2
  132. #define ML26124_R2e_MASK 0x2
  133. #define ML26124_R30_MASK 0x7
  134. #define ML26124_R32_MASK 0x3f
  135. #define ML26124_R38_MASK 0x38
  136. #define ML26124_R3a_MASK 0x3f
  137. #define ML26124_R48_MASK 0x3
  138. #define ML26124_R4a_MASK 0x7
  139. #define ML26124_R54_MASK 0x2a
  140. #define ML26124_R5a_MASK 0x3
  141. #define ML26124_Re8_MASK 0x3
  142. #define ML26124_R60_MASK 0xff
  143. #define ML26124_R62_MASK 0xff
  144. #define ML26124_R64_MASK 0x1
  145. #define ML26124_R66_MASK 0xff
  146. #define ML26124_R68_MASK 0x3b
  147. #define ML26124_R6a_MASK 0xf3
  148. #define ML26124_R6c_MASK 0xff
  149. #define ML26124_R70_MASK 0xff
  150. #define ML26124_MCLKEN BIT(0)
  151. #define ML26124_PLLEN BIT(1)
  152. #define ML26124_PLLOE BIT(2)
  153. #define ML26124_MCLKOE BIT(3)
  154. #define ML26124_BLT_ALL_ON 0x1f
  155. #define ML26124_BLT_PREAMP_ON 0x13
  156. #define ML26124_MICBEN_ON BIT(2)
  157. enum ml26124_regs {
  158. ML26124_MCLK = 0,
  159. };
  160. enum ml26124_clk_in {
  161. ML26124_USE_PLLOUT = 0,
  162. ML26124_USE_MCLKI,
  163. };
  164. #endif