diff options
Diffstat (limited to 'firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c')
-rw-r--r-- | firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c b/firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c new file mode 100644 index 0000000000..faf15242ab --- /dev/null +++ b/firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c | |||
@@ -0,0 +1,61 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2012 by Amaury Pouly | ||
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 "config.h" | ||
22 | #include "system.h" | ||
23 | #include "audiohw.h" | ||
24 | #include "audio.h" | ||
25 | #include "audioout-imx233.h" | ||
26 | #include "audioin-imx233.h" | ||
27 | #include "pinctrl-imx233.h" | ||
28 | |||
29 | static int input_source = AUDIO_SRC_PLAYBACK; | ||
30 | static unsigned input_flags = 0; | ||
31 | static int output_source = AUDIO_SRC_PLAYBACK; | ||
32 | |||
33 | static void select_audio_path(void) | ||
34 | { | ||
35 | /* route audio to HP */ | ||
36 | imx233_set_pin_function(1, 30, PINCTRL_FUNCTION_GPIO); | ||
37 | imx233_enable_gpio_output(1, 30, true); | ||
38 | imx233_set_gpio_output(1, 30, true); | ||
39 | |||
40 | if(input_source == AUDIO_SRC_PLAYBACK) | ||
41 | imx233_audioout_select_hp_input(false); | ||
42 | else | ||
43 | imx233_audioout_select_hp_input(true); | ||
44 | } | ||
45 | |||
46 | void audio_input_mux(int source, unsigned flags) | ||
47 | { | ||
48 | (void) source; | ||
49 | (void) flags; | ||
50 | input_source = source; | ||
51 | input_flags = flags; | ||
52 | select_audio_path(); | ||
53 | } | ||
54 | |||
55 | void audio_set_output_source(int source) | ||
56 | { | ||
57 | (void) source; | ||
58 | output_source = source; | ||
59 | select_audio_path(); | ||
60 | } | ||
61 | |||