From 17947a25671b4fc7e0e8b31c5c4683f21742f7db Mon Sep 17 00:00:00 2001 From: mc2739 Date: Sun, 27 Jun 2010 23:27:54 +0000 Subject: [PATCH] Part of FS#11367 by me: e200v2 enable line out Should also work for Fuzev1, although not tested. Connect dock after booting Rockbox. Connecting dock with power off will boot into OF. TODO: enable/disable line out based on dock connection status, add additional devices (Fuzev2 and c200v2) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27162 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/audio/as3514.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/firmware/drivers/audio/as3514.c b/firmware/drivers/audio/as3514.c index 957aba8db..9b1359df3 100644 --- a/firmware/drivers/audio/as3514.c +++ b/firmware/drivers/audio/as3514.c @@ -164,9 +164,16 @@ void audiohw_preinit(void) #else /* as3514/as3515 */ +#if defined(SANSA_E200V2) || defined(SANSA_FUZE) + /* Set ADC off, mixer on, DAC on, line out on, line in off, mic off */ + /* Turn on SUM, DAC */ + as3514_write(AS3514_AUDIOSET1, AUDIOSET1_DAC_on | AUDIOSET1_LOUT_on | + AUDIOSET1_SUM_on); +#else /* Set ADC off, mixer on, DAC on, line out off, line in off, mic off */ /* Turn on SUM, DAC */ as3514_write(AS3514_AUDIOSET1, AUDIOSET1_DAC_on | AUDIOSET1_SUM_on); +#endif /* SANSA_E200V2 || SANSA_FUZE */ /* Set BIAS on, DITH off, AGC off, IBR_DAC max reduction, LSP_LP on, IBR_LSP max reduction (50%), taken from c200v2 OF @@ -215,6 +222,12 @@ void audiohw_preinit(void) /* Headphone ON, MUTE, Min volume */ as3514_write(AS3514_HPH_OUT_L, HPH_OUT_L_HP_ON | HPH_OUT_L_HP_MUTE | 0x00); +#if defined(SANSA_E200V2) || defined(SANSA_FUZE) + /* Line Out Stereo, MUTE, Min volume */ + as3514_write(AS3514_LINE_OUT_L, LINE_OUT_L_LO_SES_DM_SE_ST | + LINE_OUT_L_LO_SES_DM_MUTE | 0x00); +#endif /* SANSA_E200V2 || SANSA_FUZE */ + /* DAC_Mute_off */ as3514_set(AS3514_DAC_L, DAC_L_DAC_MUTE_off); } @@ -223,8 +236,14 @@ static void audiohw_mute(bool mute) { if (mute) { as3514_set(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE); +#if defined(SANSA_E200V2) || defined(SANSA_FUZE) + as3514_set(AS3514_LINE_OUT_L, LINE_OUT_L_LO_SES_DM_MUTE); +#endif /* SANSA_E200V2 || SANSA_FUZE */ } else { as3514_clear(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE); +#if defined(SANSA_E200V2) || defined(SANSA_FUZE) + as3514_clear(AS3514_LINE_OUT_L, LINE_OUT_L_LO_SES_DM_MUTE); +#endif /* SANSA_E200V2 || SANSA_FUZE */ } } @@ -237,6 +256,12 @@ void audiohw_postinit(void) ascodec_suppressor_on(false); #endif +#if defined(SANSA_E200V2) || defined(SANSA_FUZE) + /* Set line out volume to 0dB */ + as3514_write_masked(AS3514_LINE_OUT_R, 0x1b, AS3514_VOL_MASK); + as3514_write_masked(AS3514_LINE_OUT_L, 0x1b, AS3514_VOL_MASK); +#endif /* SANSA_E200V2 || SANSA_FUZE */ + audiohw_mute(false); } -- 2.11.4.GIT