diff options
-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 6a22ab1c74..d4c21bd5c2 100644 --- a/firmware/drivers/audio/tlv320.c +++ b/firmware/drivers/audio/tlv320.c | |||
@@ -16,13 +16,16 @@ | |||
16 | * KIND, either express or implied. | 16 | * KIND, either express or implied. |
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | #include "config.h" | ||
19 | #include "logf.h" | 20 | #include "logf.h" |
20 | #include "system.h" | 21 | #include "system.h" |
21 | #include "string.h" | 22 | #include "string.h" |
22 | #include "audio.h" | 23 | #include "audio.h" |
23 | 24 | ||
24 | #ifdef CPU_COLDFIRE | 25 | #if CONFIG_I2C == I2C_COLDFIRE |
25 | #include "i2c-coldfire.h" | 26 | #include "i2c-coldfire.h" |
27 | #elif CONFIG_I2C == I2C_DM320 | ||
28 | #include "i2c-dm320.h" | ||
26 | #endif | 29 | #endif |
27 | #include "audiohw.h" | 30 | #include "audiohw.h" |
28 | 31 | ||
@@ -45,7 +48,7 @@ int tenthdb2master(int db) | |||
45 | /* +6 to -73dB 1dB steps (plus mute == 80levels) 7bits */ | 48 | /* +6 to -73dB 1dB steps (plus mute == 80levels) 7bits */ |
46 | /* 1111111 == +6dB (0x7f) */ | 49 | /* 1111111 == +6dB (0x7f) */ |
47 | /* 1111001 == 0dB (0x79) */ | 50 | /* 1111001 == 0dB (0x79) */ |
48 | /* 0110000 == -73dB (0x30 */ | 51 | /* 0110000 == -73dB (0x30) */ |
49 | /* 0101111 == mute (0x2f) */ | 52 | /* 0101111 == mute (0x2f) */ |
50 | 53 | ||
51 | if (db < VOLUME_MIN) { | 54 | if (db < VOLUME_MIN) { |
@@ -56,7 +59,11 @@ int tenthdb2master(int db) | |||
56 | } | 59 | } |
57 | 60 | ||
58 | /* local functions and definations */ | 61 | /* local functions and definations */ |
62 | #ifndef CREATIVE_ZVM | ||
59 | #define TLV320_ADDR 0x34 | 63 | #define TLV320_ADDR 0x34 |
64 | #else | ||
65 | #define TLV320_ADDR 0x1A | ||
66 | #endif | ||
60 | 67 | ||
61 | struct tlv320_info | 68 | struct tlv320_info |
62 | { | 69 | { |
@@ -75,8 +82,10 @@ static void tlv320_write_reg(unsigned reg, unsigned value) | |||
75 | data[0] = (reg << 1) | ((value >> 8) & 1); | 82 | data[0] = (reg << 1) | ((value >> 8) & 1); |
76 | data[1] = value; | 83 | data[1] = value; |
77 | 84 | ||
78 | #ifdef CPU_COLDFIRE | 85 | #if CONFIG_I2C == I2C_COLDFIRE |
79 | if (i2c_write(I2C_IFACE_0, TLV320_ADDR, data, 2) != 2) | 86 | if (i2c_write(I2C_IFACE_0, TLV320_ADDR, data, 2) != 2) |
87 | #elif CONFIG_I2C == I2C_DM320 | ||
88 | if (i2c_write(TLV320_ADDR, data, 2) != 0) | ||
80 | #else | 89 | #else |
81 | #warning Implement tlv320_write_reg() | 90 | #warning Implement tlv320_write_reg() |
82 | #endif | 91 | #endif |
@@ -95,6 +104,7 @@ static void tlv320_write_reg(unsigned reg, unsigned value) | |||
95 | */ | 104 | */ |
96 | void audiohw_init(void) | 105 | void audiohw_init(void) |
97 | { | 106 | { |
107 | logf("TLV320 init"); | ||
98 | memset(tlv320_regs, 0, sizeof(tlv320_regs)); | 108 | memset(tlv320_regs, 0, sizeof(tlv320_regs)); |
99 | 109 | ||
100 | /* Initialize all registers */ | 110 | /* Initialize all registers */ |
@@ -106,7 +116,11 @@ void audiohw_init(void) | |||
106 | audiohw_mute(true); | 116 | audiohw_mute(true); |
107 | tlv320_write_reg(REG_AAP, AAP_DAC | AAP_MICM); | 117 | tlv320_write_reg(REG_AAP, AAP_DAC | AAP_MICM); |
108 | tlv320_write_reg(REG_DAP, 0x00); /* No deemphasis */ | 118 | tlv320_write_reg(REG_DAP, 0x00); /* No deemphasis */ |
119 | #ifndef CREATIVE_ZVM | ||
109 | tlv320_write_reg(REG_DAIF, DAIF_IWL_16 | DAIF_FOR_I2S); | 120 | tlv320_write_reg(REG_DAIF, DAIF_IWL_16 | DAIF_FOR_I2S); |
121 | #else | ||
122 | tlv320_write_reg(REG_DAIF, DAIF_IWL_16 | DAIF_FOR_DSP); | ||
123 | #endif | ||
110 | tlv320_write_reg(REG_DIA, DIA_ACT); | 124 | tlv320_write_reg(REG_DIA, DIA_ACT); |
111 | audiohw_set_frequency(-1); /* default */ | 125 | audiohw_set_frequency(-1); /* default */ |
112 | } | 126 | } |
diff --git a/firmware/export/config-creativezvm.h b/firmware/export/config-creativezvm.h index 509bbc97a1..b0fdbb6a99 100644 --- a/firmware/export/config-creativezvm.h +++ b/firmware/export/config-creativezvm.h | |||
@@ -48,7 +48,7 @@ | |||
48 | #define HAVE_TAGCACHE | 48 | #define HAVE_TAGCACHE |
49 | 49 | ||
50 | /* define this if the target has volume keys which can be used in the lists */ | 50 | /* define this if the target has volume keys which can be used in the lists */ |
51 | #define HAVE_VOLUME_IN_LIST | 51 | //#define HAVE_VOLUME_IN_LIST |
52 | 52 | ||
53 | /* LCD dimensions */ | 53 | /* LCD dimensions */ |
54 | #define CONFIG_LCD LCD_CREATIVEZVM | 54 | #define CONFIG_LCD LCD_CREATIVEZVM |
@@ -99,8 +99,10 @@ | |||
99 | /* The number of bytes reserved for loadable plugins */ | 99 | /* The number of bytes reserved for loadable plugins */ |
100 | #define PLUGIN_BUFFER_SIZE 0x100000 | 100 | #define PLUGIN_BUFFER_SIZE 0x100000 |
101 | 101 | ||
102 | /* Define this if you have the TLV320 audio codec */ | 102 | /* Define this if you have the TLV320 audio codec -> controlled by the DSP */ |
103 | //#define HAVE_TLV320 | 103 | #define HAVE_TLV320 |
104 | |||
105 | #define CONFIG_I2C I2C_DM320 | ||
104 | 106 | ||
105 | /* TLV320 has no tone controls, so we use the software ones */ | 107 | /* TLV320 has no tone controls, so we use the software ones */ |
106 | //#define HAVE_SW_TONE_CONTROLS | 108 | //#define HAVE_SW_TONE_CONTROLS |
@@ -108,7 +110,7 @@ | |||
108 | /*#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | \ | 110 | /*#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | \ |
109 | SAMPR_CAP_11)*/ | 111 | SAMPR_CAP_11)*/ |
110 | 112 | ||
111 | #define BATTERY_CAPACITY_DEFAULT 1100 /* default battery capacity */ | 113 | #define BATTERY_CAPACITY_DEFAULT 1250 /* default battery capacity */ |
112 | #define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ | 114 | #define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ |
113 | #define BATTERY_CAPACITY_MAX 2500 /* max. capacity selectable */ | 115 | #define BATTERY_CAPACITY_MAX 2500 /* max. capacity selectable */ |
114 | #define BATTERY_CAPACITY_INC 100 /* capacity increment */ | 116 | #define BATTERY_CAPACITY_INC 100 /* capacity increment */ |
@@ -122,11 +124,6 @@ | |||
122 | /* Define this if you have a TI TMS320DM320 */ | 124 | /* Define this if you have a TI TMS320DM320 */ |
123 | #define CONFIG_CPU DM320 | 125 | #define CONFIG_CPU DM320 |
124 | 126 | ||
125 | /* Define this if you have a Texas Instruments TSC2100 touch screen */ | ||
126 | //#define HAVE_TSC2100 | ||
127 | |||
128 | #define CONFIG_USBOTG USBOTG_ISP1583 | ||
129 | |||
130 | /* define this if the hardware can be powered off while charging */ | 127 | /* define this if the hardware can be powered off while charging */ |
131 | #define HAVE_POWEROFF_WHILE_CHARGING | 128 | #define HAVE_POWEROFF_WHILE_CHARGING |
132 | 129 | ||
@@ -158,12 +155,11 @@ | |||
158 | #define BOOTFILE "rockbox." BOOTFILE_EXT | 155 | #define BOOTFILE "rockbox." BOOTFILE_EXT |
159 | #define BOOTDIR "/.rockbox" | 156 | #define BOOTDIR "/.rockbox" |
160 | 157 | ||
158 | #define CONFIG_USBOTG USBOTG_ISP1583 | ||
161 | #define HAVE_USBSTACK | 159 | #define HAVE_USBSTACK |
162 | #define USB_VENDOR_ID 0x041e | 160 | #define USB_VENDOR_ID 0x041e |
163 | #define USB_PRODUCT_ID 0x4133 | 161 | #define USB_PRODUCT_ID 0x4133 |
164 | 162 | ||
165 | #define USB_SERIAL | ||
166 | |||
167 | //DEBUGGING! | 163 | //DEBUGGING! |
168 | #ifdef BOOTLOADER | 164 | #ifdef BOOTLOADER |
169 | #define THREAD_EXTRA_CHECKS 1 | 165 | #define THREAD_EXTRA_CHECKS 1 |