ak4671.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /*
  2. * ak4671.h -- audio driver for AK4671
  3. *
  4. * Copyright (C) 2009 Samsung Electronics Co.Ltd
  5. * Author: Joonyoung Shim <jy0922.shim@samsung.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2 of the License, or (at your
  10. * option) any later version.
  11. *
  12. */
  13. #ifndef _AK4671_H
  14. #define _AK4671_H
  15. #define AK4671_AD_DA_POWER_MANAGEMENT 0x00
  16. #define AK4671_PLL_MODE_SELECT0 0x01
  17. #define AK4671_PLL_MODE_SELECT1 0x02
  18. #define AK4671_FORMAT_SELECT 0x03
  19. #define AK4671_MIC_SIGNAL_SELECT 0x04
  20. #define AK4671_MIC_AMP_GAIN 0x05
  21. #define AK4671_MIXING_POWER_MANAGEMENT0 0x06
  22. #define AK4671_MIXING_POWER_MANAGEMENT1 0x07
  23. #define AK4671_OUTPUT_VOLUME_CONTROL 0x08
  24. #define AK4671_LOUT1_SIGNAL_SELECT 0x09
  25. #define AK4671_ROUT1_SIGNAL_SELECT 0x0a
  26. #define AK4671_LOUT2_SIGNAL_SELECT 0x0b
  27. #define AK4671_ROUT2_SIGNAL_SELECT 0x0c
  28. #define AK4671_LOUT3_SIGNAL_SELECT 0x0d
  29. #define AK4671_ROUT3_SIGNAL_SELECT 0x0e
  30. #define AK4671_LOUT1_POWER_MANAGERMENT 0x0f
  31. #define AK4671_LOUT2_POWER_MANAGERMENT 0x10
  32. #define AK4671_LOUT3_POWER_MANAGERMENT 0x11
  33. #define AK4671_LCH_INPUT_VOLUME_CONTROL 0x12
  34. #define AK4671_RCH_INPUT_VOLUME_CONTROL 0x13
  35. #define AK4671_ALC_REFERENCE_SELECT 0x14
  36. #define AK4671_DIGITAL_MIXING_CONTROL 0x15
  37. #define AK4671_ALC_TIMER_SELECT 0x16
  38. #define AK4671_ALC_MODE_CONTROL 0x17
  39. #define AK4671_MODE_CONTROL1 0x18
  40. #define AK4671_MODE_CONTROL2 0x19
  41. #define AK4671_LCH_OUTPUT_VOLUME_CONTROL 0x1a
  42. #define AK4671_RCH_OUTPUT_VOLUME_CONTROL 0x1b
  43. #define AK4671_SIDETONE_A_CONTROL 0x1c
  44. #define AK4671_DIGITAL_FILTER_SELECT 0x1d
  45. #define AK4671_FIL3_COEFFICIENT0 0x1e
  46. #define AK4671_FIL3_COEFFICIENT1 0x1f
  47. #define AK4671_FIL3_COEFFICIENT2 0x20
  48. #define AK4671_FIL3_COEFFICIENT3 0x21
  49. #define AK4671_EQ_COEFFICIENT0 0x22
  50. #define AK4671_EQ_COEFFICIENT1 0x23
  51. #define AK4671_EQ_COEFFICIENT2 0x24
  52. #define AK4671_EQ_COEFFICIENT3 0x25
  53. #define AK4671_EQ_COEFFICIENT4 0x26
  54. #define AK4671_EQ_COEFFICIENT5 0x27
  55. #define AK4671_FIL1_COEFFICIENT0 0x28
  56. #define AK4671_FIL1_COEFFICIENT1 0x29
  57. #define AK4671_FIL1_COEFFICIENT2 0x2a
  58. #define AK4671_FIL1_COEFFICIENT3 0x2b
  59. #define AK4671_FIL2_COEFFICIENT0 0x2c
  60. #define AK4671_FIL2_COEFFICIENT1 0x2d
  61. #define AK4671_FIL2_COEFFICIENT2 0x2e
  62. #define AK4671_FIL2_COEFFICIENT3 0x2f
  63. #define AK4671_DIGITAL_FILTER_SELECT2 0x30
  64. #define AK4671_E1_COEFFICIENT0 0x32
  65. #define AK4671_E1_COEFFICIENT1 0x33
  66. #define AK4671_E1_COEFFICIENT2 0x34
  67. #define AK4671_E1_COEFFICIENT3 0x35
  68. #define AK4671_E1_COEFFICIENT4 0x36
  69. #define AK4671_E1_COEFFICIENT5 0x37
  70. #define AK4671_E2_COEFFICIENT0 0x38
  71. #define AK4671_E2_COEFFICIENT1 0x39
  72. #define AK4671_E2_COEFFICIENT2 0x3a
  73. #define AK4671_E2_COEFFICIENT3 0x3b
  74. #define AK4671_E2_COEFFICIENT4 0x3c
  75. #define AK4671_E2_COEFFICIENT5 0x3d
  76. #define AK4671_E3_COEFFICIENT0 0x3e
  77. #define AK4671_E3_COEFFICIENT1 0x3f
  78. #define AK4671_E3_COEFFICIENT2 0x40
  79. #define AK4671_E3_COEFFICIENT3 0x41
  80. #define AK4671_E3_COEFFICIENT4 0x42
  81. #define AK4671_E3_COEFFICIENT5 0x43
  82. #define AK4671_E4_COEFFICIENT0 0x44
  83. #define AK4671_E4_COEFFICIENT1 0x45
  84. #define AK4671_E4_COEFFICIENT2 0x46
  85. #define AK4671_E4_COEFFICIENT3 0x47
  86. #define AK4671_E4_COEFFICIENT4 0x48
  87. #define AK4671_E4_COEFFICIENT5 0x49
  88. #define AK4671_E5_COEFFICIENT0 0x4a
  89. #define AK4671_E5_COEFFICIENT1 0x4b
  90. #define AK4671_E5_COEFFICIENT2 0x4c
  91. #define AK4671_E5_COEFFICIENT3 0x4d
  92. #define AK4671_E5_COEFFICIENT4 0x4e
  93. #define AK4671_E5_COEFFICIENT5 0x4f
  94. #define AK4671_EQ_CONTROL_250HZ_100HZ 0x50
  95. #define AK4671_EQ_CONTROL_3500HZ_1KHZ 0x51
  96. #define AK4671_EQ_CONTRO_10KHZ 0x52
  97. #define AK4671_PCM_IF_CONTROL0 0x53
  98. #define AK4671_PCM_IF_CONTROL1 0x54
  99. #define AK4671_PCM_IF_CONTROL2 0x55
  100. #define AK4671_DIGITAL_VOLUME_B_CONTROL 0x56
  101. #define AK4671_DIGITAL_VOLUME_C_CONTROL 0x57
  102. #define AK4671_SIDETONE_VOLUME_CONTROL 0x58
  103. #define AK4671_DIGITAL_MIXING_CONTROL2 0x59
  104. #define AK4671_SAR_ADC_CONTROL 0x5a
  105. #define AK4671_CACHEREGNUM (AK4671_SAR_ADC_CONTROL + 1)
  106. /* Bitfield Definitions */
  107. /* AK4671_AD_DA_POWER_MANAGEMENT (0x00) Fields */
  108. #define AK4671_PMVCM 0x01
  109. /* AK4671_PLL_MODE_SELECT0 (0x01) Fields */
  110. #define AK4671_PLL 0x0f
  111. #define AK4671_PLL_11_2896MHZ (4 << 0)
  112. #define AK4671_PLL_12_288MHZ (5 << 0)
  113. #define AK4671_PLL_12MHZ (6 << 0)
  114. #define AK4671_PLL_24MHZ (7 << 0)
  115. #define AK4671_PLL_19_2MHZ (8 << 0)
  116. #define AK4671_PLL_13_5MHZ (12 << 0)
  117. #define AK4671_PLL_27MHZ (13 << 0)
  118. #define AK4671_PLL_13MHZ (14 << 0)
  119. #define AK4671_PLL_26MHZ (15 << 0)
  120. #define AK4671_FS 0xf0
  121. #define AK4671_FS_8KHZ (0 << 4)
  122. #define AK4671_FS_12KHZ (1 << 4)
  123. #define AK4671_FS_16KHZ (2 << 4)
  124. #define AK4671_FS_24KHZ (3 << 4)
  125. #define AK4671_FS_11_025KHZ (5 << 4)
  126. #define AK4671_FS_22_05KHZ (7 << 4)
  127. #define AK4671_FS_32KHZ (10 << 4)
  128. #define AK4671_FS_48KHZ (11 << 4)
  129. #define AK4671_FS_44_1KHZ (15 << 4)
  130. /* AK4671_PLL_MODE_SELECT1 (0x02) Fields */
  131. #define AK4671_PMPLL 0x01
  132. #define AK4671_M_S 0x02
  133. /* AK4671_FORMAT_SELECT (0x03) Fields */
  134. #define AK4671_DIF 0x03
  135. #define AK4671_DIF_DSP_MODE (0 << 0)
  136. #define AK4671_DIF_MSB_MODE (2 << 0)
  137. #define AK4671_DIF_I2S_MODE (3 << 0)
  138. #define AK4671_BCKP 0x04
  139. #define AK4671_MSBS 0x08
  140. #define AK4671_SDOD 0x10
  141. /* AK4671_LOUT2_POWER_MANAGEMENT (0x10) Fields */
  142. #define AK4671_MUTEN 0x04
  143. #endif