From 9b395741f32c935636bdda6175d05beaf825549f Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Tue, 22 May 2012 22:59:46 +0200 Subject: [PATCH] zenxfi3: acquire audio gate pins Change-Id: I47775568b3ee7383e440e2999b0acd98f0d5c57a --- .../imx233/creative-zenxfi3/audio-zenxfi3.c | 21 +++++++++++++++++-- 1 file 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 @@ static int input_source = AUDIO_SRC_PLAYBACK; static unsigned input_flags = 0; static int output_source = AUDIO_SRC_PLAYBACK; +static bool initialized = false; + +static void init(void) +{ + /* HP gate */ + imx233_pinctrl_acquire_pin(1, 30, "hp gate"); + imx233_set_pin_function(1, 30, PINCTRL_FUNCTION_GPIO); + imx233_enable_gpio_output(1, 30, true); + imx233_set_gpio_output(1, 30, false); + /* SPKR gate */ + imx233_pinctrl_acquire_pin(1, 22, "spkr gate"); + imx233_set_pin_function(1, 22, PINCTRL_FUNCTION_GPIO); + imx233_enable_gpio_output(1, 22, true); + imx233_set_gpio_output(1, 22, false); + + initialized = true; +} static void select_audio_path(void) { + if(!initialized) + init(); /* route audio to HP */ - imx233_set_pin_function(1, 30, PINCTRL_FUNCTION_GPIO); - imx233_enable_gpio_output(1, 30, true); imx233_set_gpio_output(1, 30, true); if(input_source == AUDIO_SRC_PLAYBACK)