summaryrefslogtreecommitdiff
path: root/firmware/drivers/wm8975.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/wm8975.c')
-rw-r--r--firmware/drivers/wm8975.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/firmware/drivers/wm8975.c b/firmware/drivers/wm8975.c
index 54e245b61a..51c12f1505 100644
--- a/firmware/drivers/wm8975.c
+++ b/firmware/drivers/wm8975.c
@@ -41,7 +41,7 @@
41#include "wm8975.h" 41#include "wm8975.h"
42#include "pcf50605.h" 42#include "pcf50605.h"
43 43
44void wm8975_reset(void); 44void wmcodec_reset(void);
45 45
46#define IPOD_PCM_LEVEL 0x65 /* -6dB */ 46#define IPOD_PCM_LEVEL 0x65 /* -6dB */
47 47
@@ -82,7 +82,7 @@ void wm8975_write(int reg, int data)
82 * Initialise the WM8975 for playback via headphone and line out. 82 * Initialise the WM8975 for playback via headphone and line out.
83 * Note, I'm using the WM8750 datasheet as its apparently close. 83 * Note, I'm using the WM8750 datasheet as its apparently close.
84 */ 84 */
85int wm8975_init(void) { 85int wmcodec_init(void) {
86 /* reset I2C */ 86 /* reset I2C */
87 i2c_init(); 87 i2c_init();
88 88
@@ -110,7 +110,7 @@ int wm8975_init(void) {
110} 110}
111 111
112/* Silently enable / disable audio output */ 112/* Silently enable / disable audio output */
113void wm8975_enable_output(bool enable) 113void wmcodec_enable_output(bool enable)
114{ 114{
115 if (enable) 115 if (enable)
116 { 116 {
@@ -141,7 +141,7 @@ void wm8975_enable_output(bool enable)
141 wm8975_write(AINTFCE, 0x42); 141 wm8975_write(AINTFCE, 0x42);
142 142
143 /* The iPod can handle multiple frequencies, but fix at 44.1KHz for now */ 143 /* The iPod can handle multiple frequencies, but fix at 44.1KHz for now */
144 wm8975_set_sample_rate(WM8975_44100HZ); 144 wmcodec_set_sample_rate(WM8975_44100HZ);
145 145
146 /* set the volume to -6dB */ 146 /* set the volume to -6dB */
147 wm8975_write(LOUT1VOL, IPOD_PCM_LEVEL); 147 wm8975_write(LOUT1VOL, IPOD_PCM_LEVEL);
@@ -158,13 +158,13 @@ void wm8975_enable_output(bool enable)
158 wm8975_write(MOUTMIX1, 0x0); /* Mono out Mix */ 158 wm8975_write(MOUTMIX1, 0x0); /* Mono out Mix */
159 wm8975_write(MOUTMIX2, 0x0); 159 wm8975_write(MOUTMIX2, 0x0);
160 160
161 wm8975_mute(0); 161 wmcodec_mute(0);
162 } else { 162 } else {
163 wm8975_mute(1); 163 wmcodec_mute(1);
164 } 164 }
165} 165}
166 166
167int wm8975_set_master_vol(int vol_l, int vol_r) 167int wmcodec_set_master_vol(int vol_l, int vol_r)
168{ 168{
169 /* +6 to -73dB 1dB steps (plus mute == 80levels) 7bits */ 169 /* +6 to -73dB 1dB steps (plus mute == 80levels) 7bits */
170 /* 1111111 == +6dB */ 170 /* 1111111 == +6dB */
@@ -183,7 +183,7 @@ int wm8975_set_master_vol(int vol_l, int vol_r)
183 return 0; 183 return 0;
184} 184}
185 185
186int wm8975_set_mixer_vol(int channel1, int channel2) 186int wmcodec_set_mixer_vol(int channel1, int channel2)
187{ 187{
188 (void)channel1; 188 (void)channel1;
189 (void)channel2; 189 (void)channel2;
@@ -192,7 +192,7 @@ int wm8975_set_mixer_vol(int channel1, int channel2)
192} 192}
193 193
194/* We are using Linear bass control */ 194/* We are using Linear bass control */
195void wm8975_set_bass(int value) 195void wmcodec_set_bass(int value)
196{ 196{
197 int regvalues[]={11, 10, 10, 9, 8, 8, 0xf , 6, 6, 5, 4, 4, 3, 2, 1, 0}; 197 int regvalues[]={11, 10, 10, 9, 8, 8, 0xf , 6, 6, 5, 4, 4, 3, 2, 1, 0};
198 198
@@ -202,7 +202,7 @@ void wm8975_set_bass(int value)
202 } 202 }
203} 203}
204 204
205void wm8975_set_treble(int value) 205void wmcodec_set_treble(int value)
206{ 206{
207 int regvalues[]={11, 10, 10, 9, 8, 8, 0xf , 6, 6, 5, 4, 4, 3, 2, 1, 0}; 207 int regvalues[]={11, 10, 10, 9, 8, 8, 0xf , 6, 6, 5, 4, 4, 3, 2, 1, 0};
208 208
@@ -212,7 +212,7 @@ void wm8975_set_treble(int value)
212 } 212 }
213} 213}
214 214
215int wm8975_mute(int mute) 215int wmcodec_mute(int mute)
216{ 216{
217 if (mute) 217 if (mute)
218 { 218 {
@@ -227,7 +227,7 @@ int wm8975_mute(int mute)
227} 227}
228 228
229/* Nice shutdown of WM8975 codec */ 229/* Nice shutdown of WM8975 codec */
230void wm8975_close(void) 230void wmcodec_close(void)
231{ 231{
232 /* 1. Set DACMU = 1 to soft-mute the audio DACs. */ 232 /* 1. Set DACMU = 1 to soft-mute the audio DACs. */
233 wm8975_write(DACCTRL, 0x8); 233 wm8975_write(DACCTRL, 0x8);
@@ -240,35 +240,35 @@ void wm8975_close(void)
240} 240}
241 241
242/* Change the order of the noise shaper, 5th order is recommended above 32kHz */ 242/* Change the order of the noise shaper, 5th order is recommended above 32kHz */
243void wm8975_set_nsorder(int order) 243void wmcodec_set_nsorder(int order)
244{ 244{
245 (void)order; 245 (void)order;
246} 246}
247 247
248/* Note: Disable output before calling this function */ 248/* Note: Disable output before calling this function */
249void wm8975_set_sample_rate(int sampling_control) { 249void wmcodec_set_sample_rate(int sampling_control) {
250 250
251 wm8975_write(0x08, sampling_control); 251 wm8975_write(0x08, sampling_control);
252 252
253} 253}
254 254
255void wm8975_enable_recording(bool source_mic) { 255void wmcodec_enable_recording(bool source_mic) {
256 256
257 (void)source_mic; 257 (void)source_mic;
258} 258}
259 259
260void wm8975_disable_recording(void) { 260void wmcodec_disable_recording(void) {
261 261
262} 262}
263 263
264void wm8975_set_recvol(int left, int right, int type) { 264void wmcodec_set_recvol(int left, int right, int type) {
265 265
266 (void)left; 266 (void)left;
267 (void)right; 267 (void)right;
268 (void)type; 268 (void)type;
269} 269}
270 270
271void wm8975_set_monitor(int enable) { 271void wmcodec_set_monitor(int enable) {
272 272
273 (void)enable; 273 (void)enable;
274} 274}