summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-12-02 11:51:17 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2012-12-02 11:51:51 +0100
commitd119fb1fc5b917e430b23a28bebf6ec5db35b34e (patch)
tree6d7c6afb422d8f462ff3c9272f1d4c0901f26880
parent4dd2c5277b6da35ceb200d814c39a581e69c5258 (diff)
downloadrockbox-d119fb1fc5b917e430b23a28bebf6ec5db35b34e.tar.gz
rockbox-d119fb1fc5b917e430b23a28bebf6ec5db35b34e.zip
imx233: try to improve audio quality
Change-Id: Idaee93fae8d407e5968f8571c54957b7b87da3bb
-rw-r--r--firmware/target/arm/imx233/audioout-imx233.c7
-rw-r--r--firmware/target/arm/imx233/audioout-imx233.h16
2 files changed, 22 insertions, 1 deletions
diff --git a/firmware/target/arm/imx233/audioout-imx233.c b/firmware/target/arm/imx233/audioout-imx233.c
index e5e1e37264..e9b368c9b6 100644
--- a/firmware/target/arm/imx233/audioout-imx233.c
+++ b/firmware/target/arm/imx233/audioout-imx233.c
@@ -53,6 +53,13 @@ void imx233_audioout_preinit(void)
53 __REG_CLR(HW_AUDIOOUT_PWRDN) = HW_AUDIOOUT_PWRDN__HEADPHONE; 53 __REG_CLR(HW_AUDIOOUT_PWRDN) = HW_AUDIOOUT_PWRDN__HEADPHONE;
54 /* Set HP mode to AB */ 54 /* Set HP mode to AB */
55 __REG_SET(HW_AUDIOOUT_ANACTRL) = HW_AUDIOOUT_ANACTRL__HP_CLASSAB; 55 __REG_SET(HW_AUDIOOUT_ANACTRL) = HW_AUDIOOUT_ANACTRL__HP_CLASSAB;
56 /* change biais to -50% */
57 __REG_CLR(HW_AUDIOOUT_TEST) = HW_AUDIOOUT_TEST__HP_I1_ADJ_BM;
58 __REG_SET(HW_AUDIOOUT_TEST) = HW_AUDIOOUT_TEST__HP_I1_ADJ_M_50;
59 __REG_CLR(HW_AUDIOOUT_REFCTRL) = HW_AUDIOOUT_REFCTRL__BIAS_CTRL_BM;
60 __REG_SET(HW_AUDIOOUT_REFCTRL) = 1 << HW_AUDIOOUT_REFCTRL__BIAS_CTRL_BP;
61 __REG_SET(HW_AUDIOOUT_REFCTRL) = HW_AUDIOOUT_REFCTRL__RAISE_REF;
62 __REG_SET(HW_AUDIOOUT_REFCTRL) = HW_AUDIOOUT_REFCTRL__XTAL_BGR_BIAS;
56 /* Stop holding to ground */ 63 /* Stop holding to ground */
57 __REG_CLR(HW_AUDIOOUT_ANACTRL) = HW_AUDIOOUT_ANACTRL__HP_HOLD_GND; 64 __REG_CLR(HW_AUDIOOUT_ANACTRL) = HW_AUDIOOUT_ANACTRL__HP_HOLD_GND;
58 /* Set dmawait count to 31 (see errata, workaround random stop) */ 65 /* Set dmawait count to 31 (see errata, workaround random stop) */
diff --git a/firmware/target/arm/imx233/audioout-imx233.h b/firmware/target/arm/imx233/audioout-imx233.h
index acfb56138f..fbc0827be2 100644
--- a/firmware/target/arm/imx233/audioout-imx233.h
+++ b/firmware/target/arm/imx233/audioout-imx233.h
@@ -86,7 +86,13 @@
86#define HW_AUDIOOUT_PWRDN__SPEAKER (1 << 24) 86#define HW_AUDIOOUT_PWRDN__SPEAKER (1 << 24)
87 87
88#define HW_AUDIOOUT_REFCTRL (*(volatile uint32_t *)(HW_AUDIOOUT_BASE + 0x80)) 88#define HW_AUDIOOUT_REFCTRL (*(volatile uint32_t *)(HW_AUDIOOUT_BASE + 0x80))
89#define HW_AUDIOOUT_REFCTRL__LOW_PWR (1 << 19) 89#define HW_AUDIOOUT_REFCTRL__BIAS_CTRL_BP 16
90#define HW_AUDIOOUT_REFCTRL__BIAS_CTRL_BM (3 << 16)
91#define HW_AUDIOOUT_REFCTRL__LOW_PWR (1 << 19)
92#define HW_AUDIOOUT_REFCTRL__VBG_ADJ_BP 20
93#define HW_AUDIOOUT_REFCTRL__VBG_ADJ_BM (3 << 20)
94#define HW_AUDIOOUT_REFCTRL__XTAL_BGR_BIAS (1 << 24)
95#define HW_AUDIOOUT_REFCTRL__RAISE_REF (1 << 25)
90 96
91#define HW_AUDIOOUT_ANACTRL (*(volatile uint32_t *)(HW_AUDIOOUT_BASE + 0x90)) 97#define HW_AUDIOOUT_ANACTRL (*(volatile uint32_t *)(HW_AUDIOOUT_BASE + 0x90))
92#define HW_AUDIOOUT_ANACTRL__HP_CLASSAB (1 << 4) 98#define HW_AUDIOOUT_ANACTRL__HP_CLASSAB (1 << 4)
@@ -98,6 +104,14 @@
98#define HW_AUDIOOUT_ANACTRL__SHORT_LR_STS (1 << 24) 104#define HW_AUDIOOUT_ANACTRL__SHORT_LR_STS (1 << 24)
99#define HW_AUDIOOUT_ANACTRL__SHORT_CM_STS (1 << 28) 105#define HW_AUDIOOUT_ANACTRL__SHORT_CM_STS (1 << 28)
100 106
107#define HW_AUDIOOUT_TEST (*(volatile uint32_t *)(HW_AUDIOOUT_BASE + 0xa0))
108#define HW_AUDIOOUT_TEST__HP_I1_ADJ_BM (3 << 22)
109#define HW_AUDIOOUT_TEST__HP_I1_ADJ_BP 22
110#define HW_AUDIOOUT_TEST__HP_I1_ADJ_NOMINAL (0 << 22)
111#define HW_AUDIOOUT_TEST__HP_I1_ADJ_M_50 (1 << 22)
112#define HW_AUDIOOUT_TEST__HP_I1_ADJ_P_100 (2 << 22)
113#define HW_AUDIOOUT_TEST__HP_I1_ADJ_P_50 (3 << 22)
114
101#define HW_AUDIOOUT_ANACLKCTRL (*(volatile uint32_t *)(HW_AUDIOOUT_BASE + 0xe0)) 115#define HW_AUDIOOUT_ANACLKCTRL (*(volatile uint32_t *)(HW_AUDIOOUT_BASE + 0xe0))
102#define HW_AUDIOOUT_ANACLKCTRL__DACDIV_BP 0 116#define HW_AUDIOOUT_ANACLKCTRL__DACDIV_BP 0
103#define HW_AUDIOOUT_ANACLKCTRL__DACDIV_BM (7 << 0) 117#define HW_AUDIOOUT_ANACLKCTRL__DACDIV_BM (7 << 0)