summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-06-18 01:25:47 +0000
committerJens Arnold <amiconn@rockbox.org>2005-06-18 01:25:47 +0000
commit4c7da8861891fca35dab5be3c2a21252d09574e9 (patch)
treed0b480e414e1cac9be36309734b07f8beca4b269 /firmware/drivers
parent22c15b78c834e1c4bff373a39d02c15bb6664c7c (diff)
downloadrockbox-4c7da8861891fca35dab5be3c2a21252d09574e9.tar.gz
rockbox-4c7da8861891fca35dab5be3c2a21252d09574e9.zip
Iriver UDA1380 volume and balance handling is now done in sound.c, similar to archos player; removed pcm_set_volume(). Implemented a dB-linear scale. Sorted & bumped plugin api. Removed audio test from the debug menu.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6741 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/uda1380.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/firmware/drivers/uda1380.c b/firmware/drivers/uda1380.c
index 7170b707e4..23d917f8ae 100644
--- a/firmware/drivers/uda1380.c
+++ b/firmware/drivers/uda1380.c
@@ -85,33 +85,15 @@ int uda1380_write_reg(unsigned char reg, unsigned short value)
85} 85}
86 86
87/** 87/**
88 * Sets the master volume 88 * Sets left and right master volume (0(max) to 252(muted))
89 *
90 * \param vol Range [0..255] 0=max, 255=mute
91 *
92 */ 89 */
93int uda1380_setvol(int vol) 90int uda1380_setvol(int vol_l, int vol_r)
94{ 91{
95 int vol_l, vol_r;
96
97 uda1380_volume = vol;
98 /* Simple linear volume crossfade curves */
99 vol_l = MAX(uda1380_balance*(255 - vol)/100 + vol, vol);
100 vol_r = MAX(-uda1380_balance*(255 - vol)/100 + vol, vol);
101 return uda1380_write_reg(REG_MASTER_VOL, 92 return uda1380_write_reg(REG_MASTER_VOL,
102 MASTER_VOL_LEFT(vol_l) | MASTER_VOL_RIGHT(vol_r)); 93 MASTER_VOL_LEFT(vol_l) | MASTER_VOL_RIGHT(vol_r));
103} 94}
104 95
105/** 96/**
106 * Sets stereo balance
107 */
108void uda1380_set_balance(int bal)
109{
110 uda1380_balance = bal;
111 uda1380_setvol(uda1380_volume);
112}
113
114/**
115 * Sets the bass value (0-15) 97 * Sets the bass value (0-15)
116 */ 98 */
117void uda1380_set_bass(int value) 99void uda1380_set_bass(int value)