summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/creative-zenxfi3
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-05-22 22:59:46 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2012-05-22 23:01:03 +0200
commit9b395741f32c935636bdda6175d05beaf825549f (patch)
treefa71834331ae1e7734281985e571e1f2a8ee3bc6 /firmware/target/arm/imx233/creative-zenxfi3
parent3166ca80ef602116272b884c4625956011b8f6bd (diff)
downloadrockbox-9b395741f32c935636bdda6175d05beaf825549f.tar.gz
rockbox-9b395741f32c935636bdda6175d05beaf825549f.tar.bz2
rockbox-9b395741f32c935636bdda6175d05beaf825549f.zip
zenxfi3: acquire audio gate pins
Change-Id: I47775568b3ee7383e440e2999b0acd98f0d5c57a
Diffstat (limited to 'firmware/target/arm/imx233/creative-zenxfi3')
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c21
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 @@
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 select_audio_path(void)
+static void init(void)
{
- /* route audio to HP */
+ /* 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_gpio_output(1, 30, true);
if(input_source == AUDIO_SRC_PLAYBACK)