summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-03-29 19:48:18 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-03-29 19:48:18 +0000
commit17eca7bfa0cb7af7cf432463c772ff572ebb7018 (patch)
treee96c0651169d9f17730f359823edcc7ac193dbc2
parent10023adf727391cd165be7b5290e83a4710d0129 (diff)
downloadrockbox-17eca7bfa0cb7af7cf432463c772ff572ebb7018.tar.gz
rockbox-17eca7bfa0cb7af7cf432463c772ff572ebb7018.tar.bz2
rockbox-17eca7bfa0cb7af7cf432463c772ff572ebb7018.zip
as3525v2: FM playback (only tested on Clip+)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25383 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/audio/as3514.c17
-rw-r--r--firmware/export/as3514.h7
2 files changed, 21 insertions, 3 deletions
diff --git a/firmware/drivers/audio/as3514.c b/firmware/drivers/audio/as3514.c
index 14c6e43909..11adddc0f1 100644
--- a/firmware/drivers/audio/as3514.c
+++ b/firmware/drivers/audio/as3514.c
@@ -183,15 +183,16 @@ void audiohw_preinit(void)
as3514_write(AS3514_LSP_OUT_L, LSP_OUT_L_SP_MUTE | 0x00);
#else
as3514_clear(AS3543_DAC_IF, 0x80);
+ as3514_set(AS3514_LINE_IN1_R, 1<<6); // Select Line-in 2
#endif
- /* Set headphone over-current to 0, Min volume */
#if CONFIG_CPU != AS3525v2
+ /* Set headphone over-current to 0, Min volume */
as3514_write(AS3514_HPH_OUT_R,
HPH_OUT_R_HP_OVC_TO_0MS | 0x00);
#else
- as3514_write(AS3514_HPH_OUT_R, (0<<7) /* out */ | (1<<5) /* dac */
- | 0x1f /* vol */);
+ as3514_write(AS3514_HPH_OUT_R, (0<<7) /* out */ | HPH_OUT_R_HP_OUT_DAC |
+ 0x00);
#endif
/* Headphone ON, MUTE, Min volume */
as3514_write(AS3514_HPH_OUT_L,
@@ -429,13 +430,23 @@ void audiohw_set_monitor(bool enable)
LINE_IN1_R_LI1R_MUTE_off);
as3514_set((LINE_INPUT == 1) ? AS3514_LINE_IN1_L : AS3514_LINE_IN2_L,
LINE_IN1_L_LI1L_MUTE_off);
+
+#if CONFIG_CPU == AS3525v2
+ as3514_write_masked(AS3514_HPH_OUT_R,
+ HPH_OUT_R_HP_OUT_LINE, HPH_OUT_R_HP_OUT_MASK);
+#endif
}
else {
/* turn off both LIN1 and LIN2 */
as3514_clear(AS3514_LINE_IN1_R, LINE_IN1_R_LI1R_MUTE_off);
as3514_clear(AS3514_LINE_IN1_L, LINE_IN1_L_LI1L_MUTE_off);
+#if CONFIG_CPU != AS3525v2 /* not in as3543 */
as3514_clear(AS3514_LINE_IN2_R, LINE_IN2_R_LI2R_MUTE_off);
as3514_clear(AS3514_LINE_IN2_L, LINE_IN2_L_LI2L_MUTE_off);
+#else
+ as3514_write_masked(AS3514_HPH_OUT_R,
+ HPH_OUT_R_HP_OUT_DAC, HPH_OUT_R_HP_OUT_MASK);
+#endif
as3514_clear(AS3514_AUDIOSET1, AUDIOSET1_LIN1_on | AUDIOSET1_LIN2_on);
}
}
diff --git a/firmware/export/as3514.h b/firmware/export/as3514.h
index c7353a2e97..afc982da39 100644
--- a/firmware/export/as3514.h
+++ b/firmware/export/as3514.h
@@ -102,10 +102,17 @@ extern void audiohw_set_lineout_vol(int vol_l, int vol_r);
/* HPH_OUT_R (0x02) */
#define HPH_OUT_R_HP_OVC_TO (0x3 << 6)
+ /* AS3514/AS3517 */
#define HPH_OUT_R_HP_OVC_TO_0MS (0x3 << 6)
#define HPH_OUT_R_HP_OVC_TO_128MS (0x1 << 6)
#define HPH_OUT_R_HP_OVC_TO_256MS (0x0 << 6)
#define HPH_OUT_R_HP_OVC_TO_512MS (0x2 << 6)
+ /* AS3543 */
+ #define HPH_OUT_R_HP_OUT_SUM (0x0 << 5)
+ #define HPH_OUT_R_HP_OUT_DAC (0x1 << 5)
+ #define HPH_OUT_R_HP_OUT_LINE (0x2 << 5)
+ #define HPH_OUT_R_HP_OUT_MIC (0x3 << 5)
+ #define HPH_OUT_R_HP_OUT_MASK (0x3 << 5)
/* Use AS3514_VOL_MASK */
/* HPH_OUT_L (0x03) */