summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-03-11 05:04:48 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-03-11 05:04:48 +0000
commit5d63776a24cb3de9f5ddbfbfb13ce03e50264c03 (patch)
tree9f8665f020b326e9ffc24799579240a044e35d3c /firmware/drivers
parenta1a4034b82630bc94bfd37dac4e1c3f30afaccd5 (diff)
Reenable aynchronous audio init stage. Really just single stage with aynchronous enabling of outputs. Keeps audio_init last so prior init steps can use the audiobuffer in any desired way. Audio will be fully initialized by the time the UI is entered. Playback of voice or audio will be delayed properly until audio hardware is ready.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12714 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/tlv320.c10
-rw-r--r--firmware/drivers/uda1380.c13
2 files changed, 23 insertions, 0 deletions
diff --git a/firmware/drivers/tlv320.c b/firmware/drivers/tlv320.c
index a88eae5f26..c0f28d31d9 100644
--- a/firmware/drivers/tlv320.c
+++ b/firmware/drivers/tlv320.c
@@ -99,8 +99,18 @@ void audiohw_init(void)
tlv320_write_reg(REG_DAIF, DAIF_IWL_16 | DAIF_FOR_I2S);
tlv320_write_reg(REG_DIA, DIA_ACT);
audiohw_set_frequency(-1); /* default */
+}
+
+/**
+ * Switch outputs ON
+ */
+void audiohw_postinit(void)
+{
/* All ON except ADC, MIC and LINE */
+ sleep(HZ);
tlv320_write_reg(REG_PC, PC_ADC | PC_MIC | PC_LINE);
+ sleep(HZ/4);
+ audiohw_mute(false);
}
/**
diff --git a/firmware/drivers/uda1380.c b/firmware/drivers/uda1380.c
index 00019148c1..6984427fc9 100644
--- a/firmware/drivers/uda1380.c
+++ b/firmware/drivers/uda1380.c
@@ -270,6 +270,19 @@ int audiohw_init(void)
return 0;
}
+void audiohw_postinit(void)
+{
+ /* Sleep a while so the power can stabilize (especially a long
+ delay is needed for the line out connector). */
+ sleep(HZ);
+ /* Power on FSDAC and HP amp. */
+ audiohw_enable_output(true);
+
+ /* UDA1380: Unmute the master channel
+ (DAC should be at zero point now). */
+ audiohw_mute(false);
+}
+
/* Nice shutdown of UDA1380 codec */
void audiohw_close(void)
{