summaryrefslogtreecommitdiff
path: root/firmware/drivers/audio/wm8985.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/audio/wm8985.c')
-rw-r--r--firmware/drivers/audio/wm8985.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/firmware/drivers/audio/wm8985.c b/firmware/drivers/audio/wm8985.c
index a76e20e57b..06b3fa3b44 100644
--- a/firmware/drivers/audio/wm8985.c
+++ b/firmware/drivers/audio/wm8985.c
@@ -109,8 +109,8 @@ const struct sound_settings_info audiohw_settings[] = {
109}; 109};
110 110
111/* shadow registers */ 111/* shadow registers */
112unsigned int eq1_reg; 112static unsigned int eq1_reg;
113unsigned int eq5_reg; 113static unsigned int eq5_reg;
114 114
115/* convert tenth of dB volume (-89..6) to master volume register value */ 115/* convert tenth of dB volume (-89..6) to master volume register value */
116int tenthdb2master(int db) 116int tenthdb2master(int db)
@@ -250,29 +250,37 @@ void audiohw_set_aux_vol(int vol_l, int vol_r)
250 wmcodec_write(ROUTMIX, 0x111 | (vol_r << 5) ); 250 wmcodec_write(ROUTMIX, 0x111 | (vol_r << 5) );
251} 251}
252 252
253#ifdef AUDIOHW_HAVE_BASS
253void audiohw_set_bass(int value) 254void audiohw_set_bass(int value)
254{ 255{
255 eq1_reg = (eq1_reg & ~EQ_GAIN_MASK) | EQ_GAIN_VALUE(value); 256 eq1_reg = (eq1_reg & ~EQ_GAIN_MASK) | EQ_GAIN_VALUE(value);
256 wmcodec_write(EQ1, 0x100 | eq1_reg); 257 wmcodec_write(EQ1, 0x100 | eq1_reg);
257} 258}
259#endif /* AUDIOHW_HAVE_BASS */
258 260
261#ifdef AUDIOHW_HAVE_BASS_CUTOFF
259void audiohw_set_bass_cutoff(int value) 262void audiohw_set_bass_cutoff(int value)
260{ 263{
261 eq1_reg = (eq1_reg & ~EQ_CUTOFF_MASK) | EQ_CUTOFF_VALUE(value); 264 eq1_reg = (eq1_reg & ~EQ_CUTOFF_MASK) | EQ_CUTOFF_VALUE(value);
262 wmcodec_write(EQ1, 0x100 | eq1_reg); 265 wmcodec_write(EQ1, 0x100 | eq1_reg);
263} 266}
267#endif /* AUDIOHW_HAVE_BASS_CUTOFF */
264 268
269#ifdef AUDIOHW_HAVE_TREBLE
265void audiohw_set_treble(int value) 270void audiohw_set_treble(int value)
266{ 271{
267 eq5_reg = (eq5_reg & ~EQ_GAIN_MASK) | EQ_GAIN_VALUE(value); 272 eq5_reg = (eq5_reg & ~EQ_GAIN_MASK) | EQ_GAIN_VALUE(value);
268 wmcodec_write(EQ5, eq5_reg); 273 wmcodec_write(EQ5, eq5_reg);
269} 274}
275#endif /* AUDIOHW_HAVE_TREBLE */
270 276
277#ifdef AUDIOHW_HAVE_TREBLE_CUTOFF
271void audiohw_set_treble_cutoff(int value) 278void audiohw_set_treble_cutoff(int value)
272{ 279{
273 eq5_reg = (eq5_reg & ~EQ_CUTOFF_MASK) | EQ_CUTOFF_VALUE(value); 280 eq5_reg = (eq5_reg & ~EQ_CUTOFF_MASK) | EQ_CUTOFF_VALUE(value);
274 wmcodec_write(EQ5, eq5_reg); 281 wmcodec_write(EQ5, eq5_reg);
275} 282}
283#endif /* AUDIOHW_HAVE_TREBLE_CUTOFF */
276 284
277/* Nice shutdown of WM8985 codec */ 285/* Nice shutdown of WM8985 codec */
278void audiohw_close(void) 286void audiohw_close(void)
@@ -286,6 +294,7 @@ void audiohw_close(void)
286 wmcodec_write(PWRMGMT2, 0x40); 294 wmcodec_write(PWRMGMT2, 0x40);
287} 295}
288 296
297#if 0 /* function is currently unused */
289/* Note: Disable output before calling this function */ 298/* Note: Disable output before calling this function */
290void audiohw_set_sample_rate(int fsel) 299void audiohw_set_sample_rate(int fsel)
291{ 300{
@@ -294,6 +303,7 @@ void audiohw_set_sample_rate(int fsel)
294 driver in Rockbox, so this may need to change in the future. */ 303 driver in Rockbox, so this may need to change in the future. */
295 (void)fsel; 304 (void)fsel;
296} 305}
306#endif
297 307
298#ifdef HAVE_RECORDING 308#ifdef HAVE_RECORDING
299void audiohw_enable_recording(bool source_mic) 309void audiohw_enable_recording(bool source_mic)