summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2018-09-05 11:27:27 -0400
committerSolomon Peachy <pizza@shaftnet.org>2018-09-20 18:59:19 -0400
commit8edf4052c78992a269e00d78a2cb82ed73f38358 (patch)
treedef866c77ae3c8b654426f342c27458b95cbca9b
parent10208977947aa1471b065789b5eb08313ccae1d4 (diff)
downloadrockbox-8edf4052c78992a269e00d78a2cb82ed73f38358.tar.gz
rockbox-8edf4052c78992a269e00d78a2cb82ed73f38358.zip
jz7460: Silence codec when changing playback frequency/mode
Silences some annoying clicks. Change-Id: I3d32d4b33c0ccc61877e10f5af97fe05084d66e5
-rw-r--r--firmware/target/mips/ingenic_jz47xx/codec-jz4760.c8
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)
void audiohw_set_volume(int vol_l, int vol_r)
{
+ uint8_t val = cs4398_read_reg(CS4398_REG_MISC) &~ CS4398_FREEZE;
+ cs4398_write_reg(CS4398_REG_MISC, val | CS4398_FREEZE);
cs4398_write_reg(CS4398_REG_VOL_A, vol_tenthdb2hw(vol_l));
cs4398_write_reg(CS4398_REG_VOL_B, vol_tenthdb2hw(vol_r));
+ cs4398_write_reg(CS4398_REG_MISC, val);
}
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)
void audiohw_set_filter_roll_off(int value)
{
- /* 0 = fast (sharp);
- 1 = slow */
if (value == 0) {
cs4398_write_reg(CS4398_REG_RAMPFILT, cs4398_read_reg(CS4398_REG_RAMPFILT) & ~CS4398_FILT_SEL);
} else {
@@ -252,6 +253,7 @@ void audiohw_set_frequency(int fsel)
return;
}
+ ap_mute(true);
__i2s_stop_bitclk();
/* 0 = Single-Speed Mode (<50KHz);
@@ -268,6 +270,8 @@ void audiohw_set_frequency(int fsel)
__cpm_set_i2sdiv(mclk_div-1);
__i2s_set_i2sdiv(bclk_div-1);
__i2s_start_bitclk();
+ mdelay(20);
+ ap_mute(false);
}
void audiohw_postinit(void)