Hopefully knock out most of the red and yellow from 0c7b787.

Change-Id: Ib8dd0d011b11ee3eded3025308f19ddb5d151b59
This commit is contained in:
Michael Sevakis 2013-04-15 12:39:04 -04:00
parent 0c7b787398
commit 0971f57634
12 changed files with 24 additions and 19 deletions

View file

@ -207,7 +207,7 @@ void audiohw_close(void)
akcodec_close(); /* target-specific */ akcodec_close(); /* target-specific */
} }
void audiohw_set_master_vol(int vol_l, int vol_r) void audiohw_set_volume(int vol_l, int vol_r)
{ {
vol_l = vol_tenthdb2hw(vol_l); vol_l = vol_tenthdb2hw(vol_l);
vol_r = vol_tenthdb2hw(vol_r); vol_r = vol_tenthdb2hw(vol_r);

View file

@ -240,7 +240,7 @@ void audiohw_postinit(void)
audiohw_mute(false); audiohw_mute(false);
} }
void audiohw_set_master_vol(int vol_l, int vol_r) void audiohw_set_volume(int vol_l, int vol_r)
{ {
unsigned int hph_r, hph_l; unsigned int hph_r, hph_l;
unsigned int mix_l, mix_r; unsigned int mix_l, mix_r;
@ -298,7 +298,7 @@ void audiohw_set_lineout_volume(int vol_l, int vol_r)
{ {
#ifdef HAVE_AS3543 #ifdef HAVE_AS3543
/* line out volume is set in the same registers */ /* line out volume is set in the same registers */
audiohw_set_master_volume(vol_l, vol_r); audiohw_set_volume(vol_l, vol_r);
#else #else
vol_l = vol_tenthdb2hw(vol_l); vol_l = vol_tenthdb2hw(vol_l);
vol_r = vol_tenthdb2hw(vol_r); vol_r = vol_tenthdb2hw(vol_r);

View file

@ -111,7 +111,7 @@ void audiohw_postinit(void)
audiohw_mute(false); audiohw_mute(false);
} }
void audiohw_set_master_vol(int vol_l, int vol_r) void audiohw_set_volume(int vol_l, int vol_r)
{ {
vol_l = vol_tenthdb2hw(vol_l); vol_l = vol_tenthdb2hw(vol_l);
vol_r = vol_tenthdb2hw(vol_r); vol_r = vol_tenthdb2hw(vol_r);
@ -121,7 +121,7 @@ void audiohw_set_master_vol(int vol_l, int vol_r)
vol_r << HPBCTL_HPBVOL_SHIFT); vol_r << HPBCTL_HPBVOL_SHIFT);
} }
void audiohw_set_lineout_vol(int vol_l, int vol_r) void audiohw_set_lineout_volume(int vol_l, int vol_r)
{ {
vol_l = vol_tenthdb2hw(vol_l); vol_l = vol_tenthdb2hw(vol_l);
vol_r = vol_tenthdb2hw(vol_r); vol_r = vol_tenthdb2hw(vol_r);

View file

@ -133,7 +133,7 @@ void audiohw_set_frequency(int fsel)
codec_write(CCR2, values_freq[fsel]); codec_write(CCR2, values_freq[fsel]);
} }
void audiohw_set_master_vol(int vol_l, int vol_r) void audiohw_set_volume(int vol_l, int vol_r)
{ {
vol_l = vol_tenthdb2hw(vol_l); vol_l = vol_tenthdb2hw(vol_l);
vol_r = vol_tenthdb2hw(vol_r); vol_r = vol_tenthdb2hw(vol_r);

View file

@ -74,7 +74,7 @@ void audiohw_postinit(void)
audiohw_mute(false); audiohw_mute(false);
} }
void audiohw_set_master_volume(int vol_l, int vol_r) void audiohw_set_volume(int vol_l, int vol_r)
{ {
vol_l = vol_tenthdb2hw(vol_l); vol_l = vol_tenthdb2hw(vol_l);
vol_r = vol_tenthdb2hw(vol_r); vol_r = vol_tenthdb2hw(vol_r);

View file

@ -166,7 +166,7 @@ void audiohw_init(void)
audiohw_set_bass (0); audiohw_set_bass (0);
audiohw_set_treble (0); audiohw_set_treble (0);
audiohw_set_master_vol (26, 26); /* -25 dB */ audiohw_set_volume (-250); /* -25 dB */
} }
void audiohw_postinit(void) void audiohw_postinit(void)

View file

