summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2006-06-02 19:32:36 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2006-06-02 19:32:36 +0000
commiteca4a49a082374a5762428ecf09b54c96858f8f4 (patch)
tree1a2ca097c9e74f28b80ab41eab2370c28c12debb /firmware
parent8e6dd90bd5fb819576d989479b741ae10075089a (diff)
downloadrockbox-eca4a49a082374a5762428ecf09b54c96858f8f4.tar.gz
rockbox-eca4a49a082374a5762428ecf09b54c96858f8f4.tar.bz2
rockbox-eca4a49a082374a5762428ecf09b54c96858f8f4.zip
Do not allow interrupts between the two calls that set the recording gain. Fixes volume glitches when changing recording gain.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10031 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/uda1380.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/drivers/uda1380.c b/firmware/drivers/uda1380.c
index 5a0ecf08ca..322078a5f5 100644
--- a/firmware/drivers/uda1380.c
+++ b/firmware/drivers/uda1380.c
@@ -265,15 +265,19 @@ void uda1380_disable_recording(void)
void uda1380_set_recvol(int left, int right, int type)
{
int left_ag, right_ag;
+ int old_irq_level;
switch (type)
{
case AUDIO_GAIN_MIC:
left_ag = MIN(MAX(0, left / 4), 15);
left -= left_ag * 4;
+ /* allow nothing in between the two calls */
+ old_irq_level = set_irq_level(HIGHEST_IRQ_LEVEL);
uda1380_write_reg(REG_ADC, (uda1380_regs[REG_ADC] & ~VGA_GAIN_MASK)
| VGA_GAIN(left_ag));
uda1380_write_reg(REG_DEC_VOL, DEC_VOLL(left) | DEC_VOLR(left));
+ set_irq_level(old_irq_level);
logf("Mic: %dA/%dD", left_ag, left);
break;
@@ -282,9 +286,12 @@ void uda1380_set_recvol(int left, int right, int type)
left -= left_ag * 6;
right_ag = MIN(MAX(0, right / 6), 8);
right -= right_ag * 6;
+ /* allow nothing in between the two calls */
+ old_irq_level = set_irq_level(HIGHEST_IRQ_LEVEL);
uda1380_write_reg(REG_PGA, (uda1380_regs[REG_PGA] & ~PGA_GAIN_MASK)
| PGA_GAINL(left_ag) | PGA_GAINR(right_ag));
uda1380_write_reg(REG_DEC_VOL, DEC_VOLL(left) | DEC_VOLR(right));
+ set_irq_level(old_irq_level);
logf("Line L: %dA/%dD", left_ag, left);
logf("Line R: %dA/%dD", right_ag, right);
break;