49 #define WM8904_CLK_MCLK 1
50 #define WM8904_CLK_FLL 2
52 #define WM8904_FLL_MCLK 1
53 #define WM8904_FLL_BCLK 2
54 #define WM8904_FLL_LRCLK 3
55 #define WM8904_FLL_FREE_RUNNING 4
60 #define WM8904_SW_RESET_AND_ID 0x00
61 #define WM8904_REVISION 0x01
62 #define WM8904_BIAS_CONTROL_0 0x04
63 #define WM8904_VMID_CONTROL_0 0x05
64 #define WM8904_MIC_BIAS_CONTROL_0 0x06
65 #define WM8904_MIC_BIAS_CONTROL_1 0x07
66 #define WM8904_ANALOGUE_DAC_0 0x08
67 #define WM8904_MIC_FILTER_CONTROL 0x09
68 #define WM8904_ANALOGUE_ADC_0 0x0A
69 #define WM8904_POWER_MANAGEMENT_0 0x0C
70 #define WM8904_POWER_MANAGEMENT_2 0x0E
71 #define WM8904_POWER_MANAGEMENT_3 0x0F
72 #define WM8904_POWER_MANAGEMENT_6 0x12
73 #define WM8904_CLOCK_RATES_0 0x14
74 #define WM8904_CLOCK_RATES_1 0x15
75 #define WM8904_CLOCK_RATES_2 0x16
76 #define WM8904_AUDIO_INTERFACE_0 0x18
77 #define WM8904_AUDIO_INTERFACE_1 0x19
78 #define WM8904_AUDIO_INTERFACE_2 0x1A
79 #define WM8904_AUDIO_INTERFACE_3 0x1B
80 #define WM8904_DAC_DIGITAL_VOLUME_LEFT 0x1E
81 #define WM8904_DAC_DIGITAL_VOLUME_RIGHT 0x1F
82 #define WM8904_DAC_DIGITAL_0 0x20
83 #define WM8904_DAC_DIGITAL_1 0x21
84 #define WM8904_ADC_DIGITAL_VOLUME_LEFT 0x24
85 #define WM8904_ADC_DIGITAL_VOLUME_RIGHT 0x25
86 #define WM8904_ADC_DIGITAL_0 0x26
87 #define WM8904_DIGITAL_MICROPHONE_0 0x27
88 #define WM8904_DRC_0 0x28
89 #define WM8904_DRC_1 0x29
90 #define WM8904_DRC_2 0x2A
91 #define WM8904_DRC_3 0x2B
92 #define WM8904_ANALOGUE_LEFT_INPUT_0 0x2C
93 #define WM8904_ANALOGUE_RIGHT_INPUT_0 0x2D
94 #define WM8904_ANALOGUE_LEFT_INPUT_1 0x2E
95 #define WM8904_ANALOGUE_RIGHT_INPUT_1 0x2F
96 #define WM8904_ANALOGUE_OUT1_LEFT 0x39
97 #define WM8904_ANALOGUE_OUT1_RIGHT 0x3A
98 #define WM8904_ANALOGUE_OUT2_LEFT 0x3B
99 #define WM8904_ANALOGUE_OUT2_RIGHT 0x3C
100 #define WM8904_ANALOGUE_OUT12_ZC 0x3D
101 #define WM8904_DC_SERVO_0 0x43
102 #define WM8904_DC_SERVO_1 0x44
103 #define WM8904_DC_SERVO_2 0x45
104 #define WM8904_DC_SERVO_4 0x47
105 #define WM8904_DC_SERVO_5 0x48
106 #define WM8904_DC_SERVO_6 0x49
107 #define WM8904_DC_SERVO_7 0x4A
108 #define WM8904_DC_SERVO_8 0x4B
109 #define WM8904_DC_SERVO_9 0x4C
110 #define WM8904_DC_SERVO_READBACK_0 0x4D
111 #define WM8904_ANALOGUE_HP_0 0x5A
112 #define WM8904_ANALOGUE_LINEOUT_0 0x5E
113 #define WM8904_CHARGE_PUMP_0 0x62
114 #define WM8904_CLASS_W_0 0x68
115 #define WM8904_WRITE_SEQUENCER_0 0x6C
116 #define WM8904_WRITE_SEQUENCER_1 0x6D
117 #define WM8904_WRITE_SEQUENCER_2 0x6E
118 #define WM8904_WRITE_SEQUENCER_3 0x6F
119 #define WM8904_WRITE_SEQUENCER_4 0x70
120 #define WM8904_FLL_CONTROL_1 0x74
121 #define WM8904_FLL_CONTROL_2 0x75
122 #define WM8904_FLL_CONTROL_3 0x76
123 #define WM8904_FLL_CONTROL_4 0x77
124 #define WM8904_FLL_CONTROL_5 0x78
125 #define WM8904_GPIO_CONTROL_1 0x79
126 #define WM8904_GPIO_CONTROL_2 0x7A
127 #define WM8904_GPIO_CONTROL_3 0x7B
128 #define WM8904_GPIO_CONTROL_4 0x7C
129 #define WM8904_DIGITAL_PULLS 0x7E
130 #define WM8904_INTERRUPT_STATUS 0x7F
131 #define WM8904_INTERRUPT_STATUS_MASK 0x80
132 #define WM8904_INTERRUPT_POLARITY 0x81
133 #define WM8904_INTERRUPT_DEBOUNCE 0x82
134 #define WM8904_EQ1 0x86
135 #define WM8904_EQ2 0x87
136 #define WM8904_EQ3 0x88
137 #define WM8904_EQ4 0x89
138 #define WM8904_EQ5 0x8A
139 #define WM8904_EQ6 0x8B
140 #define WM8904_EQ7 0x8C
141 #define WM8904_EQ8 0x8D
142 #define WM8904_EQ9 0x8E
143 #define WM8904_EQ10 0x8F
144 #define WM8904_EQ11 0x90
145 #define WM8904_EQ12 0x91
146 #define WM8904_EQ13 0x92
147 #define WM8904_EQ14 0x93
148 #define WM8904_EQ15 0x94
149 #define WM8904_EQ16 0x95
150 #define WM8904_EQ17 0x96
151 #define WM8904_EQ18 0x97
152 #define WM8904_EQ19 0x98
153 #define WM8904_EQ20 0x99
154 #define WM8904_EQ21 0x9A
155 #define WM8904_EQ22 0x9B
156 #define WM8904_EQ23 0x9C
157 #define WM8904_EQ24 0x9D
158 #define WM8904_CONTROL_INTERFACE_TEST_1 0xA1
159 #define WM8904_ADC_TEST_0 0xC6
160 #define WM8904_ANALOGUE_OUTPUT_BIAS_0 0xCC
161 #define WM8904_FLL_NCO_TEST_0 0xF7
162 #define WM8904_FLL_NCO_TEST_1 0xF8
164 #define WM8904_REGISTER_COUNT 101
165 #define WM8904_MAX_REGISTER 0xF8
169 #define WM8904_FLL_1288MHZ_K (0x3127)
170 #define WM8904_FLL_1288MHZ_N (0x8 << 5)
171 #define WM8904_FLL_1128MHZ_K (0x86C2)
172 #define WM8904_FLL_1128MHZ_N (0x7 << 5)
174 #define WM8904_BDIV_256FS_2_64FS (0x0004)
175 #define WM8904_BDIV_256FS_2_32FS (0x0008)
176 #define WM8904_BDIV_384FS_2_64FS (0x0007)
177 #define WM8904_BDIV_384FS_2_32FS (0x000B)
178 #define WM8904_LRDIV_64FS (0x0840)
179 #define WM8904_LRDIV_32FS (0x0820)
181 #define WM8904_AIF123_256FS_2_32FS { 0x4042, WM8904_BDIV_256FS_2_32FS, WM8904_LRDIV_32FS}
182 #define WM8904_AIF123_256FS_2_64FS { 0x404A, WM8904_BDIV_256FS_2_64FS, WM8904_LRDIV_64FS}
183 #define WM8904_AIF123_384FS_2_32FS { 0x4042, WM8904_BDIV_384FS_2_32FS, WM8904_LRDIV_32FS}
184 #define WM8904_AIF123_384FS_2_64FS { 0x404A, WM8904_BDIV_384FS_2_64FS, WM8904_LRDIV_64FS}
186 #define WM8904_DAC_DIGITAL_1_VALUE 0x0240
197 #define WM8904_U8(val) (((val) >> 8) & 0xFF), ((val) & 0xFF)