summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorLorenzo Miori <memorys60@gmail.com>2013-11-25 18:59:57 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2013-11-25 20:17:12 +0100
commit75c791dabff8e48be18cec8915f79626ae2d0073 (patch)
treee97199db4f922260b7b778ce0f5fdfa135544dc9 /firmware/target/arm
parent85578cdc4d441c7197c69ab68dfe7c293331e6c8 (diff)
downloadrockbox-75c791dabff8e48be18cec8915f79626ae2d0073.tar.gz
rockbox-75c791dabff8e48be18cec8915f79626ae2d0073.tar.bz2
rockbox-75c791dabff8e48be18cec8915f79626ae2d0073.zip
imx233: add the possibility to choose audio output coupling mode
via target-defined option Change-Id: I1bffbc7f17a11cf690a771057c2e4a7ba6a5faaa Reviewed-on: http://gerrit.rockbox.org/678 Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/imx233/audioout-imx233.c13
-rw-r--r--firmware/target/arm/imx233/audioout-imx233.h8
-rw-r--r--firmware/target/arm/imx233/creative-zen/audio-target.h2
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi2/audio-target.h2
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi3/audio-target.h2
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/audio-target.h2
-rw-r--r--firmware/target/arm/imx233/sony-nwz/audio-target.h2
7 files changed, 31 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/audioout-imx233.c b/firmware/target/arm/imx233/audioout-imx233.c
index b27f7b37e2..26a480d05c 100644
--- a/firmware/target/arm/imx233/audioout-imx233.c
+++ b/firmware/target/arm/imx233/audioout-imx233.c
@@ -23,6 +23,15 @@
#include "rtc-imx233.h"
#include "pcm_sampr.h"
#include "string.h"
+#include "audio-target.h"
+
+#ifndef IMX233_AUDIO_COUPLING_MODE
+#error You must define IMX233_AUDIO_COUPLING_MODE
+#endif
+
+#if IMX233_AUDIO_COUPLING_MODE != ACM_CAP && IMX233_AUDIO_COUPLING_MODE != ACM_CAPLESS
+#error Invalid value for IMX233_AUDIO_COUPLING_MODE
+#endif
static int hp_vol_l, hp_vol_r;
static bool input_line1;
@@ -46,7 +55,11 @@ void imx233_audioout_preinit(void)
/* Enable DAC */
BF_CLR(AUDIOOUT_ANACLKCTRL, CLKGATE);
/* Set capless mode */
+#if IMX233_AUDIO_COUPLING_MODE == ACM_CAP
+ BF_SET(AUDIOOUT_PWRDN, CAPLESS);
+#else
BF_CLR(AUDIOOUT_PWRDN, CAPLESS);
+#endif
/* Set word-length to 16-bit */
BF_SET(AUDIOOUT_CTRL, WORD_LENGTH);
/* Power up DAC */
diff --git a/firmware/target/arm/imx233/audioout-imx233.h b/firmware/target/arm/imx233/audioout-imx233.h
index b5c16767c6..88163e7ad2 100644
--- a/firmware/target/arm/imx233/audioout-imx233.h
+++ b/firmware/target/arm/imx233/audioout-imx233.h
@@ -27,6 +27,14 @@
#include "regs/regs-audioout.h"
+/* target-defined output stage coupling method
+ * its setting is IMX233_AUDIO_COUPLING_MODE and must be set for every target
+ * Use ACM_CAP if output stage (i.e. headphones) have output capacitors,
+ * ACM_CAPLESS (DC-coupled) otherwise.
+ */
+#define ACM_CAPLESS 0
+#define ACM_CAP 1
+
struct imx233_audioout_info_t
{
// NOTE there is a convention here: dac -> dacvol -> dacmute
diff --git a/firmware/target/arm/imx233/creative-zen/audio-target.h b/firmware/target/arm/imx233/creative-zen/audio-target.h
index 4ee2e2f402..192539211e 100644
--- a/firmware/target/arm/imx233/creative-zen/audio-target.h
+++ b/firmware/target/arm/imx233/creative-zen/audio-target.h
@@ -21,5 +21,7 @@
#ifndef __audio_target__
#define __audio_target__
+#define IMX233_AUDIO_COUPLING_MODE ACM_CAPLESS
+
#endif /* __audio_target__ */
diff --git a/firmware/target/arm/imx233/creative-zenxfi2/audio-target.h b/firmware/target/arm/imx233/creative-zenxfi2/audio-target.h
index afa3d9649b..59e8fd6f01 100644
--- a/firmware/target/arm/imx233/creative-zenxfi2/audio-target.h
+++ b/firmware/target/arm/imx233/creative-zenxfi2/audio-target.h
@@ -21,4 +21,6 @@
#ifndef __audio_target__
#define __audio_target__
+#define IMX233_AUDIO_COUPLING_MODE ACM_CAPLESS
+
#endif /* __audio_target__ */
diff --git a/firmware/target/arm/imx233/creative-zenxfi3/audio-target.h b/firmware/target/arm/imx233/creative-zenxfi3/audio-target.h
index 0b4610cd1a..bdb6b4a610 100644
--- a/firmware/target/arm/imx233/creative-zenxfi3/audio-target.h
+++ b/firmware/target/arm/imx233/creative-zenxfi3/audio-target.h
@@ -27,4 +27,6 @@
#define IMX233_AUDIO_SPKR_GATE_BANK 1
#define IMX233_AUDIO_SPKR_GATE_PIN 22
+#define IMX233_AUDIO_COUPLING_MODE ACM_CAPLESS
+
#endif /* __audio_target__ */
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/audio-target.h b/firmware/target/arm/imx233/sansa-fuzeplus/audio-target.h
index afa3d9649b..59e8fd6f01 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/audio-target.h
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/audio-target.h
@@ -21,4 +21,6 @@
#ifndef __audio_target__
#define __audio_target__
+#define IMX233_AUDIO_COUPLING_MODE ACM_CAPLESS
+
#endif /* __audio_target__ */
diff --git a/firmware/target/arm/imx233/sony-nwz/audio-target.h b/firmware/target/arm/imx233/sony-nwz/audio-target.h
index afa3d9649b..59e8fd6f01 100644
--- a/firmware/target/arm/imx233/sony-nwz/audio-target.h
+++ b/firmware/target/arm/imx233/sony-nwz/audio-target.h
@@ -21,4 +21,6 @@
#ifndef __audio_target__
#define __audio_target__
+#define IMX233_AUDIO_COUPLING_MODE ACM_CAPLESS
+
#endif /* __audio_target__ */