diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2007-04-15 14:05:58 +0000 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2007-04-15 14:05:58 +0000 |
commit | 8a5ecc8eb4f97dcdb274f96de3364e9e9bf49f60 (patch) | |
tree | be0cd1f6e2f3c49babab1d46fca3af0bd7218ab5 /firmware/drivers | |
parent | 49952325c9d4a74225b3099eb61860bf4592022c (diff) | |
download | rockbox-8a5ecc8eb4f97dcdb274f96de3364e9e9bf49f60.tar.gz rockbox-8a5ecc8eb4f97dcdb274f96de3364e9e9bf49f60.zip |
* save more power, as we dont need the mixer (yet)
* clean up headers and other clean ups
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13166 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/as3514.c | 49 |
1 files changed, 5 insertions, 44 deletions
diff --git a/firmware/drivers/as3514.c b/firmware/drivers/as3514.c index 643351623f..455c2f3320 100644 --- a/firmware/drivers/as3514.c +++ b/firmware/drivers/as3514.c | |||
@@ -19,21 +19,9 @@ | |||
19 | * KIND, either express or implied. | 19 | * KIND, either express or implied. |
20 | * | 20 | * |
21 | ****************************************************************************/ | 21 | ****************************************************************************/ |
22 | #include "lcd.h" | ||
23 | #include "cpu.h" | 22 | #include "cpu.h" |
24 | #include "kernel.h" | ||
25 | #include "thread.h" | ||
26 | #include "power.h" | ||
27 | #include "debug.h" | 23 | #include "debug.h" |
28 | #include "system.h" | 24 | #include "system.h" |
29 | #include "sprintf.h" | ||
30 | #include "button.h" | ||
31 | #include "string.h" | ||
32 | #include "file.h" | ||
33 | #include "buffer.h" | ||
34 | #include "audio.h" | ||
35 | #include "backlight.h" | ||
36 | #include "logf.h" | ||
37 | 25 | ||
38 | #include "as3514.h" | 26 | #include "as3514.h" |
39 | #include "i2s.h" | 27 | #include "i2s.h" |
@@ -74,19 +62,6 @@ int tenthdb2master(int db) | |||
74 | } | 62 | } |
75 | } | 63 | } |
76 | 64 | ||
77 | /* convert tenth of dB volume (-405..60) to mixer volume register value */ | ||
78 | int tenthdb2mixer(int db) | ||
79 | { | ||
80 | /* FIXME: Make this sensible */ | ||
81 | if (db < -405) { | ||
82 | return 0x0; | ||
83 | } else if (db >= 60) { | ||
84 | return 0x1f; | ||
85 | } else { | ||
86 | return((db+405)/15); | ||
87 | } | ||
88 | } | ||
89 | |||
90 | void audiohw_reset(void); | 65 | void audiohw_reset(void); |
91 | 66 | ||
92 | /* | 67 | /* |
@@ -122,10 +97,10 @@ int audiohw_init(void) | |||
122 | i2s_reset(); | 97 | i2s_reset(); |
123 | 98 | ||
124 | /* Set ADC off, mixer on, DAC on, line out off, line in off, mic off */ | 99 | /* Set ADC off, mixer on, DAC on, line out off, line in off, mic off */ |
125 | as3514_write(AUDIOSET1, 0x60); /* Turn on DAC and mixer */ | 100 | as3514_write(AUDIOSET1, 0x20); /* Turn on DAC */ |
126 | as3514_write(AUDIOSET3, 0x5); /* Set HPCM off, ZCU off*/ | 101 | as3514_write(AUDIOSET3, 0x5); /* Set HPCM off, ZCU off*/ |
127 | as3514_write(HPH_OUT_R, 0xc0 | 0x16); /* set vol and set speaker over-current to 0 */ | 102 | as3514_write(HPH_OUT_R, 0xc0 | 0x16); /* set vol and set speaker over-current to 0 */ |
128 | as3514_write(HPH_OUT_L, 0x40 | 0x16); /* set default vol for headphone */ | 103 | as3514_write(HPH_OUT_L, 0x16); /* set default vol for headphone */ |
129 | as3514_write(PLLMODE, 0x04); | 104 | as3514_write(PLLMODE, 0x04); |
130 | 105 | ||
131 | /* read all reg values */ | 106 | /* read all reg values */ |
@@ -144,9 +119,7 @@ void audiohw_postinit(void) | |||
144 | /* Silently enable / disable audio output */ | 119 | /* Silently enable / disable audio output */ |
145 | void audiohw_enable_output(bool enable) | 120 | void audiohw_enable_output(bool enable) |
146 | { | 121 | { |
147 | |||
148 | int curr; | 122 | int curr; |
149 | |||
150 | curr = as3514_regs[HPH_OUT_L]; | 123 | curr = as3514_regs[HPH_OUT_L]; |
151 | 124 | ||
152 | if (enable) | 125 | if (enable) |
@@ -154,11 +127,11 @@ void audiohw_enable_output(bool enable) | |||
154 | /* reset the I2S controller into known state */ | 127 | /* reset the I2S controller into known state */ |
155 | i2s_reset(); | 128 | i2s_reset(); |
156 | 129 | ||
157 | as3514_write(HPH_OUT_L, curr | 0xc0); /* Mute off, power on */ | 130 | as3514_write(HPH_OUT_L, curr | 0x40); /* power on */ |
158 | audiohw_mute(0); | 131 | audiohw_mute(0); |
159 | } else { | 132 | } else { |
160 | audiohw_mute(1); | 133 | audiohw_mute(1); |
161 | as3514_write(HPH_OUT_L, curr | 0x80); /* Mute on, power off */ | 134 | as3514_write(HPH_OUT_L, curr & ~(0x40)); /* power off */ |
162 | } | 135 | } |
163 | } | 136 | } |
164 | 137 | ||
@@ -186,19 +159,11 @@ int audiohw_set_lineout_vol(int vol_l, int vol_r) | |||
186 | return 0; | 159 | return 0; |
187 | } | 160 | } |
188 | 161 | ||
189 | int audiohw_set_mixer_vol(int channel1, int channel2) | ||
190 | { | ||
191 | (void)channel1; | ||
192 | (void)channel2; | ||
193 | |||
194 | return 0; | ||
195 | } | ||
196 | |||
197 | int audiohw_mute(int mute) | 162 | int audiohw_mute(int mute) |
198 | { | 163 | { |
199 | int curr; | 164 | int curr; |
200 | |||
201 | curr = as3514_regs[HPH_OUT_L]; | 165 | curr = as3514_regs[HPH_OUT_L]; |
166 | |||
202 | if (mute) | 167 | if (mute) |
203 | { | 168 | { |
204 | as3514_write(HPH_OUT_L, curr | 0x80); | 169 | as3514_write(HPH_OUT_L, curr | 0x80); |
@@ -215,9 +180,6 @@ void audiohw_close(void) | |||
215 | /* mute headphones */ | 180 | /* mute headphones */ |
216 | audiohw_mute(1); | 181 | audiohw_mute(1); |
217 | 182 | ||
218 | /* mute mixer */ | ||
219 | as3514_write(AUDIOSET1, 0x0); | ||
220 | |||
221 | /* turn off everything */ | 183 | /* turn off everything */ |
222 | as3514_write(AUDIOSET1, 0x0); | 184 | as3514_write(AUDIOSET1, 0x0); |
223 | } | 185 | } |
@@ -234,7 +196,6 @@ void audiohw_enable_recording(bool source_mic) | |||
234 | 196 | ||
235 | void audiohw_disable_recording(void) | 197 | void audiohw_disable_recording(void) |
236 | { | 198 | { |
237 | int curr; | ||
238 | } | 199 | } |
239 | 200 | ||
240 | void audiohw_set_recvol(int left, int right, int type) | 201 | void audiohw_set_recvol(int left, int right, int type) |