summaryrefslogtreecommitdiff
path: root/firmware/drivers/wm8758.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/wm8758.c')
-rw-r--r--firmware/drivers/wm8758.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/firmware/drivers/wm8758.c b/firmware/drivers/wm8758.c
index bdc9c8b450..3a4256bb69 100644
--- a/firmware/drivers/wm8758.c
+++ b/firmware/drivers/wm8758.c
@@ -40,7 +40,7 @@
40#include "wmcodec.h" 40#include "wmcodec.h"
41#include "wm8758.h" 41#include "wm8758.h"
42 42
43void wmcodec_reset(void); 43void audiohw_reset(void);
44 44
45#define IPOD_PCM_LEVEL 0x65 /* -6dB */ 45#define IPOD_PCM_LEVEL 0x65 /* -6dB */
46 46
@@ -48,7 +48,7 @@ void wmcodec_reset(void);
48//#define TREBCTRL 0x0b 48//#define TREBCTRL 0x0b
49 49
50/* Silently enable / disable audio output */ 50/* Silently enable / disable audio output */
51void wmcodec_enable_output(bool enable) 51void audiohw_enable_output(bool enable)
52{ 52{
53 if (enable) 53 if (enable)
54 { 54 {
@@ -70,17 +70,17 @@ void wmcodec_enable_output(bool enable)
70 70
71 /* The iPod can handle multiple frequencies, but fix at 44.1KHz 71 /* The iPod can handle multiple frequencies, but fix at 44.1KHz
72 for now */ 72 for now */
73 wmcodec_set_sample_rate(WM8758_44100HZ); 73 audiohw_set_sample_rate(WM8758_44100HZ);
74 74
75 wmcodec_write(LOUTMIX,0x1); /* Enable mixer */ 75 wmcodec_write(LOUTMIX,0x1); /* Enable mixer */
76 wmcodec_write(ROUTMIX,0x1); /* Enable mixer */ 76 wmcodec_write(ROUTMIX,0x1); /* Enable mixer */
77 wmcodec_mute(0); 77 audiohw_mute(0);
78 } else { 78 } else {
79 wmcodec_mute(1); 79 audiohw_mute(1);
80 } 80 }
81} 81}
82 82
83int wmcodec_set_master_vol(int vol_l, int vol_r) 83int audiohw_set_master_vol(int vol_l, int vol_r)
84{ 84{
85 /* OUT1 */ 85 /* OUT1 */
86 wmcodec_write(LOUT1VOL, 0x080 | vol_l); 86 wmcodec_write(LOUT1VOL, 0x080 | vol_l);
@@ -89,7 +89,7 @@ int wmcodec_set_master_vol(int vol_l, int vol_r)
89 return 0; 89 return 0;
90} 90}
91 91
92int wmcodec_set_lineout_vol(int vol_l, int vol_r) 92int audiohw_set_lineout_vol(int vol_l, int vol_r)
93{ 93{
94 /* OUT2 */ 94 /* OUT2 */
95 wmcodec_write(LOUT2VOL, vol_l); 95 wmcodec_write(LOUT2VOL, vol_l);
@@ -98,7 +98,7 @@ int wmcodec_set_lineout_vol(int vol_l, int vol_r)
98 return 0; 98 return 0;
99} 99}
100 100
101int wmcodec_set_mixer_vol(int channel1, int channel2) 101int audiohw_set_mixer_vol(int channel1, int channel2)
102{ 102{
103 (void)channel1; 103 (void)channel1;
104 (void)channel2; 104 (void)channel2;
@@ -107,7 +107,7 @@ int wmcodec_set_mixer_vol(int channel1, int channel2)
107} 107}
108 108
109/* We are using Linear bass control */ 109/* We are using Linear bass control */
110void wmcodec_set_bass(int value) 110void audiohw_set_bass(int value)
111{ 111{
112 (void)value; 112 (void)value;
113#if 0 113#if 0
@@ -121,7 +121,7 @@ void wmcodec_set_bass(int value)
121#endif 121#endif
122} 122}
123 123
124void wmcodec_set_treble(int value) 124void audiohw_set_treble(int value)
125{ 125{
126 (void)value; 126 (void)value;
127#if 0 127#if 0
@@ -136,7 +136,7 @@ void wmcodec_set_treble(int value)
136 136
137} 137}
138 138
139int wmcodec_mute(int mute) 139int audiohw_mute(int mute)
140{ 140{
141 if (mute) 141 if (mute)
142 { 142 {
@@ -151,9 +151,9 @@ int wmcodec_mute(int mute)
151} 151}
152 152
153/* Nice shutdown of WM8758 codec */ 153/* Nice shutdown of WM8758 codec */
154void wmcodec_close(void) 154void audiohw_close(void)
155{ 155{
156 wmcodec_mute(1); 156 audiohw_mute(1);
157 157
158 wmcodec_write(PWRMGMT3, 0x0); 158 wmcodec_write(PWRMGMT3, 0x0);
159 159
@@ -163,13 +163,13 @@ void wmcodec_close(void)
163} 163}
164 164
165/* Change the order of the noise shaper, 5th order is recommended above 32kHz */ 165/* Change the order of the noise shaper, 5th order is recommended above 32kHz */
166void wmcodec_set_nsorder(int order) 166void audiohw_set_nsorder(int order)
167{ 167{
168 (void)order; 168 (void)order;
169} 169}
170 170
171/* Note: Disable output before calling this function */ 171/* Note: Disable output before calling this function */
172void wmcodec_set_sample_rate(int sampling_control) 172void audiohw_set_sample_rate(int sampling_control)
173{ 173{
174 /**** We force 44.1KHz for now. ****/ 174 /**** We force 44.1KHz for now. ****/
175 (void)sampling_control; 175 (void)sampling_control;
@@ -190,28 +190,28 @@ void wmcodec_set_sample_rate(int sampling_control)
190 wmcodec_write(SRATECTRL, (0 << 1)); 190 wmcodec_write(SRATECTRL, (0 << 1));
191} 191}
192 192
193void wmcodec_enable_recording(bool source_mic) 193void audiohw_enable_recording(bool source_mic)
194{ 194{
195 (void)source_mic; 195 (void)source_mic;
196} 196}
197 197
198void wmcodec_disable_recording(void) { 198void audiohw_disable_recording(void) {
199 199
200} 200}
201 201
202void wmcodec_set_recvol(int left, int right, int type) { 202void audiohw_set_recvol(int left, int right, int type) {
203 203
204 (void)left; 204 (void)left;
205 (void)right; 205 (void)right;
206 (void)type; 206 (void)type;
207} 207}
208 208
209void wmcodec_set_monitor(int enable) { 209void audiohw_set_monitor(int enable) {
210 210
211 (void)enable; 211 (void)enable;
212} 212}
213 213
214void wmcodec_set_equalizer_band(int band, int freq, int bw, int gain) 214void audiohw_set_equalizer_band(int band, int freq, int bw, int gain)
215{ 215{
216 unsigned int eq = 0; 216 unsigned int eq = 0;
217 217