summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2007-04-15 14:05:58 +0000
committerChristian Gmeiner <christian.gmeiner@gmail.com>2007-04-15 14:05:58 +0000
commit8a5ecc8eb4f97dcdb274f96de3364e9e9bf49f60 (patch)
treebe0cd1f6e2f3c49babab1d46fca3af0bd7218ab5 /firmware
parent49952325c9d4a74225b3099eb61860bf4592022c (diff)
downloadrockbox-8a5ecc8eb4f97dcdb274f96de3364e9e9bf49f60.tar.gz
rockbox-8a5ecc8eb4f97dcdb274f96de3364e9e9bf49f60.tar.bz2
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')
-rw-r--r--firmware/drivers/as3514.c49
-rw-r--r--firmware/export/as3514.h2
2 files changed, 5 insertions, 46 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 @@
* KIND, either express or implied.
*
****************************************************************************/
-#include "lcd.h"
#include "cpu.h"
-#include "kernel.h"
-#include "thread.h"
-#include "power.h"
#include "debug.h"
#include "system.h"
-#include "sprintf.h"
-#include "button.h"
-#include "string.h"
-#include "file.h"
-#include "buffer.h"
-#include "audio.h"
-#include "backlight.h"
-#include "logf.h"
#include "as3514.h"
#include "i2s.h"
@@ -74,19 +62,6 @@ int tenthdb2master(int db)
}
}
-/* convert tenth of dB volume (-405..60) to mixer volume register value */
-int tenthdb2mixer(int db)
-{
- /* FIXME: Make this sensible */
- if (db < -405) {
- return 0x0;
- } else if (db >= 60) {
- return 0x1f;
- } else {
- return((db+405)/15);
- }
-}
-
void audiohw_reset(void);
/*
@@ -122,10 +97,10 @@ int audiohw_init(void)
i2s_reset();
/* Set ADC off, mixer on, DAC on, line out off, line in off, mic off */
- as3514_write(AUDIOSET1, 0x60); /* Turn on DAC and mixer */
+ as3514_write(AUDIOSET1, 0x20); /* Turn on DAC */
as3514_write(AUDIOSET3, 0x5); /* Set HPCM off, ZCU off*/
as3514_write(HPH_OUT_R, 0xc0 | 0x16); /* set vol and set speaker over-current to 0 */
- as3514_write(HPH_OUT_L, 0x40 | 0x16); /* set default vol for headphone */
+ as3514_write(HPH_OUT_L, 0x16); /* set default vol for headphone */
as3514_write(PLLMODE, 0x04);
/* read all reg values */
@@ -144,9 +119,7 @@ void audiohw_postinit(void)
/* Silently enable / disable audio output */
void audiohw_enable_output(bool enable)
{
-
int curr;
-
curr = as3514_regs[HPH_OUT_L];
if (enable)
@@ -154,11 +127,11 @@ void audiohw_enable_output(bool enable)
/* reset the I2S controller into known state */
i2s_reset();
- as3514_write(HPH_OUT_L, curr | 0xc0); /* Mute off, power on */
+ as3514_write(HPH_OUT_L, curr | 0x40); /* power on */
audiohw_mute(0);
} else {
audiohw_mute(1);
- as3514_write(HPH_OUT_L, curr | 0x80); /* Mute on, power off */
+ as3514_write(HPH_OUT_L, curr & ~(0x40)); /* power off */
}
}
@@ -186,19 +159,11 @@ int audiohw_set_lineout_vol(int vol_l, int vol_r)
return 0;
}
-int audiohw_set_mixer_vol(int channel1, int channel2)
-{
- (void)channel1;
- (void)channel2;
-
- return 0;
-}
-
int audiohw_mute(int mute)
{
int curr;
-
curr = as3514_regs[HPH_OUT_L];
+
if (mute)
{
as3514_write(HPH_OUT_L, curr | 0x80);
@@ -215,9 +180,6 @@ void audiohw_close(void)
/* mute headphones */
audiohw_mute(1);
- /* mute mixer */
- as3514_write(AUDIOSET1, 0x0);
-
/* turn off everything */
as3514_write(AUDIOSET1, 0x0);
}
@@ -234,7 +196,6 @@ void audiohw_enable_recording(bool source_mic)
void audiohw_disable_recording(void)
{
- int curr;
}
void audiohw_set_recvol(int left, int right, int type)
diff --git a/firmware/export/as3514.h b/firmware/export/as3514.h
index 260dbe096e..14208bc414 100644
--- a/firmware/export/as3514.h
+++ b/firmware/export/as3514.h
@@ -23,14 +23,12 @@
#include <stdbool.h>
extern int tenthdb2master(int db);
-extern int tenthdb2mixer(int db);
extern void audiohw_reset(void);
extern int audiohw_init(void);
extern void audiohw_enable_output(bool enable);
extern int audiohw_set_master_vol(int vol_l, int vol_r);
extern int audiohw_set_lineout_vol(int vol_l, int vol_r);
-extern int audiohw_set_mixer_vol(int channel1, int channel2);
extern int audiohw_mute(int mute);
extern void audiohw_close(void);
extern void audiohw_set_sample_rate(int sampling_control);