From 44a5c827b7f6576b180043f8edd1837c611033e1 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Fri, 3 Feb 2006 23:59:41 +0000 Subject: iAudio X5: Corrected crappy code, just to make the damn thing compile git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8559 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/tlv320.c | 32 ++++++++++++++++---------------- firmware/export/tlv320.h | 8 ++++---- 2 files changed, 20 insertions(+), 20 deletions(-) (limited to 'firmware') diff --git a/firmware/drivers/tlv320.c b/firmware/drivers/tlv320.c index bafd77cd39..da92028ce1 100644 --- a/firmware/drivers/tlv320.c +++ b/firmware/drivers/tlv320.c @@ -60,7 +60,7 @@ unsigned tlv320_regs[0xf]; void tlv320_write_reg(unsigned reg, unsigned value) { - unsigned data[3]; + unsigned char data[3]; data[0] = TLV320_ADDR; data[1] = reg << 1; @@ -76,7 +76,7 @@ void tlv320_write_reg(unsigned reg, unsigned value) } /* Returns 0 if successful or -1 if some register failed */ -void tlv320_set_regs() +void tlv320_set_regs(void) { int i; memset(tlv320_regs, 0, sizeof(tlv320_regs)); @@ -96,7 +96,7 @@ void tlv320_set_regs() /** * Init our tlv with default values */ -void tlv320_init() +void tlv320_init(void) { tlv320_reset(); tlv320_set_regs(); @@ -105,14 +105,14 @@ void tlv320_init() /** * Resets tlv320 to default values */ -void tlv320_reset() +void tlv320_reset(void) { - tlv320_write_reg(REG_RR, RR_RESET): + tlv320_write_reg(REG_RR, RR_RESET); } void tlv320_enable_output(bool enable) { - unsigned value = tlv320regs[REG_PC]; + unsigned value = tlv320_regs[REG_PC]; if (enable) value |= PC_OUT; @@ -148,11 +148,11 @@ void tlv320_set_headphone_vol(int vol_l, int vol_r) */ void tlv320_set_linein_vol(int vol_l, int vol_r) { - unsigned value_l = tlv320regs[REG_LLIV]; - unsigned value_r = tlv320regs[REG_RLIV]; + unsigned value_l = tlv320_regs[REG_LLIV]; + unsigned value_r = tlv320_regs[REG_RLIV]; - value_l |= LLIV_LHV(vol_l); - value_r |= RLIV_RHV(vol_r); + value_l |= LLIV_LIV(vol_l); + value_r |= RLIV_RIV(vol_r); tlv320_write_reg(REG_LLIV, value_l); tlv320_write_reg(REG_RLIV, value_r); @@ -164,8 +164,8 @@ void tlv320_set_linein_vol(int vol_l, int vol_r) */ void tlv320_mute(bool mute) { - unsigned value_l = tlv320regs[REG_LHV]; - unsigned value_r = tlv320regs[REG_RHV]; + unsigned value_l = tlv320_regs[REG_LHV]; + unsigned value_r = tlv320_regs[REG_RHV]; if (mute) { @@ -189,8 +189,8 @@ void tlv320_close() void tlv320_enable_recording(bool source_mic) { - unsigned value_pc = tlv320regs[REG_PC]; - unsigned value_aap = tlv320regs[REG_AAP]; + unsigned value_pc = tlv320_regs[REG_PC]; + unsigned value_aap = tlv320_regs[REG_AAP]; /* select source*/ if (source_mic) @@ -213,11 +213,11 @@ void tlv320_enable_recording(bool source_mic) void tlv320_disable_recording() { - unsigned value = tlv320regs[REG_PC]; + unsigned value = tlv320_regs[REG_PC]; /* powerdown mic, linein and adc */ value &= ~(PC_MIC | PC_LINE | PC_ADC); /* powerdown mic, linein and adc */ tlv320_write_reg(REG_PC, value); -} \ No newline at end of file +} diff --git a/firmware/export/tlv320.h b/firmware/export/tlv320.h index d07b0a199c..c4599f02b2 100644 --- a/firmware/export/tlv320.h +++ b/firmware/export/tlv320.h @@ -41,25 +41,25 @@ extern void tlv320_disable_recording(void); #define REG_LLIV 0x0 #define LLIV_LRS (0 << 8) /* simultaneous volume/mute update */ #define LLIV_LIM (1 << 7) /* Left line input mute */ -#define LLIV_LIV ((x) & 0x1f)/* Left line input volume control */ +#define LLIV_LIV(x) ((x) & 0x1f)/* Left line input volume control */ /* REG_RLIV: Right line input channel volume control */ #define REG_RLIV 0x1 #define RLIV_RLS (0 << 8) /* simultaneous volume/mute update */ #define RLIV_RIM (0 << 7) /* Right line input mute */ -#define RLIV_LIV ((x) & 0x1f)/* Right line input volume control */ +#define RLIV_RIV(x) ((x) & 0x1f)/* Right line input volume control */ /* REG_LHV: Left Channel Headphone Volume Control */ #define REG_LHV 0x2 #define LHV_LRS (0 << 8) /* simultaneous volume/mute update */ #define LHV_LZC (0 << 7) /* Left-channel zero-cross detect */ -#define LHV_LHV ((x) & 0x7f)/* Left headphone volume control */ +#define LHV_LHV(x) ((x) & 0x7f)/* Left headphone volume control */ /* REG_RHV: Right Channel Headphone Volume Control */ #define REG_RHV 0x3 #define RHV_LRS (0 << 8) /* simultaneous volume/mute update */ #define RHV_RZC (0 << 7) /* Right-channel zero-cross detect */ -#define RHV_LHV ((x) & 0x7f)/* Right headphone volume control */ +#define RHV_RHV(x) ((x) & 0x7f)/* Right headphone volume control */ /* REG_AAP: Analog Audio Path Control */ #define REG_AAP 0x4 -- cgit v1.2.3