diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2016-02-08 23:58:32 +0000 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2016-02-12 23:04:33 +0000 |
commit | 6f54a86360acd3d5b193a92637eadf6df7246bf3 (patch) | |
tree | 5fa3d3c2c8977191edca9b59f403263233584382 | |
parent | 76190313071f5b316db33fe578ae94ec744b6a27 (diff) | |
download | rockbox-6f54a86360acd3d5b193a92637eadf6df7246bf3.tar.gz rockbox-6f54a86360acd3d5b193a92637eadf6df7246bf3.zip |
as3514: fix bug in volume management on AS3543 targets which are not AS3525v2
Some old code made the assumption that CONFIG_CPU == AS3525v2 if and only if
HAVE_AS3543, which is not true on targets like the Samsung YP-R0. This fixes
several issues on such targets like a huge volume gap between -39dB and -40dB
and a volume artificially capped at -72dB instead of -82dB.
Change-Id: Ib1c883ac593c0c3ce5e2bf4eb408924ce5f5ad93
-rw-r--r-- | firmware/drivers/audio/as3514.c | 6 | ||||
-rw-r--r-- | firmware/export/as3514.h | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/firmware/drivers/audio/as3514.c b/firmware/drivers/audio/as3514.c index 2d69395d37..167dd85abb 100644 --- a/firmware/drivers/audio/as3514.c +++ b/firmware/drivers/audio/as3514.c | |||
@@ -34,7 +34,7 @@ | |||
34 | #include "i2s.h" | 34 | #include "i2s.h" |
35 | #include "ascodec.h" | 35 | #include "ascodec.h" |
36 | 36 | ||
37 | #if CONFIG_CPU == AS3525v2 | 37 | #ifdef HAVE_AS3543 |
38 | /* Headphone volume goes from -81.0 ... +6dB */ | 38 | /* Headphone volume goes from -81.0 ... +6dB */ |
39 | #define VOLUME_MIN -820 | 39 | #define VOLUME_MIN -820 |
40 | #define VOLUME_MAX 60 | 40 | #define VOLUME_MAX 60 |
@@ -48,7 +48,7 @@ | |||
48 | * This drivers supports: | 48 | * This drivers supports: |
49 | * as3514 , as used in the PP targets | 49 | * as3514 , as used in the PP targets |
50 | * as3515 , as used in the as3525 targets | 50 | * as3515 , as used in the as3525 targets |
51 | * as3543 , as used in the as3525v2 targets | 51 | * as3543 , as used in the as3525v2 and other as3543 targets |
52 | */ | 52 | */ |
53 | 53 | ||
54 | #if CONFIG_CPU == AS3525 | 54 | #if CONFIG_CPU == AS3525 |
@@ -278,7 +278,7 @@ void audiohw_set_volume(int vol_l, int vol_r) | |||
278 | /*AS3543 mixer can go a little louder then the as3514, although | 278 | /*AS3543 mixer can go a little louder then the as3514, although |
279 | * it might be possible to go louder on the as3514 as well */ | 279 | * it might be possible to go louder on the as3514 as well */ |
280 | 280 | ||
281 | #if CONFIG_CPU == AS3525v2 | 281 | #ifdef HAVE_AS3543 |
282 | #define MIXER_MAX_VOLUME 0x1b | 282 | #define MIXER_MAX_VOLUME 0x1b |
283 | #else /* lets leave the AS3514 alone until its better tested*/ | 283 | #else /* lets leave the AS3514 alone until its better tested*/ |
284 | #define MIXER_MAX_VOLUME 0x16 | 284 | #define MIXER_MAX_VOLUME 0x16 |
diff --git a/firmware/export/as3514.h b/firmware/export/as3514.h index b5c9438786..783683e593 100644 --- a/firmware/export/as3514.h +++ b/firmware/export/as3514.h | |||
@@ -31,11 +31,11 @@ | |||
31 | #define AUDIOHW_CAPS (LIN_GAIN_CAP | MIC_GAIN_CAP) | 31 | #define AUDIOHW_CAPS (LIN_GAIN_CAP | MIC_GAIN_CAP) |
32 | 32 | ||
33 | /*different volume ranges for different AMS chips*/ | 33 | /*different volume ranges for different AMS chips*/ |
34 | #if CONFIG_CPU == AS3525v2 | 34 | #ifdef HAVE_AS3543 |
35 | AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -82, 6, -25) | 35 | AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -82, 6, -25) |
36 | #else /* AS3525v1 */ | 36 | #else /* !HAVE_AS3543 */ |
37 | AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -74, 6, -25) | 37 | AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -74, 6, -25) |
38 | #endif /* CONFIG_CPU == AS3525v2 */ | 38 | #endif /* HAVE_AS3543 */ |
39 | 39 | ||
40 | #ifdef HAVE_RECORDING | 40 | #ifdef HAVE_RECORDING |
41 | AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1, 0, 39, 23, (val - 23) * 15) | 41 | AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1, 0, 39, 23, (val - 23) * 15) |