diff options
Diffstat (limited to 'firmware/target/arm/imx233')
-rw-r--r-- | firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c b/firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c index faf15242ab..9394c88f2c 100644 --- a/firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c +++ b/firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c | |||
@@ -29,12 +29,29 @@ | |||
29 | static int input_source = AUDIO_SRC_PLAYBACK; | 29 | static int input_source = AUDIO_SRC_PLAYBACK; |
30 | static unsigned input_flags = 0; | 30 | static unsigned input_flags = 0; |
31 | static int output_source = AUDIO_SRC_PLAYBACK; | 31 | static int output_source = AUDIO_SRC_PLAYBACK; |
32 | static bool initialized = false; | ||
32 | 33 | ||
33 | static void select_audio_path(void) | 34 | static void init(void) |
34 | { | 35 | { |
35 | /* route audio to HP */ | 36 | /* HP gate */ |
37 | imx233_pinctrl_acquire_pin(1, 30, "hp gate"); | ||
36 | imx233_set_pin_function(1, 30, PINCTRL_FUNCTION_GPIO); | 38 | imx233_set_pin_function(1, 30, PINCTRL_FUNCTION_GPIO); |
37 | imx233_enable_gpio_output(1, 30, true); | 39 | imx233_enable_gpio_output(1, 30, true); |
40 | imx233_set_gpio_output(1, 30, false); | ||
41 | /* SPKR gate */ | ||
42 | imx233_pinctrl_acquire_pin(1, 22, "spkr gate"); | ||
43 | imx233_set_pin_function(1, 22, PINCTRL_FUNCTION_GPIO); | ||
44 | imx233_enable_gpio_output(1, 22, true); | ||
45 | imx233_set_gpio_output(1, 22, false); | ||
46 | |||
47 | initialized = true; | ||
48 | } | ||
49 | |||
50 | static void select_audio_path(void) | ||
51 | { | ||
52 | if(!initialized) | ||
53 | init(); | ||
54 | /* route audio to HP */ | ||
38 | imx233_set_gpio_output(1, 30, true); | 55 | imx233_set_gpio_output(1, 30, true); |
39 | 56 | ||
40 | if(input_source == AUDIO_SRC_PLAYBACK) | 57 | if(input_source == AUDIO_SRC_PLAYBACK) |