diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2018-09-05 11:27:27 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2018-09-20 18:59:19 -0400 |
commit | 8edf4052c78992a269e00d78a2cb82ed73f38358 (patch) | |
tree | def866c77ae3c8b654426f342c27458b95cbca9b /firmware/target/mips/ingenic_jz47xx/codec-jz4760.c | |
parent | 10208977947aa1471b065789b5eb08313ccae1d4 (diff) | |
download | rockbox-8edf4052c78992a269e00d78a2cb82ed73f38358.tar.gz rockbox-8edf4052c78992a269e00d78a2cb82ed73f38358.zip |
jz7460: Silence codec when changing playback frequency/mode
Silences some annoying clicks.
Change-Id: I3d32d4b33c0ccc61877e10f5af97fe05084d66e5
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/codec-jz4760.c')
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/codec-jz4760.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/codec-jz4760.c b/firmware/target/mips/ingenic_jz47xx/codec-jz4760.c index f25dc70eb4..09d4858b34 100644 --- a/firmware/target/mips/ingenic_jz47xx/codec-jz4760.c +++ b/firmware/target/mips/ingenic_jz47xx/codec-jz4760.c | |||
@@ -142,8 +142,11 @@ static int vol_tenthdb2hw(const int tdb) | |||
142 | 142 | ||
143 | void audiohw_set_volume(int vol_l, int vol_r) | 143 | void audiohw_set_volume(int vol_l, int vol_r) |
144 | { | 144 | { |
145 | uint8_t val = cs4398_read_reg(CS4398_REG_MISC) &~ CS4398_FREEZE; | ||
146 | cs4398_write_reg(CS4398_REG_MISC, val | CS4398_FREEZE); | ||
145 | cs4398_write_reg(CS4398_REG_VOL_A, vol_tenthdb2hw(vol_l)); | 147 | cs4398_write_reg(CS4398_REG_VOL_A, vol_tenthdb2hw(vol_l)); |
146 | cs4398_write_reg(CS4398_REG_VOL_B, vol_tenthdb2hw(vol_r)); | 148 | cs4398_write_reg(CS4398_REG_VOL_B, vol_tenthdb2hw(vol_r)); |
149 | cs4398_write_reg(CS4398_REG_MISC, val); | ||
147 | } | 150 | } |
148 | 151 | ||
149 | void audiohw_set_lineout_volume(int vol_l, int vol_r) | 152 | void audiohw_set_lineout_volume(int vol_l, int vol_r) |
@@ -159,8 +162,6 @@ void audiohw_set_lineout_volume(int vol_l, int vol_r) | |||
159 | 162 | ||
160 | void audiohw_set_filter_roll_off(int value) | 163 | void audiohw_set_filter_roll_off(int value) |
161 | { | 164 | { |
162 | /* 0 = fast (sharp); | ||
163 | 1 = slow */ | ||
164 | if (value == 0) { | 165 | if (value == 0) { |
165 | cs4398_write_reg(CS4398_REG_RAMPFILT, cs4398_read_reg(CS4398_REG_RAMPFILT) & ~CS4398_FILT_SEL); | 166 | cs4398_write_reg(CS4398_REG_RAMPFILT, cs4398_read_reg(CS4398_REG_RAMPFILT) & ~CS4398_FILT_SEL); |
166 | } else { | 167 | } else { |
@@ -252,6 +253,7 @@ void audiohw_set_frequency(int fsel) | |||
252 | return; | 253 | return; |
253 | } | 254 | } |
254 | 255 | ||
256 | ap_mute(true); | ||
255 | __i2s_stop_bitclk(); | 257 | __i2s_stop_bitclk(); |
256 | 258 | ||
257 | /* 0 = Single-Speed Mode (<50KHz); | 259 | /* 0 = Single-Speed Mode (<50KHz); |
@@ -268,6 +270,8 @@ void audiohw_set_frequency(int fsel) | |||
268 | __cpm_set_i2sdiv(mclk_div-1); | 270 | __cpm_set_i2sdiv(mclk_div-1); |
269 | __i2s_set_i2sdiv(bclk_div-1); | 271 | __i2s_set_i2sdiv(bclk_div-1); |
270 | __i2s_start_bitclk(); | 272 | __i2s_start_bitclk(); |
273 | mdelay(20); | ||
274 | ap_mute(false); | ||
271 | } | 275 | } |
272 | 276 | ||
273 | void audiohw_postinit(void) | 277 | void audiohw_postinit(void) |