diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-03-31 21:57:53 +0200 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2013-04-11 11:18:23 +0200 |
commit | a924df8d6ddfa4372ce6b49c312e1da1ffceb2ad (patch) | |
tree | c5d977120d5dc629d9778c4ee7ab84284458503e /firmware/drivers/audio/rk27xx_codec.c | |
parent | f49e75053198cc24aff92e9045795e011fa25083 (diff) | |
download | rockbox-a924df8d6ddfa4372ce6b49c312e1da1ffceb2ad.tar.gz rockbox-a924df8d6ddfa4372ce6b49c312e1da1ffceb2ad.zip |
rk27xx: implement radio support
Change-Id: I59d3905e9b2a3df8aa235e424c7a6e0eff6d73e9
Reviewed-on: http://gerrit.rockbox.org/427
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
Tested-by: Marcin Bukat <marcin.bukat@gmail.com>
Diffstat (limited to 'firmware/drivers/audio/rk27xx_codec.c')
-rw-r--r-- | firmware/drivers/audio/rk27xx_codec.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/firmware/drivers/audio/rk27xx_codec.c b/firmware/drivers/audio/rk27xx_codec.c index cfb98a9227..462565e8aa 100644 --- a/firmware/drivers/audio/rk27xx_codec.c +++ b/firmware/drivers/audio/rk27xx_codec.c | |||
@@ -55,12 +55,14 @@ static int codec_read(uint8_t reg, uint8_t *val) | |||
55 | } | 55 | } |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | static uint8_t cr1_sel = DACSEL; | ||
59 | |||
58 | static void audiohw_mute(bool mute) | 60 | static void audiohw_mute(bool mute) |
59 | { | 61 | { |
60 | if (mute) | 62 | if (mute) |
61 | codec_write(CR1, SB_MICBIAS|DAC_MUTE|DACSEL); | 63 | codec_write(CR1, SB_MICBIAS|DAC_MUTE|cr1_sel); |
62 | else | 64 | else |
63 | codec_write(CR1, SB_MICBIAS|DACSEL); | 65 | codec_write(CR1, SB_MICBIAS|cr1_sel); |
64 | } | 66 | } |
65 | 67 | ||
66 | /* public functions */ | 68 | /* public functions */ |
@@ -109,7 +111,7 @@ void audiohw_postinit(void) | |||
109 | udelay(1000); | 111 | udelay(1000); |
110 | 112 | ||
111 | /* power up output stage */ | 113 | /* power up output stage */ |
112 | codec_write(PMR1, SB_ADC|SB_IN1|SB_IN2|SB_MIC|SB_IND); | 114 | codec_write(PMR1, SB_ADC|SB_MIC|SB_IND); |
113 | 115 | ||
114 | sleep(HZ/10); | 116 | sleep(HZ/10); |
115 | GPIO_PDDR |= (1<<7); /* PD7 high */ | 117 | GPIO_PDDR |= (1<<7); /* PD7 high */ |
@@ -159,5 +161,15 @@ void audiohw_set_master_vol(int vol_l, int vol_r) | |||
159 | 161 | ||
160 | codec_write(CGR9, vol_r); | 162 | codec_write(CGR9, vol_r); |
161 | codec_write(CGR8, vol_l); | 163 | codec_write(CGR8, vol_l); |
164 | codec_write(CGR5, vol_r); | ||
165 | codec_write(CGR4, vol_l); | ||
166 | codec_write(CGR3, vol_r); | ||
167 | codec_write(CGR2, vol_l); | ||
162 | } | 168 | } |
163 | } | 169 | } |
170 | |||
171 | void audiohw_set_monitor(bool enable) | ||
172 | { | ||
173 | cr1_sel = enable ? BYPASS1|BYPASS2 : DACSEL; | ||
174 | codec_write(CR1, cr1_sel|SB_MICBIAS); | ||
175 | } | ||