From 5ffa8c52df2df1096c484efe6815ea8e8b548065 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Mon, 30 Jan 2006 21:12:31 +0000 Subject: iPod: Initial attempt at volume/bass/treble control - more work is needed, but it seems to be working. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8495 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/wm8975.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'firmware/drivers') diff --git a/firmware/drivers/wm8975.c b/firmware/drivers/wm8975.c index 802bcfa72b..a817284406 100644 --- a/firmware/drivers/wm8975.c +++ b/firmware/drivers/wm8975.c @@ -196,14 +196,25 @@ int wm8975_set_mixer_vol(int channel1, int channel2) return 0; } +/* We are using Linear bass control */ void wm8975_set_bass(int value) { - (void)value; + int regvalues[]={11, 10, 10, 9, 8, 8, 0xf , 6, 6, 5, 4, 4, 3, 2, 1, 0}; + + if ((value >= -6) && (value <= 9)) { + /* We use linear bass control with 130Hz cutoff */ + ipod_i2c_send(0x1a, 0x0c << 1, regvalues[value+6]); + } } void wm8975_set_treble(int value) { - (void)value; + int regvalues[]={11, 10, 10, 9, 8, 8, 0xf , 6, 6, 5, 4, 4, 3, 2, 1, 0}; + + if ((value >= -6) && (value <= 9)) { + /* We use a 8Khz cutoff */ + ipod_i2c_send(0x1a, 0x0d << 1, regvalues[value+6]); + } } int wm8975_mute(int mute) -- cgit v1.2.3