summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2005-06-14 07:54:09 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2005-06-14 07:54:09 +0000
commit6ab53ba458164921361cf6579069b4ebb691f6a7 (patch)
tree3aeb47de1152af904f18bcd24a7ef43de7f53c41 /firmware/drivers
parent37f59a0f6f824d1b92a0d7893982660cb0cf1f6f (diff)
Even more quiet audio initialization.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6705 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/uda1380.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/firmware/drivers/uda1380.c b/firmware/drivers/uda1380.c
index 67479fd92e..4b63ccd744 100644
--- a/firmware/drivers/uda1380.c
+++ b/firmware/drivers/uda1380.c
@@ -128,20 +128,27 @@ int uda1380_set_regs(void)
return 0;
}
+/* Silently enable / disable audio output */
+void uda1380_enable_output(bool enable)
+{
+ if (enable) {
+ uda1380_write_reg(REG_PWR, uda1380_regs[REG_PWR] | PON_HP);
+
+ /* Sleep a while, then disable the master mute */
+ sleep(HZ/8);
+ uda1380_write_reg(REG_MUTE, MUTE_CH2);
+ } else {
+ uda1380_write_reg(REG_MUTE, MUTE_MASTER);
+ uda1380_write_reg(REG_PWR, uda1380_regs[REG_PWR] & ~PON_HP);
+ }
+}
+
/* Initialize UDA1380 codec with default register values (uda1380_defaults) */
int uda1380_init(void)
{
if (uda1380_set_regs() == -1)
return -1;
- /* Sleep a while, then power on headphone amp */
- sleep(HZ/8);
- uda1380_write_reg(REG_PWR, uda1380_regs[REG_PWR] | PON_HP);
-
- /* Sleep a little more, then disable the master mute */
- sleep(HZ/8);
- uda1380_write_reg(REG_MUTE, MUTE_CH2);
-
return 0;
}