summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-06-18 16:19:28 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-06-18 16:19:28 +0200
commitea8b22a9b67b6db6ae6975d995999f9322071ead (patch)
treef9c74752c408f481462f4a1cef80a626023543c0
parent11c907a83c9081d587b27db32fafafe912812563 (diff)
downloadrockbox-ea8b22a9b67b6db6ae6975d995999f9322071ead.tar.gz
rockbox-ea8b22a9b67b6db6ae6975d995999f9322071ead.zip
zenxfi3: drop audio routing driver in favor of the generic one
Change-Id: Ia104c148f9139434d2c70190d2834b06de20de23
-rw-r--r--firmware/SOURCES3
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi3/audio-target.h30
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c78
3 files changed, 30 insertions, 81 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 9cc75ee60e..92a7a29a19 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -1169,9 +1169,6 @@ target/arm/imx233/creative-zenxfi3/debug-zenxfi3.c
1169target/arm/imx233/creative-zenxfi3/power-zenxfi3.c 1169target/arm/imx233/creative-zenxfi3/power-zenxfi3.c
1170target/arm/imx233/creative-zenxfi3/adc-zenxfi3.c 1170target/arm/imx233/creative-zenxfi3/adc-zenxfi3.c
1171target/arm/imx233/creative-zenxfi3/powermgmt-zenxfi3.c 1171target/arm/imx233/creative-zenxfi3/powermgmt-zenxfi3.c
1172#ifndef BOOTLOADER
1173target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c
1174#endif
1175#endif 1172#endif
1176 1173
1177#ifdef SANSA_CONNECT 1174#ifdef SANSA_CONNECT
diff --git a/firmware/target/arm/imx233/creative-zenxfi3/audio-target.h b/firmware/target/arm/imx233/creative-zenxfi3/audio-target.h
new file mode 100644
index 0000000000..0b4610cd1a
--- /dev/null
+++ b/firmware/target/arm/imx233/creative-zenxfi3/audio-target.h
@@ -0,0 +1,30 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2013 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#ifndef __audio_target__
22#define __audio_target__
23
24#define IMX233_AUDIO_HP_GATE_BANK 1
25#define IMX233_AUDIO_HP_GATE_PIN 30
26
27#define IMX233_AUDIO_SPKR_GATE_BANK 1
28#define IMX233_AUDIO_SPKR_GATE_PIN 22
29
30#endif /* __audio_target__ */
diff --git a/firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c b/firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c
deleted file mode 100644
index 3ea757aedb..0000000000
--- a/firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c
+++ /dev/null
@@ -1,78 +0,0 @@
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
29static int input_source = AUDIO_SRC_PLAYBACK;
30static unsigned input_flags = 0;
31static int output_source = AUDIO_SRC_PLAYBACK;
32static bool initialized = false;
33
34static void init(void)
35{
36 /* HP gate */
37 imx233_pinctrl_acquire(1, 30, "hp gate");
38 imx233_pinctrl_set_function(1, 30, PINCTRL_FUNCTION_GPIO);
39 imx233_pinctrl_enable_gpio(1, 30, true);
40 imx233_pinctrl_set_gpio(1, 30, false);
41 /* SPKR gate */
42 imx233_pinctrl_acquire(1, 22, "spkr gate");
43 imx233_pinctrl_set_function(1, 22, PINCTRL_FUNCTION_GPIO);
44 imx233_pinctrl_enable_gpio(1, 22, true);
45 imx233_pinctrl_set_gpio(1, 22, false);
46
47 initialized = true;
48}
49
50static void select_audio_path(void)
51{
52 if(!initialized)
53 init();
54 /* route audio to HP */
55 imx233_pinctrl_set_gpio(1, 30, true);
56
57 if(input_source == AUDIO_SRC_PLAYBACK)
58 imx233_audioout_select_hp_input(false);
59 else
60 imx233_audioout_select_hp_input(true);
61}
62
63void audio_input_mux(int source, unsigned flags)
64{
65 (void) source;
66 (void) flags;
67 input_source = source;
68 input_flags = flags;
69 select_audio_path();
70}
71
72void audio_set_output_source(int source)
73{
74 (void) source;
75 output_source = source;
76 select_audio_path();
77}
78