diff options
Diffstat (limited to 'firmware/drivers/wm8975.c')
-rw-r--r-- | firmware/drivers/wm8975.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/firmware/drivers/wm8975.c b/firmware/drivers/wm8975.c index a961356222..96a563b1c9 100644 --- a/firmware/drivers/wm8975.c +++ b/firmware/drivers/wm8975.c | |||
@@ -40,13 +40,13 @@ | |||
40 | #include "wmcodec.h" | 40 | #include "wmcodec.h" |
41 | #include "wm8975.h" | 41 | #include "wm8975.h" |
42 | 42 | ||
43 | void wmcodec_reset(void); | 43 | void audiohw_reset(void); |
44 | 44 | ||
45 | #define IPOD_PCM_LEVEL 0x65 /* -6dB */ | 45 | #define IPOD_PCM_LEVEL 0x65 /* -6dB */ |
46 | 46 | ||
47 | 47 | ||
48 | /* Silently enable / disable audio output */ | 48 | /* Silently enable / disable audio output */ |
49 | void wmcodec_enable_output(bool enable) | 49 | void audiohw_enable_output(bool enable) |
50 | { | 50 | { |
51 | if (enable) | 51 | if (enable) |
52 | { | 52 | { |
@@ -77,7 +77,7 @@ void wmcodec_enable_output(bool enable) | |||
77 | wmcodec_write(AINTFCE, 0x42); | 77 | wmcodec_write(AINTFCE, 0x42); |
78 | 78 | ||
79 | /* The iPod can handle multiple frequencies, but fix at 44.1KHz for now */ | 79 | /* The iPod can handle multiple frequencies, but fix at 44.1KHz for now */ |
80 | wmcodec_set_sample_rate(WM8975_44100HZ); | 80 | audiohw_set_sample_rate(WM8975_44100HZ); |
81 | 81 | ||
82 | /* set the volume to -6dB */ | 82 | /* set the volume to -6dB */ |
83 | wmcodec_write(LOUT1VOL, IPOD_PCM_LEVEL); | 83 | wmcodec_write(LOUT1VOL, IPOD_PCM_LEVEL); |
@@ -94,13 +94,13 @@ void wmcodec_enable_output(bool enable) | |||
94 | wmcodec_write(MOUTMIX1, 0x0); /* Mono out Mix */ | 94 | wmcodec_write(MOUTMIX1, 0x0); /* Mono out Mix */ |
95 | wmcodec_write(MOUTMIX2, 0x0); | 95 | wmcodec_write(MOUTMIX2, 0x0); |
96 | 96 | ||
97 | wmcodec_mute(0); | 97 | audiohw_mute(0); |
98 | } else { | 98 | } else { |
99 | wmcodec_mute(1); | 99 | audiohw_mute(1); |
100 | } | 100 | } |
101 | } | 101 | } |
102 | 102 | ||
103 | int wmcodec_set_master_vol(int vol_l, int vol_r) | 103 | int audiohw_set_master_vol(int vol_l, int vol_r) |
104 | { | 104 | { |
105 | /* +6 to -73dB 1dB steps (plus mute == 80levels) 7bits */ | 105 | /* +6 to -73dB 1dB steps (plus mute == 80levels) 7bits */ |
106 | /* 1111111 == +6dB */ | 106 | /* 1111111 == +6dB */ |
@@ -115,7 +115,7 @@ int wmcodec_set_master_vol(int vol_l, int vol_r) | |||
115 | return 0; | 115 | return 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | int wmcodec_set_lineout_vol(int vol_l, int vol_r) | 118 | int audiohw_set_lineout_vol(int vol_l, int vol_r) |
119 | { | 119 | { |
120 | /* OUT2 */ | 120 | /* OUT2 */ |
121 | wmcodec_write(LOUT2VOL, vol_l); | 121 | wmcodec_write(LOUT2VOL, vol_l); |
@@ -124,7 +124,7 @@ int wmcodec_set_lineout_vol(int vol_l, int vol_r) | |||
124 | return 0; | 124 | return 0; |
125 | } | 125 | } |
126 | 126 | ||
127 | int wmcodec_set_mixer_vol(int channel1, int channel2) | 127 | int audiohw_set_mixer_vol(int channel1, int channel2) |
128 | { | 128 | { |
129 | (void)channel1; | 129 | (void)channel1; |
130 | (void)channel2; | 130 | (void)channel2; |
@@ -133,7 +133,7 @@ int wmcodec_set_mixer_vol(int channel1, int channel2) | |||
133 | } | 133 | } |
134 | 134 | ||
135 | /* We are using Linear bass control */ | 135 | /* We are using Linear bass control */ |
136 | void wmcodec_set_bass(int value) | 136 | void audiohw_set_bass(int value) |
137 | { | 137 | { |
138 | int regvalues[]={11, 10, 10, 9, 8, 8, 0xf , 6, 6, 5, 4, 4, 3, 2, 1, 0}; | 138 | int regvalues[]={11, 10, 10, 9, 8, 8, 0xf , 6, 6, 5, 4, 4, 3, 2, 1, 0}; |
139 | 139 | ||
@@ -143,7 +143,7 @@ void wmcodec_set_bass(int value) | |||
143 | } | 143 | } |
144 | } | 144 | } |
145 | 145 | ||
146 | void wmcodec_set_treble(int value) | 146 | void audiohw_set_treble(int value) |
147 | { | 147 | { |
148 | int regvalues[]={11, 10, 10, 9, 8, 8, 0xf , 6, 6, 5, 4, 4, 3, 2, 1, 0}; | 148 | int regvalues[]={11, 10, 10, 9, 8, 8, 0xf , 6, 6, 5, 4, 4, 3, 2, 1, 0}; |
149 | 149 | ||
@@ -153,7 +153,7 @@ void wmcodec_set_treble(int value) | |||
153 | } | 153 | } |
154 | } | 154 | } |
155 | 155 | ||
156 | int wmcodec_mute(int mute) | 156 | int audiohw_mute(int mute) |
157 | { | 157 | { |
158 | if (mute) | 158 | if (mute) |
159 | { | 159 | { |
@@ -168,7 +168,7 @@ int wmcodec_mute(int mute) | |||
168 | } | 168 | } |
169 | 169 | ||
170 | /* Nice shutdown of WM8975 codec */ | 170 | /* Nice shutdown of WM8975 codec */ |
171 | void wmcodec_close(void) | 171 | void audiohw_close(void) |
172 | { | 172 | { |
173 | /* 1. Set DACMU = 1 to soft-mute the audio DACs. */ | 173 | /* 1. Set DACMU = 1 to soft-mute the audio DACs. */ |
174 | wmcodec_write(DACCTRL, 0x8); | 174 | wmcodec_write(DACCTRL, 0x8); |
@@ -181,35 +181,35 @@ void wmcodec_close(void) | |||
181 | } | 181 | } |
182 | 182 | ||
183 | /* Change the order of the noise shaper, 5th order is recommended above 32kHz */ | 183 | /* Change the order of the noise shaper, 5th order is recommended above 32kHz */ |
184 | void wmcodec_set_nsorder(int order) | 184 | void audiohw_set_nsorder(int order) |
185 | { | 185 | { |
186 | (void)order; | 186 | (void)order; |
187 | } | 187 | } |
188 | 188 | ||
189 | /* Note: Disable output before calling this function */ | 189 | /* Note: Disable output before calling this function */ |
190 | void wmcodec_set_sample_rate(int sampling_control) { | 190 | void audiohw_set_sample_rate(int sampling_control) { |
191 | 191 | ||
192 | wmcodec_write(0x08, sampling_control); | 192 | wmcodec_write(0x08, sampling_control); |
193 | 193 | ||
194 | } | 194 | } |
195 | 195 | ||
196 | void wmcodec_enable_recording(bool source_mic) { | 196 | void audiohw_enable_recording(bool source_mic) { |
197 | 197 | ||
198 | (void)source_mic; | 198 | (void)source_mic; |
199 | } | 199 | } |
200 | 200 | ||
201 | void wmcodec_disable_recording(void) { | 201 | void audiohw_disable_recording(void) { |
202 | 202 | ||
203 | } | 203 | } |
204 | 204 | ||
205 | void wmcodec_set_recvol(int left, int right, int type) { | 205 | void audiohw_set_recvol(int left, int right, int type) { |
206 | 206 | ||
207 | (void)left; | 207 | (void)left; |
208 | (void)right; | 208 | (void)right; |
209 | (void)type; | 209 | (void)type; |
210 | } | 210 | } |
211 | 211 | ||
212 | void wmcodec_set_monitor(int enable) { | 212 | void audiohw_set_monitor(int enable) { |
213 | 213 | ||
214 | (void)enable; | 214 | (void)enable; |
215 | } | 215 | } |