diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2013-04-15 12:39:04 -0400 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2013-04-15 12:39:04 -0400 |
commit | 0971f576341cf38c04d2d9735f0a385e62974108 (patch) | |
tree | 0cf2d7c7ffd3915217b26927e76f2073cdd795ae | |
parent | 0c7b7873984e04941c9f21fa272638018fdb9a16 (diff) | |
download | rockbox-0971f576341cf38c04d2d9735f0a385e62974108.tar.gz rockbox-0971f576341cf38c04d2d9735f0a385e62974108.zip |
Hopefully knock out most of the red and yellow from 0c7b787.
Change-Id: Ib8dd0d011b11ee3eded3025308f19ddb5d151b59
-rw-r--r-- | firmware/drivers/audio/ak4537.c | 2 | ||||
-rw-r--r-- | firmware/drivers/audio/as3514.c | 4 | ||||
-rw-r--r-- | firmware/drivers/audio/cs42l55.c | 4 | ||||
-rw-r--r-- | firmware/drivers/audio/rk27xx_codec.c | 2 | ||||
-rw-r--r-- | firmware/drivers/audio/tsc2100.c | 2 | ||||
-rw-r--r-- | firmware/drivers/audio/uda1341.c | 2 | ||||
-rw-r--r-- | firmware/drivers/audio/wm8758.c | 2 | ||||
-rw-r--r-- | firmware/export/audiohw.h | 4 | ||||
-rw-r--r-- | firmware/export/config.h | 4 | ||||
-rw-r--r-- | firmware/export/mas35xx.h | 10 | ||||
-rw-r--r-- | firmware/export/uda1341.h | 3 | ||||
-rw-r--r-- | firmware/export/wm8751.h | 4 |
12 files changed, 24 insertions, 19 deletions
diff --git a/firmware/drivers/audio/ak4537.c b/firmware/drivers/audio/ak4537.c index 4a9010d4e7..6f4e85a7fa 100644 --- a/firmware/drivers/audio/ak4537.c +++ b/firmware/drivers/audio/ak4537.c | |||
@@ -207,7 +207,7 @@ void audiohw_close(void) | |||
207 | akcodec_close(); /* target-specific */ | 207 | akcodec_close(); /* target-specific */ |
208 | } | 208 | } |
209 | 209 | ||
210 | void audiohw_set_master_vol(int vol_l, int vol_r) | 210 | void audiohw_set_volume(int vol_l, int vol_r) |
211 | { | 211 | { |
212 | vol_l = vol_tenthdb2hw(vol_l); | 212 | vol_l = vol_tenthdb2hw(vol_l); |
213 | vol_r = vol_tenthdb2hw(vol_r); | 213 | vol_r = vol_tenthdb2hw(vol_r); |
diff --git a/firmware/drivers/audio/as3514.c b/firmware/drivers/audio/as3514.c index b9118f9fcf..e1c7f6575e 100644 --- a/firmware/drivers/audio/as3514.c +++ b/firmware/drivers/audio/as3514.c | |||
@@ -240,7 +240,7 @@ void audiohw_postinit(void) | |||
240 | audiohw_mute(false); | 240 | audiohw_mute(false); |
241 | } | 241 | } |
242 | 242 | ||
243 | void audiohw_set_master_vol(int vol_l, int vol_r) | 243 | void audiohw_set_volume(int vol_l, int vol_r) |
244 | { | 244 | { |
245 | unsigned int hph_r, hph_l; | 245 | unsigned int hph_r, hph_l; |
246 | unsigned int mix_l, mix_r; | 246 | unsigned int mix_l, mix_r; |
@@ -298,7 +298,7 @@ void audiohw_set_lineout_volume(int vol_l, int vol_r) | |||
298 | { | 298 | { |
299 | #ifdef HAVE_AS3543 | 299 | #ifdef HAVE_AS3543 |
300 | /* line out volume is set in the same registers */ | 300 | /* line out volume is set in the same registers */ |
301 | audiohw_set_master_volume(vol_l, vol_r); | 301 | audiohw_set_volume(vol_l, vol_r); |
302 | #else | 302 | #else |
303 | vol_l = vol_tenthdb2hw(vol_l); | 303 | vol_l = vol_tenthdb2hw(vol_l); |
304 | vol_r = vol_tenthdb2hw(vol_r); | 304 | vol_r = vol_tenthdb2hw(vol_r); |
diff --git a/firmware/drivers/audio/cs42l55.c b/firmware/drivers/audio/cs42l55.c index 75fcd80b77..6c6e17abd4 100644 --- a/firmware/drivers/audio/cs42l55.c +++ b/firmware/drivers/audio/cs42l55.c | |||
@@ -111,7 +111,7 @@ void audiohw_postinit(void) | |||
111 | audiohw_mute(false); | 111 | audiohw_mute(false); |
112 | } | 112 | } |
113 | 113 | ||
114 | void audiohw_set_master_vol(int vol_l, int vol_r) | 114 | void audiohw_set_volume(int vol_l, int vol_r) |
115 | { | 115 | { |
116 | vol_l = vol_tenthdb2hw(vol_l); | 116 | vol_l = vol_tenthdb2hw(vol_l); |
117 | vol_r = vol_tenthdb2hw(vol_r); | 117 | vol_r = vol_tenthdb2hw(vol_r); |
@@ -121,7 +121,7 @@ void audiohw_set_master_vol(int vol_l, int vol_r) | |||
121 | vol_r << HPBCTL_HPBVOL_SHIFT); | 121 | vol_r << HPBCTL_HPBVOL_SHIFT); |
122 | } | 122 | } |
123 | 123 | ||
124 | void audiohw_set_lineout_vol(int vol_l, int vol_r) | 124 | void audiohw_set_lineout_volume(int vol_l, int vol_r) |
125 | { | 125 | { |
126 | vol_l = vol_tenthdb2hw(vol_l); | 126 | vol_l = vol_tenthdb2hw(vol_l); |
127 | vol_r = vol_tenthdb2hw(vol_r); | 127 | vol_r = vol_tenthdb2hw(vol_r); |
diff --git a/firmware/drivers/audio/rk27xx_codec.c b/firmware/drivers/audio/rk27xx_codec.c index aada17cc0a..8f294ba9f3 100644 --- a/firmware/drivers/audio/rk27xx_codec.c +++ b/firmware/drivers/audio/rk27xx_codec.c | |||
@@ -133,7 +133,7 @@ void audiohw_set_frequency(int fsel) | |||
133 | codec_write(CCR2, values_freq[fsel]); | 133 | codec_write(CCR2, values_freq[fsel]); |
134 | } | 134 | } |
135 | 135 | ||
136 | void audiohw_set_master_vol(int vol_l, int vol_r) | 136 | void audiohw_set_volume(int vol_l, int vol_r) |
137 | { | 137 | { |
138 | vol_l = vol_tenthdb2hw(vol_l); | 138 | vol_l = vol_tenthdb2hw(vol_l); |
139 | vol_r = vol_tenthdb2hw(vol_r); | 139 | vol_r = vol_tenthdb2hw(vol_r); |
diff --git a/firmware/drivers/audio/tsc2100.c b/firmware/drivers/audio/tsc2100.c index 41327ae3d7..fda192a62a 100644 --- a/firmware/drivers/audio/tsc2100.c +++ b/firmware/drivers/audio/tsc2100.c | |||
@@ -74,7 +74,7 @@ void audiohw_postinit(void) | |||
74 | audiohw_mute(false); | 74 | audiohw_mute(false); |
75 | } | 75 | } |
76 | 76 | ||
77 | void audiohw_set_master_volume(int vol_l, int vol_r) | 77 | void audiohw_set_volume(int vol_l, int vol_r) |
78 | { | 78 | { |
79 | vol_l = vol_tenthdb2hw(vol_l); | 79 | vol_l = vol_tenthdb2hw(vol_l); |
80 | vol_r = vol_tenthdb2hw(vol_r); | 80 | vol_r = vol_tenthdb2hw(vol_r); |
diff --git a/firmware/drivers/audio/uda1341.c b/firmware/drivers/audio/uda1341.c index ac3bcedb7d..e15cd39bfc 100644 --- a/firmware/drivers/audio/uda1341.c +++ b/firmware/drivers/audio/uda1341.c | |||
@@ -166,7 +166,7 @@ void audiohw_init(void) | |||
166 | 166 | ||
167 | audiohw_set_bass (0); | 167 | audiohw_set_bass (0); |
168 | audiohw_set_treble (0); | 168 | audiohw_set_treble (0); |
169 | audiohw_set_master_vol (26, 26); /* -25 dB */ | 169 | audiohw_set_volume (-250); /* -25 dB */ |
170 | } | 170 | } |
171 | 171 | ||
172 | void audiohw_postinit(void) | 172 | void audiohw_postinit(void) |
diff --git a/firmware/drivers/audio/wm8758.c b/firmware/drivers/audio/wm8758.c index 3e0c88c55c..387a1a48c4 100644 --- a/firmware/drivers/audio/wm8758.c +++ b/firmware/drivers/audio/wm8758.c | |||
@@ -134,7 +134,7 @@ void audiohw_postinit(void) | |||
134 | audiohw_mute(false); | 134 | audiohw_mute(false); |
135 | } | 135 | } |
136 | 136 | ||
137 | void audiohw_set_master_vol(int vol_l, int vol_r) | 137 | void audiohw_set_volume(int vol_l, int vol_r) |
138 | { | 138 | { |
139 | int dac_l, amp_l, dac_r, amp_r; | 139 | int dac_l, amp_l, dac_r, amp_r; |
140 | get_volume_params(vol_l, &dac_l, &_l); | 140 | get_volume_params(vol_l, &dac_l, &_l); |
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h index e18e996282..4bd4ecb019 100644 --- a/firmware/export/audiohw.h +++ b/firmware/export/audiohw.h | |||
@@ -54,15 +54,13 @@ struct sound_settings_info | |||
54 | short defaultval; | 54 | short defaultval; |
55 | }; | 55 | }; |
56 | 56 | ||
57 | #undef AUDIOHW_SETTING /* will have been #defined in config.h as empty */ | ||
57 | #define AUDIOHW_SETTING(name, us, nd, st, minv, maxv, defv, expr...) \ | 58 | #define AUDIOHW_SETTING(name, us, nd, st, minv, maxv, defv, expr...) \ |
58 | static const struct sound_settings_info _audiohw_setting_##name = \ | 59 | static const struct sound_settings_info _audiohw_setting_##name = \ |
59 | { .unit = us, .numdecimals = nd, .steps = st, \ | 60 | { .unit = us, .numdecimals = nd, .steps = st, \ |
60 | .minval = minv, .maxval = maxv, .defaultval = defv }; \ | 61 | .minval = minv, .maxval = maxv, .defaultval = defv }; \ |
61 | static inline int _sound_val2phys_##name(int val) \ | 62 | static inline int _sound_val2phys_##name(int val) \ |
62 | { return #expr[0] ? expr : val; } | 63 | { return #expr[0] ? expr : val; } |
63 | #else | ||
64 | /* ...otherwise these produce nothing. */ | ||
65 | #define AUDIOHW_SETTING(name, us, nd, st, minv, maxv, defv, expr...) | ||
66 | #endif | 64 | #endif |
67 | 65 | ||
68 | #ifdef HAVE_UDA1380 | 66 | #ifdef HAVE_UDA1380 |
diff --git a/firmware/export/config.h b/firmware/export/config.h index ec69e53157..6a4a4648c8 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -1139,4 +1139,8 @@ Lyre prototype 1 */ | |||
1139 | #define ROCKBOX_HAS_LOGDISKF | 1139 | #define ROCKBOX_HAS_LOGDISKF |
1140 | #endif | 1140 | #endif |
1141 | 1141 | ||
1142 | /* null audiohw setting macro for when codec header is included for reasons | ||
1143 | other than audio support */ | ||
1144 | #define AUDIOHW_SETTING(name, us, nd, st, minv, maxv, defv, expr...) | ||
1145 | |||
1142 | #endif /* __CONFIG_H__ */ | 1146 | #endif /* __CONFIG_H__ */ |
diff --git a/firmware/export/mas35xx.h b/firmware/export/mas35xx.h index 7643e0efdc..3f7912f856 100644 --- a/firmware/export/mas35xx.h +++ b/firmware/export/mas35xx.h | |||
@@ -178,13 +178,13 @@ AUDIOHW_SETTING(VOLUME, "dB", 0, 1,-100, 12, -25) | |||
178 | AUDIOHW_SETTING(BASS, "dB", 0, 1, -12, 12, 6) | 178 | AUDIOHW_SETTING(BASS, "dB", 0, 1, -12, 12, 6) |
179 | AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -12, 12, 6) | 179 | AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -12, 12, 6) |
180 | AUDIOHW_SETTING(LOUDNESS, "dB", 0, 1, 0, 17, 0) | 180 | AUDIOHW_SETTING(LOUDNESS, "dB", 0, 1, 0, 17, 0) |
181 | AUDIOHW_SETTING(AVC "", 0, 1, -1, 4, 0) | 181 | AUDIOHW_SETTING(AVC, "", 0, 1, -1, 4, 0) |
182 | AUDIOHW_SETTING(MDB_STRENGTH, "dB", 0, 1, 0, 127, 48) | 182 | AUDIOHW_SETTING(MDB_STRENGTH, "dB", 0, 1, 0, 127, 48) |
183 | AUDIOHW_SETTING(MDB_HARMONICS, "%", 0, 1, 0, 100, 50) | 183 | AUDIOHW_SETTING(MDB_HARMONICS, "%", 0, 1, 0, 100, 50) |
184 | AUDIOHW_SETTING(MDB_CENTER "Hz", 0, 10, 20, 300, 60) | 184 | AUDIOHW_SETTING(MDB_CENTER, "Hz", 0, 10, 20, 300, 60) |
185 | AUDIOHW_SETTING(MDB_SHAPE "Hz", 0, 10, 50, 300, 90) | 185 | AUDIOHW_SETTING(MDB_SHAPE, "Hz", 0, 10, 50, 300, 90) |
186 | AUDIOHW_SETTING(MDB_ENABLE "", 0, 1, 0, 1, 0) | 186 | AUDIOHW_SETTING(MDB_ENABLE, "", 0, 1, 0, 1, 0) |
187 | AUDIOHW_SETTING(SUPERBASS "", 0, 1, 0, 1, 0) | 187 | AUDIOHW_SETTING(SUPERBASS, "", 0, 1, 0, 1, 0) |
188 | 188 | ||
189 | #if CONFIG_CODEC == MAS3587F && defined(HAVE_RECORDING) | 189 | #if CONFIG_CODEC == MAS3587F && defined(HAVE_RECORDING) |
190 | /* MAS3587F and MAS3539F handle clipping prevention internally so we do not | 190 | /* MAS3587F and MAS3539F handle clipping prevention internally so we do not |
diff --git a/firmware/export/uda1341.h b/firmware/export/uda1341.h index 5641bd301f..81eb1a3fa9 100644 --- a/firmware/export/uda1341.h +++ b/firmware/export/uda1341.h | |||
@@ -26,7 +26,8 @@ | |||
26 | #define VOLUME_MIN -840 | 26 | #define VOLUME_MIN -840 |
27 | #define VOLUME_MAX 0 | 27 | #define VOLUME_MAX 0 |
28 | 28 | ||
29 | #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | MIC_GAIN_CAP | LIN_GAIN_CAP) | 29 | #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | MIC_GAIN_CAP | LIN_GAIN_CAP\ |
30 | | MONO_VOL_CAP) | ||
30 | 31 | ||
31 | AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -84, 0, -25) | 32 | AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -84, 0, -25) |
32 | AUDIOHW_SETTING(BASS, "dB", 0, 2, 0, 24, 0) | 33 | AUDIOHW_SETTING(BASS, "dB", 0, 2, 0, 24, 0) |
diff --git a/firmware/export/wm8751.h b/firmware/export/wm8751.h index 6e7bb245dd..c19bd153eb 100644 --- a/firmware/export/wm8751.h +++ b/firmware/export/wm8751.h | |||
@@ -25,11 +25,13 @@ | |||
25 | #define VOLUME_MIN -730 | 25 | #define VOLUME_MIN -730 |
26 | #define VOLUME_MAX 60 | 26 | #define VOLUME_MAX 60 |
27 | 27 | ||
28 | #define AUDIOHW_SETTING(name, us, nd, st, minv, maxv, defv, expr...) | ||
29 | |||
30 | #if defined(HAVE_WM8750) | ||
28 | #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | \ | 31 | #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | \ |
29 | BASS_CUTOFF_CAP | TREBLE_CUTOFF_CAP | \ | 32 | BASS_CUTOFF_CAP | TREBLE_CUTOFF_CAP | \ |
30 | DEPTH_3D_CAP | LIN_GAIN_CAP | MIC_GAIN_CAP) | 33 | DEPTH_3D_CAP | LIN_GAIN_CAP | MIC_GAIN_CAP) |
31 | 34 | ||
32 | #if defined(HAVE_WM8750) | ||
33 | AUDIOHW_SETTING(DEPTH_3D, "%", 0, 1, 0, 15, 0, (100 * val + 8) / 15) | 35 | AUDIOHW_SETTING(DEPTH_3D, "%", 0, 1, 0, 15, 0, (100 * val + 8) / 15) |
34 | #ifdef HAVE_RECORDING | 36 | #ifdef HAVE_RECORDING |
35 | /* PGA -17.25dB to 30.0dB in 0.75dB increments 64 steps | 37 | /* PGA -17.25dB to 30.0dB in 0.75dB increments 64 steps |