From 38f1f0af8b457cd4431e8c84fb3fa64373f97aa6 Mon Sep 17 00:00:00 2001 From: markun Date: Mon, 10 Dec 2007 11:14:28 +0000 Subject: [PATCH] Revert previous commit (still learning to work with git...) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15904 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/audio/as3514.c | 2 +- firmware/drivers/audio/mas35xx.c | 3 +-- firmware/drivers/audio/tlv320.c | 2 +- firmware/drivers/audio/uda1380.c | 2 +- firmware/drivers/audio/wm8721.c | 2 +- firmware/drivers/audio/wm8731.c | 2 +- firmware/drivers/audio/wm8751.c | 2 +- firmware/drivers/audio/wm8758.c | 2 +- firmware/drivers/audio/wm8975.c | 2 +- firmware/sound.c | 6 +++--- 10 files changed, 12 insertions(+), 13 deletions(-) diff --git a/firmware/drivers/audio/as3514.c b/firmware/drivers/audio/as3514.c index 413b32e8d..2dc151366 100644 --- a/firmware/drivers/audio/as3514.c +++ b/firmware/drivers/audio/as3514.c @@ -33,7 +33,7 @@ const struct sound_settings_info audiohw_settings[] = { /* HAVE_SW_TONE_CONTROLS */ [SOUND_BASS] = {"dB", 0, 1, -24, 24, 0}, [SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0}, - [SOUND_BALANCE] = {"dB", 0, 1, -80, 80, 0}, + [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0}, [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0}, [SOUND_STEREO_WIDTH] = {"%", 0, 5, 0, 250, 100}, [SOUND_MIC_GAIN] = {"dB", 1, 1, 0, 39, 23}, diff --git a/firmware/drivers/audio/mas35xx.c b/firmware/drivers/audio/mas35xx.c index 2a7a37aac..813b02e1c 100644 --- a/firmware/drivers/audio/mas35xx.c +++ b/firmware/drivers/audio/mas35xx.c @@ -28,13 +28,12 @@ const struct sound_settings_info audiohw_settings[] = { [SOUND_VOLUME] = {"dB", 0, 1,-100, 12, -25}, [SOUND_BASS] = {"dB", 0, 1, -12, 12, 6}, [SOUND_TREBLE] = {"dB", 0, 1, -12, 12, 6}, - [SOUND_BALANCE] = {"dB", 0, 1,-128, 127, 0}, #else /* MAS3507D */ [SOUND_VOLUME] = {"dB", 0, 1, -78, 18, -18}, [SOUND_BASS] = {"dB", 0, 1, -15, 15, 7}, [SOUND_TREBLE] = {"dB", 0, 1, -15, 15, 7}, - [SOUND_BALANCE] = {"dB", 0, 1, -96, 96, 0}, #endif + [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0}, [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0}, [SOUND_STEREO_WIDTH] = {"%", 0, 5, 0, 250, 100}, #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) diff --git a/firmware/drivers/audio/tlv320.c b/firmware/drivers/audio/tlv320.c index 121362aca..c0f37302f 100644 --- a/firmware/drivers/audio/tlv320.c +++ b/firmware/drivers/audio/tlv320.c @@ -29,7 +29,7 @@ const struct sound_settings_info audiohw_settings[] = { /* HAVE_SW_TONE_CONTROLS */ [SOUND_BASS] = {"dB", 0, 1, -24, 24, 0}, [SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0}, - [SOUND_BALANCE] = {"dB", 0, 1, -79, 79, 0}, + [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0}, [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0}, [SOUND_STEREO_WIDTH] = {"%", 0, 5, 0, 250, 100}, [SOUND_LEFT_GAIN] = {"dB", 1, 1, 0, 31, 23}, diff --git a/firmware/drivers/audio/uda1380.c b/firmware/drivers/audio/uda1380.c index 2a7c2129a..91bc9a1a8 100644 --- a/firmware/drivers/audio/uda1380.c +++ b/firmware/drivers/audio/uda1380.c @@ -30,7 +30,7 @@ const struct sound_settings_info audiohw_settings[] = { [SOUND_VOLUME] = {"dB", 0, 1, -84, 0, -25}, [SOUND_BASS] = {"dB", 0, 2, 0, 24, 0}, [SOUND_TREBLE] = {"dB", 0, 2, 0, 6, 0}, - [SOUND_BALANCE] = {"dB", 0, 1, -84, 84, 0}, + [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0}, [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0}, [SOUND_STEREO_WIDTH] = {"%", 0, 5, 0, 250, 100}, [SOUND_LEFT_GAIN] = {"dB", 1, 1,-128, 96, 0}, diff --git a/firmware/drivers/audio/wm8721.c b/firmware/drivers/audio/wm8721.c index 0efbd8570..dd3c1332f 100644 --- a/firmware/drivers/audio/wm8721.c +++ b/firmware/drivers/audio/wm8721.c @@ -43,7 +43,7 @@ const struct sound_settings_info audiohw_settings[] = { /* HAVE_SW_TONE_CONTROLS */ [SOUND_BASS] = {"dB", 0, 1, -24, 24, 0}, [SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0}, - [SOUND_BALANCE] = {"dB", 0, 1, -80, 80, 0}, + [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0}, [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0}, [SOUND_STEREO_WIDTH] = {"%", 0, 5, 0, 250, 100}, }; diff --git a/firmware/drivers/audio/wm8731.c b/firmware/drivers/audio/wm8731.c index 48c8a6db1..e0e7cb38c 100644 --- a/firmware/drivers/audio/wm8731.c +++ b/firmware/drivers/audio/wm8731.c @@ -38,7 +38,7 @@ const struct sound_settings_info audiohw_settings[] = { /* HAVE_SW_TONE_CONTROLS */ [SOUND_BASS] = {"dB", 0, 1, -24, 24, 0}, [SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0}, - [SOUND_BALANCE] = {"dB", 0, 1, -80, 80, 0}, + [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0}, [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0}, [SOUND_STEREO_WIDTH] = {"%", 0, 5, 0, 250, 100}, #ifdef HAVE_RECORDING diff --git a/firmware/drivers/audio/wm8751.c b/firmware/drivers/audio/wm8751.c index 0b511f885..78e129803 100644 --- a/firmware/drivers/audio/wm8751.c +++ b/firmware/drivers/audio/wm8751.c @@ -37,7 +37,7 @@ const struct sound_settings_info audiohw_settings[] = { [SOUND_BASS] = {"dB", 1, 15, -60, 90, 0}, #endif [SOUND_TREBLE] = {"dB", 1, 15, -60, 90, 0}, - [SOUND_BALANCE] = {"dB", 0, 1, -80, 80, 0}, + [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0}, [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0}, [SOUND_STEREO_WIDTH] = {"%", 0, 5, 0, 250, 100}, }; diff --git a/firmware/drivers/audio/wm8758.c b/firmware/drivers/audio/wm8758.c index 02719f0b9..a9f10fbe6 100644 --- a/firmware/drivers/audio/wm8758.c +++ b/firmware/drivers/audio/wm8758.c @@ -35,7 +35,7 @@ const struct sound_settings_info audiohw_settings[] = { [SOUND_VOLUME] = {"dB", 0, 1, -58, 6, -25}, [SOUND_BASS] = {"dB", 0, 1, -12, 12, 0}, [SOUND_TREBLE] = {"dB", 0, 1, -12, 12, 0}, - [SOUND_BALANCE] = {"dB", 0, 1, -64, 64, 0}, + [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0}, [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0}, [SOUND_STEREO_WIDTH] = {"%", 0, 5, 0, 250, 100}, [SOUND_LEFT_GAIN] = {"dB", 1, 1,-128, 96, 0}, diff --git a/firmware/drivers/audio/wm8975.c b/firmware/drivers/audio/wm8975.c index 1603d42ee..776222425 100644 --- a/firmware/drivers/audio/wm8975.c +++ b/firmware/drivers/audio/wm8975.c @@ -39,7 +39,7 @@ const struct sound_settings_info audiohw_settings[] = { [SOUND_VOLUME] = {"dB", 0, 1, -74, 6, -25}, [SOUND_BASS] = {"dB", 0, 1, -6, 9, 0}, [SOUND_TREBLE] = {"dB", 0, 1, -6, 9, 0}, - [SOUND_BALANCE] = {"dB", 0, 1, -80, 80, 0}, + [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0}, [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0}, [SOUND_STEREO_WIDTH] = {"%", 0, 5, 0, 250, 100}, [SOUND_LEFT_GAIN] = {"dB", 1, 1,-128, 96, 0}, diff --git a/firmware/sound.c b/firmware/sound.c index 2dd5522e3..5a1a1e97b 100644 --- a/firmware/sound.c +++ b/firmware/sound.c @@ -61,7 +61,7 @@ const struct sound_settings_info audiohw_settings[] = { [SOUND_VOLUME] = {"dB", 0, 1, VOLUME_MIN / 10, VOLUME_MAX / 10, -25}, [SOUND_BASS] = {"dB", 0, 1, -24, 24, 0}, [SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0}, - [SOUND_BALANCE] = {"dB", 0, 1, VOLUME_RANGE / 10, -VOLUME_RANGE / 10, 0}, + [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0}, [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0}, [SOUND_STEREO_WIDTH] = {"%", 0, 5, 0, 250, 100}, #if CONFIG_CODEC == MAS3587F || defined(HAVE_UDA1380) || defined(HAVE_TLV320)\ @@ -418,13 +418,13 @@ void sound_set_balance(int value) if(!audio_is_initialized) return; #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) - unsigned tmp = ((unsigned)(value) & 0xff) << 8; + unsigned tmp = ((unsigned)(value * 127 / 100) & 0xff) << 8; mas_codec_writereg(0x11, tmp); #elif CONFIG_CODEC == MAS3507D || defined HAVE_UDA1380 \ || defined HAVE_WM8975 || defined HAVE_WM8758 || defined HAVE_WM8731 \ || defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) \ || defined(HAVE_AS3514) - current_balance = value * 10; /* tenth of dB */ + current_balance = value * VOLUME_RANGE / 100; /* tenth of dB */ set_prescaled_volume(); #elif CONFIG_CPU == PNX0101 /* TODO: implement for iFP */ -- 2.11.4.GIT