diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2013-04-12 23:35:47 -0400 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2013-04-15 12:02:05 -0400 |
commit | 0c7b7873984e04941c9f21fa272638018fdb9a16 (patch) | |
tree | fb6afca45d2bef0a2c91732a39ffc0b965f5c557 /firmware/export/wm8751.h | |
parent | fd9e2568908f91b5bcf7378dc28f6ec070d6027a (diff) | |
download | rockbox-0c7b7873984e04941c9f21fa272638018fdb9a16.tar.gz rockbox-0c7b7873984e04941c9f21fa272638018fdb9a16.zip |
Straighten out the mad twisted state of sound.c and related areas.
This is going right in since it's long overdue. If anything is goofed,
drop me a line or just tweak it yourself if you know what's wrong. :-)
Make HW/SW codec interface more uniform when emulating HW functionality
on SWCODEC for functions such as "audiohw_set_pitch". The firmware-to-
DSP plumbing is in firmware/drivers/audiohw-swcodec.c. "sound_XXX"
APIs are all in sound.c with none in DSP code any longer.
Reduce number of settings definitions needed by each codec by providing
defaults for common ones like balance, channels and SW tone controls.
Remove need for separate SIM code and tables and add virtual codec header
for hosted targets.
Change-Id: I3f23702bca054fc9bda40f49824ce681bb7f777b
Diffstat (limited to 'firmware/export/wm8751.h')
-rw-r--r-- | firmware/export/wm8751.h | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/firmware/export/wm8751.h b/firmware/export/wm8751.h index 3bbf744463..6e7bb245dd 100644 --- a/firmware/export/wm8751.h +++ b/firmware/export/wm8751.h | |||
@@ -25,23 +25,36 @@ | |||
25 | #define VOLUME_MIN -730 | 25 | #define VOLUME_MIN -730 |
26 | #define VOLUME_MAX 60 | 26 | #define VOLUME_MAX 60 |
27 | 27 | ||
28 | #if defined(HAVE_WM8750) | ||
29 | #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | \ | 28 | #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | \ |
30 | BASS_CUTOFF_CAP | TREBLE_CUTOFF_CAP | \ | 29 | BASS_CUTOFF_CAP | TREBLE_CUTOFF_CAP | \ |
31 | DEPTH_3D_CAP) | 30 | DEPTH_3D_CAP | LIN_GAIN_CAP | MIC_GAIN_CAP) |
32 | #else | ||
33 | 31 | ||
34 | #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | \ | 32 | #if defined(HAVE_WM8750) |
35 | BASS_CUTOFF_CAP | TREBLE_CUTOFF_CAP) | 33 | AUDIOHW_SETTING(DEPTH_3D, "%", 0, 1, 0, 15, 0, (100 * val + 8) / 15) |
36 | #endif | 34 | #ifdef HAVE_RECORDING |
37 | 35 | /* PGA -17.25dB to 30.0dB in 0.75dB increments 64 steps | |
38 | extern int tenthdb2master(int db); | 36 | * digital gain 0dB to 30.0dB in 0.5dB increments |
37 | * we use 0.75dB fake steps through whole range | ||
38 | * | ||
39 | * This combined gives -17.25 to 60.0dB | ||
40 | */ | ||
41 | AUDIOHW_SETTING(LEFT_GAIN, "dB", 2, 75,-1725, 6000, 0, val * 5) | ||
42 | AUDIOHW_SETTING(RIGHT_GAIN, "dB", 2, 75,-1725, 6000, 0, val * 5) | ||
43 | AUDIOHW_SETTING(MIC_GAIN, "dB", 2, 75,-1725, 6000, 3000, val * 5) | ||
39 | 44 | ||
40 | extern void audiohw_set_master_vol(int vol_l, int vol_r); | ||
41 | extern void audiohw_set_lineout_vol(int vol_l, int vol_r); | ||
42 | #if defined(HAVE_WM8750) && defined(HAVE_RECORDING) | ||
43 | void audiohw_set_recsrc(int source, bool recording); | 45 | void audiohw_set_recsrc(int source, bool recording); |
44 | #endif | 46 | #endif /* HAVE_RECORDING */ |
47 | #else /* !HAVE_WM8750 */ | ||
48 | #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | \ | ||
49 | BASS_CUTOFF_CAP | TREBLE_CUTOFF_CAP | \ | ||
50 | LINEOUT_CAP) | ||
51 | #endif /* HAVE_WM8750 */ | ||
52 | |||
53 | AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -74, 6, -25) | ||
54 | AUDIOHW_SETTING(BASS, "dB", 1, 15, -60, 90, 0) | ||
55 | AUDIOHW_SETTING(TREBLE, "dB", 1, 15, -60, 90, 0) | ||
56 | AUDIOHW_SETTING(BASS_CUTOFF, "Hz", 0, 70, 130, 200, 200) | ||
57 | AUDIOHW_SETTING(TREBLE_CUTOFF, "kHz", 0, 4, 4, 8, 4) | ||
45 | 58 | ||
46 | /* Register addresses and bits */ | 59 | /* Register addresses and bits */ |
47 | #define OUTPUT_MUTED 0x2f | 60 | #define OUTPUT_MUTED 0x2f |
@@ -348,4 +361,5 @@ void audiohw_set_recsrc(int source, bool recording); | |||
348 | #define MONOOUT_MOZC (1 << 7) | 361 | #define MONOOUT_MOZC (1 << 7) |
349 | 362 | ||
350 | #define WM_NUM_REGS 0x2b | 363 | #define WM_NUM_REGS 0x2b |
364 | |||
351 | #endif /* _WM8751_H */ | 365 | #endif /* _WM8751_H */ |