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)
downloadrockbox-5d63776a24cb3de9f5ddbfbfb13ce03e50264c03.tar.gz
rockbox-5d63776a24cb3de9f5ddbfbfb13ce03e50264c03.zip
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)
99 tlv320_write_reg(REG_DAIF, DAIF_IWL_16 | DAIF_FOR_I2S); 99 tlv320_write_reg(REG_DAIF, DAIF_IWL_16 | DAIF_FOR_I2S);
100 tlv320_write_reg(REG_DIA, DIA_ACT); 100 tlv320_write_reg(REG_DIA, DIA_ACT);
101 audiohw_set_frequency(-1); /* default */ 101 audiohw_set_frequency(-1); /* default */
102}
103
104/**
105 * Switch outputs ON
106 */
107void audiohw_postinit(void)
108{
102 /* All ON except ADC, MIC and LINE */ 109 /* All ON except ADC, MIC and LINE */
110 sleep(HZ);
103 tlv320_write_reg(REG_PC, PC_ADC | PC_MIC | PC_LINE); 111 tlv320_write_reg(REG_PC, PC_ADC | PC_MIC | PC_LINE);
112 sleep(HZ/4);
113 audiohw_mute(false);
104} 114}
105 115
106/** 116/**
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)
270 return 0; 270 return 0;
271} 271}
272 272
273void audiohw_postinit(void)
274{
275 /* Sleep a while so the power can stabilize (especially a long
276 delay is needed for the line out connector). */
277 sleep(HZ);
278 /* Power on FSDAC and HP amp. */
279 audiohw_enable_output(true);
280
281 /* UDA1380: Unmute the master channel
282 (DAC should be at zero point now). */
283 audiohw_mute(false);
284}
285
273/* Nice shutdown of UDA1380 codec */ 286/* Nice shutdown of UDA1380 codec */
274void audiohw_close(void) 287void audiohw_close(void)
275{ 288{