summaryrefslogtreecommitdiff
path: root/firmware/drivers/audio
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/audio')
-rw-r--r--firmware/drivers/audio/as3514.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/firmware/drivers/audio/as3514.c b/firmware/drivers/audio/as3514.c
index 957aba8dbb..9b1359df3d 100644
--- a/firmware/drivers/audio/as3514.c
+++ b/firmware/drivers/audio/as3514.c
@@ -164,9 +164,16 @@ void audiohw_preinit(void)
164#else 164#else
165 /* as3514/as3515 */ 165 /* as3514/as3515 */
166 166
167#if defined(SANSA_E200V2) || defined(SANSA_FUZE)
168 /* Set ADC off, mixer on, DAC on, line out on, line in off, mic off */
169 /* Turn on SUM, DAC */
170 as3514_write(AS3514_AUDIOSET1, AUDIOSET1_DAC_on | AUDIOSET1_LOUT_on |
171 AUDIOSET1_SUM_on);
172#else
167 /* Set ADC off, mixer on, DAC on, line out off, line in off, mic off */ 173 /* Set ADC off, mixer on, DAC on, line out off, line in off, mic off */
168 /* Turn on SUM, DAC */ 174 /* Turn on SUM, DAC */
169 as3514_write(AS3514_AUDIOSET1, AUDIOSET1_DAC_on | AUDIOSET1_SUM_on); 175 as3514_write(AS3514_AUDIOSET1, AUDIOSET1_DAC_on | AUDIOSET1_SUM_on);
176#endif /* SANSA_E200V2 || SANSA_FUZE */
170 177
171 /* Set BIAS on, DITH off, AGC off, IBR_DAC max reduction, LSP_LP on, 178 /* Set BIAS on, DITH off, AGC off, IBR_DAC max reduction, LSP_LP on,
172 IBR_LSP max reduction (50%), taken from c200v2 OF 179 IBR_LSP max reduction (50%), taken from c200v2 OF
@@ -215,6 +222,12 @@ void audiohw_preinit(void)
215 /* Headphone ON, MUTE, Min volume */ 222 /* Headphone ON, MUTE, Min volume */
216 as3514_write(AS3514_HPH_OUT_L, HPH_OUT_L_HP_ON | HPH_OUT_L_HP_MUTE | 0x00); 223 as3514_write(AS3514_HPH_OUT_L, HPH_OUT_L_HP_ON | HPH_OUT_L_HP_MUTE | 0x00);
217 224
225#if defined(SANSA_E200V2) || defined(SANSA_FUZE)
226 /* Line Out Stereo, MUTE, Min volume */
227 as3514_write(AS3514_LINE_OUT_L, LINE_OUT_L_LO_SES_DM_SE_ST |
228 LINE_OUT_L_LO_SES_DM_MUTE | 0x00);
229#endif /* SANSA_E200V2 || SANSA_FUZE */
230
218 /* DAC_Mute_off */ 231 /* DAC_Mute_off */
219 as3514_set(AS3514_DAC_L, DAC_L_DAC_MUTE_off); 232 as3514_set(AS3514_DAC_L, DAC_L_DAC_MUTE_off);
220} 233}
@@ -223,8 +236,14 @@ static void audiohw_mute(bool mute)
223{ 236{
224 if (mute) { 237 if (mute) {
225 as3514_set(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE); 238 as3514_set(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
239#if defined(SANSA_E200V2) || defined(SANSA_FUZE)
240 as3514_set(AS3514_LINE_OUT_L, LINE_OUT_L_LO_SES_DM_MUTE);
241#endif /* SANSA_E200V2 || SANSA_FUZE */
226 } else { 242 } else {
227 as3514_clear(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE); 243 as3514_clear(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
244#if defined(SANSA_E200V2) || defined(SANSA_FUZE)
245 as3514_clear(AS3514_LINE_OUT_L, LINE_OUT_L_LO_SES_DM_MUTE);
246#endif /* SANSA_E200V2 || SANSA_FUZE */
228 } 247 }
229} 248}
230 249
@@ -237,6 +256,12 @@ void audiohw_postinit(void)
237 ascodec_suppressor_on(false); 256 ascodec_suppressor_on(false);
238#endif 257#endif
239 258
259#if defined(SANSA_E200V2) || defined(SANSA_FUZE)
260 /* Set line out volume to 0dB */
261 as3514_write_masked(AS3514_LINE_OUT_R, 0x1b, AS3514_VOL_MASK);
262 as3514_write_masked(AS3514_LINE_OUT_L, 0x1b, AS3514_VOL_MASK);
263#endif /* SANSA_E200V2 || SANSA_FUZE */
264
240 audiohw_mute(false); 265 audiohw_mute(false);
241} 266}
242 267