diff options
Diffstat (limited to 'firmware/target/arm/s5l8702/ipod6g/audio-ipod6g.c')
-rw-r--r-- | firmware/target/arm/s5l8702/ipod6g/audio-ipod6g.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/firmware/target/arm/s5l8702/ipod6g/audio-ipod6g.c b/firmware/target/arm/s5l8702/ipod6g/audio-ipod6g.c new file mode 100644 index 0000000000..6ede3d0c30 --- /dev/null +++ b/firmware/target/arm/s5l8702/ipod6g/audio-ipod6g.c | |||
@@ -0,0 +1,65 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id: audio-nano2g.c 23095 2009-10-11 09:17:12Z dave $ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Michael Sevakis | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include "system.h" | ||
22 | #include "cpu.h" | ||
23 | #include "audio.h" | ||
24 | #include "sound.h" | ||
25 | |||
26 | #if INPUT_SRC_CAPS != 0 | ||
27 | void audio_set_output_source(int source) | ||
28 | { | ||
29 | if ((unsigned)source >= AUDIO_NUM_SOURCES) | ||
30 | source = AUDIO_SRC_PLAYBACK; | ||
31 | } /* audio_set_output_source */ | ||
32 | |||
33 | void audio_input_mux(int source, unsigned flags) | ||
34 | { | ||
35 | (void)flags; | ||
36 | /* Prevent pops from unneeded switching */ | ||
37 | static int last_source = AUDIO_SRC_PLAYBACK; | ||
38 | |||
39 | switch (source) | ||
40 | { | ||
41 | default: /* playback - no recording */ | ||
42 | source = AUDIO_SRC_PLAYBACK; | ||
43 | case AUDIO_SRC_PLAYBACK: | ||
44 | #ifdef HAVE_RECORDING | ||
45 | if (source != last_source) | ||
46 | { | ||
47 | audiohw_set_monitor(false); | ||
48 | audiohw_disable_recording(); | ||
49 | } | ||
50 | #endif | ||
51 | break; | ||
52 | #ifdef HAVE_LINE_REC | ||
53 | case AUDIO_SRC_LINEIN: /* recording only */ | ||
54 | if (source != last_source) | ||
55 | { | ||
56 | audiohw_set_monitor(false); | ||
57 | audiohw_enable_recording(false); /* source line */ | ||
58 | } | ||
59 | break; | ||
60 | #endif | ||
61 | } /* end switch */ | ||
62 | |||
63 | last_source = source; | ||
64 | } /* audio_input_mux */ | ||
65 | #endif /* INPUT_SRC_CAPS != 0 */ | ||