@ -134,7 +134,7 @@ void audiohw_postinit(void)
audiohw_mute(false); audiohw_mute(false);
} }
void audiohw_set_master_vol(int vol_l, int vol_r) void audiohw_set_volume(int vol_l, int vol_r)
{ {
int dac_l, amp_l, dac_r, amp_r; int dac_l, amp_l, dac_r, amp_r;
get_volume_params(vol_l, &dac_l, &amp_l); get_volume_params(vol_l, &dac_l, &amp_l);

View file

@ -54,15 +54,13 @@ struct sound_settings_info
short defaultval; short defaultval;
}; };
#undef AUDIOHW_SETTING /* will have been #defined in config.h as empty */
#define AUDIOHW_SETTING(name, us, nd, st, minv, maxv, defv, expr...) \ #define AUDIOHW_SETTING(name, us, nd, st, minv, maxv, defv, expr...) \
static const struct sound_settings_info _audiohw_setting_##name = \ static const struct sound_settings_info _audiohw_setting_##name = \
{ .unit = us, .numdecimals = nd, .steps = st, \ { .unit = us, .numdecimals = nd, .steps = st, \
.minval = minv, .maxval = maxv, .defaultval = defv }; \ .minval = minv, .maxval = maxv, .defaultval = defv }; \
static inline int _sound_val2phys_##name(int val) \ static inline int _sound_val2phys_##name(int val) \
{ return #expr[0] ? expr : val; } { return #expr[0] ? expr : val; }
#else
/* ...otherwise these produce nothing. */
#define AUDIOHW_SETTING(name, us, nd, st, minv, maxv, defv, expr...)
#endif #endif
#ifdef HAVE_UDA1380 #ifdef HAVE_UDA1380

View file

@ -1139,4 +1139,8 @@ Lyre prototype 1 */
#define ROCKBOX_HAS_LOGDISKF #define ROCKBOX_HAS_LOGDISKF
#endif #endif
/* null audiohw setting macro for when codec header is included for reasons
other than audio support */
#define AUDIOHW_SETTING(name, us, nd, st, minv, maxv, defv, expr...)
#endif /* __CONFIG_H__ */ #endif /* __CONFIG_H__ */

View file

@ -178,13 +178,13 @@ AUDIOHW_SETTING(VOLUME, "dB", 0, 1,-100, 12, -25)
AUDIOHW_SETTING(BASS, "dB", 0, 1, -12, 12, 6) AUDIOHW_SETTING(BASS, "dB", 0, 1, -12, 12, 6)
AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -12, 12, 6) AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -12, 12, 6)
AUDIOHW_SETTING(LOUDNESS, "dB", 0, 1, 0, 17, 0) AUDIOHW_SETTING(LOUDNESS, "dB", 0, 1, 0, 17, 0)
AUDIOHW_SETTING(AVC "", 0, 1, -1, 4, 0) AUDIOHW_SETTING(AVC, "", 0, 1, -1, 4, 0)
AUDIOHW_SETTING(MDB_STRENGTH, "dB", 0, 1, 0, 127, 48) AUDIOHW_SETTING(MDB_STRENGTH, "dB", 0, 1, 0, 127, 48)
AUDIOHW_SETTING(MDB_HARMONICS, "%", 0, 1, 0, 100, 50) AUDIOHW_SETTING(MDB_HARMONICS, "%", 0, 1, 0, 100, 50)
AUDIOHW_SETTING(MDB_CENTER "Hz", 0, 10, 20, 300, 60) AUDIOHW_SETTING(MDB_CENTER, "Hz", 0, 10, 20, 300, 60)
AUDIOHW_SETTING(MDB_SHAPE "Hz", 0, 10, 50, 300, 90) AUDIOHW_SETTING(MDB_SHAPE, "Hz", 0, 10, 50, 300, 90)
AUDIOHW_SETTING(MDB_ENABLE "", 0, 1, 0, 1, 0) AUDIOHW_SETTING(MDB_ENABLE, "", 0, 1, 0, 1, 0)
AUDIOHW_SETTING(SUPERBASS "", 0, 1, 0, 1, 0) AUDIOHW_SETTING(SUPERBASS, "", 0, 1, 0, 1, 0)
#if CONFIG_CODEC == MAS3587F && defined(HAVE_RECORDING) #if CONFIG_CODEC == MAS3587F && defined(HAVE_RECORDING)
/* MAS3587F and MAS3539F handle clipping prevention internally so we do not /* MAS3587F and MAS3539F handle clipping prevention internally so we do not

View file

@ -26,7 +26,8 @@
#define VOLUME_MIN -840 #define VOLUME_MIN -840
#define VOLUME_MAX 0 #define VOLUME_MAX 0
#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | MIC_GAIN_CAP | LIN_GAIN_CAP) #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | MIC_GAIN_CAP | LIN_GAIN_CAP\
| MONO_VOL_CAP)
AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -84, 0, -25) AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -84, 0, -25)
AUDIOHW_SETTING(BASS, "dB", 0, 2, 0, 24, 0) AUDIOHW_SETTING(BASS, "dB", 0, 2, 0, 24, 0)

View file

@ -25,11 +25,13 @@
#define VOLUME_MIN -730 #define VOLUME_MIN -730
#define VOLUME_MAX 60 #define VOLUME_MAX 60
#define AUDIOHW_SETTING(name, us, nd, st, minv, maxv, defv, expr...)
#if defined(HAVE_WM8750)
#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | \ #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | \
BASS_CUTOFF_CAP | TREBLE_CUTOFF_CAP | \ BASS_CUTOFF_CAP | TREBLE_CUTOFF_CAP | \
DEPTH_3D_CAP | LIN_GAIN_CAP | MIC_GAIN_CAP) DEPTH_3D_CAP | LIN_GAIN_CAP | MIC_GAIN_CAP)
#if defined(HAVE_WM8750)
AUDIOHW_SETTING(DEPTH_3D, "%", 0, 1, 0, 15, 0, (100 * val + 8) / 15) AUDIOHW_SETTING(DEPTH_3D, "%", 0, 1, 0, 15, 0, (100 * val + 8) / 15)
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
/* PGA -17.25dB to 30.0dB in 0.75dB increments 64 steps /* PGA -17.25dB to 30.0dB in 0.75dB increments 64 steps