summaryrefslogtreecommitdiff
path: root/firmware/drivers/audio/tlv320.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-05-03 14:33:22 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-05-03 14:33:22 +0000
commit13570996605fbd6574d10e58692e9378ba8a44fd (patch)
tree29907ca9198eb8820695e71776291e52b97e090c /firmware/drivers/audio/tlv320.c
parentef5286c48cff068c182d690820639d5700b4bc9c (diff)
downloadrockbox-13570996605fbd6574d10e58692e9378ba8a44fd.tar.gz
rockbox-13570996605fbd6574d10e58692e9378ba8a44fd.zip
And don't forget the yellows...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17321 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/audio/tlv320.c')
-rw-r--r--firmware/drivers/audio/tlv320.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/drivers/audio/tlv320.c b/firmware/drivers/audio/tlv320.c
index d4c21bd5c2..42a70d2137 100644
--- a/firmware/drivers/audio/tlv320.c
+++ b/firmware/drivers/audio/tlv320.c
@@ -17,6 +17,7 @@
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19#include "config.h" 19#include "config.h"
20#define LOGF_ENABLE
20#include "logf.h" 21#include "logf.h"
21#include "system.h" 22#include "system.h"
22#include "string.h" 23#include "string.h"
@@ -111,8 +112,10 @@ void audiohw_init(void)
111 112
112 /* All ON except OUT, ADC, MIC and LINE */ 113 /* All ON except OUT, ADC, MIC and LINE */
113 tlv320_write_reg(REG_PC, PC_OUT | PC_ADC | PC_MIC | PC_LINE); 114 tlv320_write_reg(REG_PC, PC_OUT | PC_ADC | PC_MIC | PC_LINE);
115#ifdef HAVE_RECORDING
114 audiohw_set_recvol(0, 0, AUDIO_GAIN_MIC); 116 audiohw_set_recvol(0, 0, AUDIO_GAIN_MIC);
115 audiohw_set_recvol(0, 0, AUDIO_GAIN_LINEIN); 117 audiohw_set_recvol(0, 0, AUDIO_GAIN_LINEIN);
118#endif
116 audiohw_mute(true); 119 audiohw_mute(true);
117 tlv320_write_reg(REG_AAP, AAP_DAC | AAP_MICM); 120 tlv320_write_reg(REG_AAP, AAP_DAC | AAP_MICM);
118 tlv320_write_reg(REG_DAP, 0x00); /* No deemphasis */ 121 tlv320_write_reg(REG_DAP, 0x00); /* No deemphasis */
@@ -210,6 +213,7 @@ void audiohw_set_headphone_vol(int vol_l, int vol_r)
210 * Mic (left): 0 .. 1 => Volume +0, +20 dB 213 * Mic (left): 0 .. 1 => Volume +0, +20 dB
211 * 214 *
212 */ 215 */
216#ifdef HAVE_RECORDING
213void audiohw_set_recvol(int left, int right, int type) 217void audiohw_set_recvol(int left, int right, int type)
214{ 218{
215 if (type == AUDIO_GAIN_MIC) 219 if (type == AUDIO_GAIN_MIC)
@@ -229,6 +233,7 @@ void audiohw_set_recvol(int left, int right, int type)
229 tlv320_write_reg(REG_RLIV, RLIV_RIV(right)); 233 tlv320_write_reg(REG_RLIV, RLIV_RIV(right));
230 } 234 }
231} 235}
236#endif
232 237
233void audiohw_mute(bool mute) 238void audiohw_mute(bool mute)
234{ 239{
@@ -264,6 +269,7 @@ void audiohw_close(void)
264 PC_DAC | PC_ADC | PC_MIC | PC_LINE); /* All OFF */ 269 PC_DAC | PC_ADC | PC_MIC | PC_LINE); /* All OFF */
265} 270}
266 271
272#ifdef HAVE_RECORDING
267void audiohw_enable_recording(bool source_mic) 273void audiohw_enable_recording(bool source_mic)
268{ 274{
269 unsigned value_aap, value_pc; 275 unsigned value_aap, value_pc;
@@ -295,6 +301,7 @@ void audiohw_disable_recording(void)
295 value_pc |= PC_ADC | PC_MIC | PC_LINE; /* ADC, MIC and LINE off */ 301 value_pc |= PC_ADC | PC_MIC | PC_LINE; /* ADC, MIC and LINE off */
296 tlv320_write_reg(REG_PC, value_pc); 302 tlv320_write_reg(REG_PC, value_pc);
297} 303}
304#endif
298 305
299void audiohw_set_monitor(bool enable) 306void audiohw_set_monitor(bool enable)
300{ 307{