diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2008-04-28 08:37:18 +0000 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2008-04-28 08:37:18 +0000 |
commit | 8391526f794b296e5b6edd5707bbf25b5be73e17 (patch) | |
tree | c35e4565831b3a822394e98da32dc79db339345b /firmware/export | |
parent | 17f7adb90d232e6dece891790405d1b99b5b8215 (diff) | |
download | rockbox-8391526f794b296e5b6edd5707bbf25b5be73e17.tar.gz rockbox-8391526f794b296e5b6edd5707bbf25b5be73e17.zip |
* introduce AUDIOHW_CAPS to define which audio codec can do what kind of operations in hw, e.g. setting bass
* added documentation why and when we need the software based prescaler
* implement audiohw_set_bass and audiohw_set_treble for mas35xx
* clean up sound_set_bass and sound_set_treble
* simplify some #ifdef logic
* fix special handling of WM8751 - looking for tester :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17274 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/audiohw.h | 35 | ||||
-rw-r--r-- | firmware/export/mas35xx.h | 2 | ||||
-rw-r--r-- | firmware/export/uda1380.h | 4 | ||||
-rw-r--r-- | firmware/export/wm8758.h | 4 | ||||
-rw-r--r-- | firmware/export/wm8975.h | 4 | ||||
-rw-r--r-- | firmware/export/wm8985.h | 4 |
6 files changed, 45 insertions, 8 deletions
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h index b3493b86d9..d450613aff 100644 --- a/firmware/export/audiohw.h +++ b/firmware/export/audiohw.h | |||
@@ -23,6 +23,10 @@ | |||
23 | #include "config.h" | 23 | #include "config.h" |
24 | #include <stdbool.h> | 24 | #include <stdbool.h> |
25 | 25 | ||
26 | /* define some audiohw caps */ | ||
27 | #define TREBLE_CAP (1 << 0) | ||
28 | #define BASS_CAP (1 << 1) | ||
29 | |||
26 | #ifdef HAVE_UDA1380 | 30 | #ifdef HAVE_UDA1380 |
27 | #include "uda1380.h" | 31 | #include "uda1380.h" |
28 | #elif defined(HAVE_WM8751) | 32 | #elif defined(HAVE_WM8751) |
@@ -49,6 +53,17 @@ | |||
49 | #include "tsc2100.h" | 53 | #include "tsc2100.h" |
50 | #endif | 54 | #endif |
51 | 55 | ||
56 | /* convert caps into defines */ | ||
57 | #ifdef AUDIOHW_CAPS | ||
58 | #if (AUDIOHW_CAPS & TREBLE_CAP) | ||
59 | #define AUDIOHW_HAVE_TREBLE | ||
60 | #endif | ||
61 | |||
62 | #if (AUDIOHW_CAPS & BASS_CAP) | ||
63 | #define AUDIOHW_HAVE_BASS | ||
64 | #endif | ||
65 | #endif /* AUDIOHW_CAPS */ | ||
66 | |||
52 | enum { | 67 | enum { |
53 | SOUND_VOLUME = 0, | 68 | SOUND_VOLUME = 0, |
54 | SOUND_BASS, | 69 | SOUND_BASS, |
@@ -141,6 +156,26 @@ void audiohw_mute(bool mute); | |||
141 | */ | 156 | */ |
142 | void audiohw_enable_output(bool enable); | 157 | void audiohw_enable_output(bool enable); |
143 | 158 | ||
159 | #ifdef AUDIOHW_HAVE_TREBLE | ||
160 | /** | ||
161 | * Set new treble value. | ||
162 | * @param val to set. | ||
163 | * NOTE: AUDIOHW_CAPS need to contain | ||
164 | * TREBLE_CAP | ||
165 | */ | ||
166 | void audiohw_set_treble(int val); | ||
167 | #endif | ||
168 | |||
169 | #ifdef AUDIOHW_HAVE_BASS | ||
170 | /** | ||
171 | * Set new bass value. | ||
172 | * @param val to set. | ||
173 | * NOTE: AUDIOHW_CAPS need to contain | ||
174 | * BASS_CAP | ||
175 | */ | ||
176 | void audiohw_set_bass(int val); | ||
177 | #endif | ||
178 | |||
144 | #ifdef HAVE_RECORDING | 179 | #ifdef HAVE_RECORDING |
145 | 180 | ||
146 | /** | 181 | /** |
diff --git a/firmware/export/mas35xx.h b/firmware/export/mas35xx.h index a4e2413344..dbe9d38a37 100644 --- a/firmware/export/mas35xx.h +++ b/firmware/export/mas35xx.h | |||
@@ -24,6 +24,8 @@ | |||
24 | 24 | ||
25 | #include "config.h" | 25 | #include "config.h" |
26 | 26 | ||
27 | #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP) | ||
28 | |||
27 | #if CONFIG_CODEC == MAS3507D | 29 | #if CONFIG_CODEC == MAS3507D |
28 | #define VOLUME_MIN -780 | 30 | #define VOLUME_MIN -780 |
29 | #define VOLUME_MAX 180 | 31 | #define VOLUME_MAX 180 |
diff --git a/firmware/export/uda1380.h b/firmware/export/uda1380.h index cd27536e87..c23f95265b 100644 --- a/firmware/export/uda1380.h +++ b/firmware/export/uda1380.h | |||
@@ -24,13 +24,13 @@ | |||
24 | #define VOLUME_MIN -840 | 24 | #define VOLUME_MIN -840 |
25 | #define VOLUME_MAX 0 | 25 | #define VOLUME_MAX 0 |
26 | 26 | ||
27 | #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP) | ||
28 | |||
27 | extern int tenthdb2master(int db); | 29 | extern int tenthdb2master(int db); |
28 | extern int tenthdb2mixer(int db); | 30 | extern int tenthdb2mixer(int db); |
29 | 31 | ||
30 | extern void audiohw_set_master_vol(int vol_l, int vol_r); | 32 | extern void audiohw_set_master_vol(int vol_l, int vol_r); |
31 | extern void audiohw_set_mixer_vol(int channel1, int channel2); | 33 | extern void audiohw_set_mixer_vol(int channel1, int channel2); |
32 | extern void audiohw_set_bass(int value); | ||
33 | extern void audiohw_set_treble(int value); | ||
34 | 34 | ||
35 | /** | 35 | /** |
36 | * Sets frequency settings for DAC and ADC relative to MCLK | 36 | * Sets frequency settings for DAC and ADC relative to MCLK |
diff --git a/firmware/export/wm8758.h b/firmware/export/wm8758.h index 61db094684..5e37e203d5 100644 --- a/firmware/export/wm8758.h +++ b/firmware/export/wm8758.h | |||
@@ -24,15 +24,15 @@ | |||
24 | #define VOLUME_MIN -570 | 24 | #define VOLUME_MIN -570 |
25 | #define VOLUME_MAX 60 | 25 | #define VOLUME_MAX 60 |
26 | 26 | ||
27 | #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP) | ||
28 | |||
27 | extern int tenthdb2master(int db); | 29 | extern int tenthdb2master(int db); |
28 | extern int tenthdb2mixer(int db); | 30 | extern int tenthdb2mixer(int db); |
29 | 31 | ||
30 | extern void audiohw_set_master_vol(int vol_l, int vol_r); | 32 | extern void audiohw_set_master_vol(int vol_l, int vol_r); |
31 | extern void audiohw_set_lineout_vol(int vol_l, int vol_r); | 33 | extern void audiohw_set_lineout_vol(int vol_l, int vol_r); |
32 | extern void audiohw_set_mixer_vol(int channel1, int channel2); | 34 | extern void audiohw_set_mixer_vol(int channel1, int channel2); |
33 | extern void audiohw_set_bass(int value); | ||
34 | extern void audiohw_set_bass_cutoff(int value); | 35 | extern void audiohw_set_bass_cutoff(int value); |
35 | extern void audiohw_set_treble(int value); | ||
36 | extern void audiohw_set_treble_cutoff(int value); | 36 | extern void audiohw_set_treble_cutoff(int value); |
37 | extern void audiohw_set_nsorder(int order); | 37 | extern void audiohw_set_nsorder(int order); |
38 | extern void audiohw_set_sample_rate(int sampling_control); | 38 | extern void audiohw_set_sample_rate(int sampling_control); |
diff --git a/firmware/export/wm8975.h b/firmware/export/wm8975.h index 1ae82061ee..6457f255f6 100644 --- a/firmware/export/wm8975.h +++ b/firmware/export/wm8975.h | |||
@@ -24,12 +24,12 @@ | |||
24 | #define VOLUME_MIN -730 | 24 | #define VOLUME_MIN -730 |
25 | #define VOLUME_MAX 60 | 25 | #define VOLUME_MAX 60 |
26 | 26 | ||
27 | #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP) | ||
28 | |||
27 | extern int tenthdb2master(int db); | 29 | extern int tenthdb2master(int db); |
28 | 30 | ||
29 | extern void audiohw_set_master_vol(int vol_l, int vol_r); | 31 | extern void audiohw_set_master_vol(int vol_l, int vol_r); |
30 | extern void audiohw_set_lineout_vol(int vol_l, int vol_r); | 32 | extern void audiohw_set_lineout_vol(int vol_l, int vol_r); |
31 | extern void audiohw_set_bass(int value); | ||
32 | extern void audiohw_set_treble(int value); | ||
33 | extern void audiohw_set_nsorder(int order); | 33 | extern void audiohw_set_nsorder(int order); |
34 | extern void audiohw_set_sample_rate(int sampling_control); | 34 | extern void audiohw_set_sample_rate(int sampling_control); |
35 | 35 | ||
diff --git a/firmware/export/wm8985.h b/firmware/export/wm8985.h index 8fa58425bf..8696e3dd6f 100644 --- a/firmware/export/wm8985.h +++ b/firmware/export/wm8985.h | |||
@@ -24,15 +24,15 @@ | |||
24 | #define VOLUME_MIN -570 | 24 | #define VOLUME_MIN -570 |
25 | #define VOLUME_MAX 60 | 25 | #define VOLUME_MAX 60 |
26 | 26 | ||
27 | #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP) | ||
28 | |||
27 | extern int tenthdb2master(int db); | 29 | extern int tenthdb2master(int db); |
28 | extern int tenthdb2mixer(int db); | 30 | extern int tenthdb2mixer(int db); |
29 | 31 | ||
30 | extern void audiohw_set_master_vol(int vol_l, int vol_r); | 32 | extern void audiohw_set_master_vol(int vol_l, int vol_r); |
31 | extern void audiohw_set_lineout_vol(int vol_l, int vol_r); | 33 | extern void audiohw_set_lineout_vol(int vol_l, int vol_r); |
32 | extern void audiohw_set_mixer_vol(int channel1, int channel2); | 34 | extern void audiohw_set_mixer_vol(int channel1, int channel2); |
33 | extern void audiohw_set_bass(int value); | ||
34 | extern void audiohw_set_bass_cutoff(int value); | 35 | extern void audiohw_set_bass_cutoff(int value); |
35 | extern void audiohw_set_treble(int value); | ||
36 | extern void audiohw_set_treble_cutoff(int value); | 36 | extern void audiohw_set_treble_cutoff(int value); |
37 | extern void audiohw_set_nsorder(int order); | 37 | extern void audiohw_set_nsorder(int order); |
38 | extern void audiohw_set_sample_rate(int sampling_control); | 38 | extern void audiohw_set_sample_rate(int sampling_control); |