diff options
| author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2008-05-03 14:15:41 +0000 |
|---|---|---|
| committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2008-05-03 14:15:41 +0000 |
| commit | ae0f5edd7ce43378e6f38643a65e4f8259cc73a0 (patch) | |
| tree | 2604e8121088bef6a60b55722b42d1dc733df6b5 | |
| parent | 65a0de3d07731b2857f28261837b5c136f7922d1 (diff) | |
| download | rockbox-ae0f5edd7ce43378e6f38643a65e4f8259cc73a0.zip rockbox-ae0f5edd7ce43378e6f38643a65e4f8259cc73a0.tar.gz rockbox-ae0f5edd7ce43378e6f38643a65e4f8259cc73a0.tar.bz2 rockbox-ae0f5edd7ce43378e6f38643a65e4f8259cc73a0.tar.xz | |
Fix more red...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17318 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/drivers/audio/tlv320.c | 20 | ||||
| -rw-r--r-- | firmware/export/config-creativezvm.h | 18 |
2 files changed, 24 insertions, 14 deletions
diff --git a/firmware/drivers/audio/tlv320.c b/firmware/drivers/audio/tlv320.c index 6a22ab1..d4c21bd 100644 --- a/firmware/drivers/audio/tlv320.c +++ b/firmware/drivers/audio/tlv320.c @@ -16,13 +16,16 @@ * KIND, either express or implied. * ****************************************************************************/ +#include "config.h" #include "logf.h" #include "system.h" #include "string.h" #include "audio.h" -#ifdef CPU_COLDFIRE +#if CONFIG_I2C == I2C_COLDFIRE #include "i2c-coldfire.h" +#elif CONFIG_I2C == I2C_DM320 +#include "i2c-dm320.h" #endif #include "audiohw.h" @@ -45,7 +48,7 @@ int tenthdb2master(int db) /* +6 to -73dB 1dB steps (plus mute == 80levels) 7bits */ /* 1111111 == +6dB (0x7f) */ /* 1111001 == 0dB (0x79) */ - /* 0110000 == -73dB (0x30 */ + /* 0110000 == -73dB (0x30) */ /* 0101111 == mute (0x2f) */ if (db < VOLUME_MIN) { @@ -56,7 +59,11 @@ int tenthdb2master(int db) } /* local functions and definations */ +#ifndef CREATIVE_ZVM #define TLV320_ADDR 0x34 +#else +#define TLV320_ADDR 0x1A +#endif struct tlv320_info { @@ -75,8 +82,10 @@ static void tlv320_write_reg(unsigned reg, unsigned value) data[0] = (reg << 1) | ((value >> 8) & 1); data[1] = value; -#ifdef CPU_COLDFIRE +#if CONFIG_I2C == I2C_COLDFIRE if (i2c_write(I2C_IFACE_0, TLV320_ADDR, data, 2) != 2) +#elif CONFIG_I2C == I2C_DM320 + if (i2c_write(TLV320_ADDR, data, 2) != 0) #else #warning Implement tlv320_write_reg() #endif @@ -95,6 +104,7 @@ static void tlv320_write_reg(unsigned reg, unsigned value) */ void audiohw_init(void) { + logf("TLV320 init"); memset(tlv320_regs, 0, sizeof(tlv320_regs)); /* Initialize all registers */ @@ -106,7 +116,11 @@ void audiohw_init(void) audiohw_mute(true); tlv320_write_reg(REG_AAP, AAP_DAC | AAP_MICM); tlv320_write_reg(REG_DAP, 0x00); /* No deemphasis */ +#ifndef CREATIVE_ZVM tlv320_write_reg(REG_DAIF, DAIF_IWL_16 | DAIF_FOR_I2S); +#else + tlv320_write_reg(REG_DAIF, DAIF_IWL_16 | DAIF_FOR_DSP); +#endif tlv320_write_reg(REG_DIA, DIA_ACT); audiohw_set_frequency(-1); /* default */ } diff --git a/firmware/export/config-creativezvm.h b/firmware/export/config-creativezvm.h index 509bbc9..b0fdbb6 100644 --- a/firmware/export/config-creativezvm.h +++ b/firmware/export/config-creativezvm.h @@ -48,7 +48,7 @@ #define HAVE_TAGCACHE /* define this if the target has volume keys which can be used in the lists */ -#define HAVE_VOLUME_IN_LIST +//#define HAVE_VOLUME_IN_LIST /* LCD dimensions */ #define CONFIG_LCD LCD_CREATIVEZVM @@ -99,8 +99,10 @@ /* The number of bytes reserved for loadable plugins */ #define PLUGIN_BUFFER_SIZE 0x100000 -/* Define this if you have the TLV320 audio codec */ -//#define HAVE_TLV320 +/* Define this if you have the TLV320 audio codec -> controlled by the DSP */ +#define HAVE_TLV320 + +#define CONFIG_I2C I2C_DM320 /* TLV320 has no tone controls, so we use the software ones */ //#define HAVE_SW_TONE_CONTROLS @@ -108,7 +110,7 @@ /*#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | \ SAMPR_CAP_11)*/ -#define BATTERY_CAPACITY_DEFAULT 1100 /* default battery capacity */ +#define BATTERY_CAPACITY_DEFAULT 1250 /* default battery capacity */ #define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ #define BATTERY_CAPACITY_MAX 2500 /* max. capacity selectable */ #define BATTERY_CAPACITY_INC 100 /* capacity increment */ @@ -122,11 +124,6 @@ /* Define this if you have a TI TMS320DM320 */ #define CONFIG_CPU DM320 -/* Define this if you have a Texas Instruments TSC2100 touch screen */ -//#define HAVE_TSC2100 - -#define CONFIG_USBOTG USBOTG_ISP1583 - /* define this if the hardware can be powered off while charging */ #define HAVE_POWEROFF_WHILE_CHARGING @@ -158,12 +155,11 @@ #define BOOTFILE "rockbox." BOOTFILE_EXT #define BOOTDIR "/.rockbox" +#define CONFIG_USBOTG USBOTG_ISP1583 #define HAVE_USBSTACK #define USB_VENDOR_ID 0x041e #define USB_PRODUCT_ID 0x4133 -#define USB_SERIAL - //DEBUGGING! #ifdef BOOTLOADER #define THREAD_EXTRA_CHECKS 1 |