summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2016-08-21 20:28:13 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2016-12-12 13:12:15 +0100
commit90a32ccad61c506fb021feb0e983e9c2aade8876 (patch)
tree14ab80e977f5bdf20ec2c6fb34d27a769bcb4616
parentcc031d41ab89daa06789fb28c0c1992a7928847a (diff)
downloadrockbox-90a32ccad61c506fb021feb0e983e9c2aade8876.tar.gz
rockbox-90a32ccad61c506fb021feb0e983e9c2aade8876.zip
wm8751: document and fix audiohw settings
Document 3D depth range. Fix mismatch in recording volume: the displayed volume is completely off the chart Change-Id: I4c363f369e5d72f332391a6f96457b4e450404f9
-rw-r--r--firmware/drivers/audio/wm8751.c4
-rw-r--r--firmware/export/wm8751.h13
2 files changed, 11 insertions, 6 deletions
diff --git a/firmware/drivers/audio/wm8751.c b/firmware/drivers/audio/wm8751.c
index 7b6a2712e5..1b4af3eca8 100644
--- a/firmware/drivers/audio/wm8751.c
+++ b/firmware/drivers/audio/wm8751.c
@@ -385,7 +385,8 @@ void audiohw_set_frequency(int fsel)
385 385
386#ifdef HAVE_WM8750 386#ifdef HAVE_WM8750
387#ifdef AUDIOHW_HAVE_DEPTH_3D 387#ifdef AUDIOHW_HAVE_DEPTH_3D
388/* Set the depth of the 3D effect */ 388/* Set the depth of the 3D effect
389 * value in 0 .. 15, corresponds to 0% .. 100% in 6.66% steps */
389void audiohw_set_depth_3d(int val) 390void audiohw_set_depth_3d(int val)
390{ 391{
391 if (val > 0) 392 if (val > 0)
@@ -631,6 +632,7 @@ static int pga_gain2hw(int value)
631 return ((4 * value) / 300) + 23; 632 return ((4 * value) / 300) + 23;
632} 633}
633 634
635/* volume in hundredth of dB in -1725 .. 6000 */
634void audiohw_set_recvol(int vol_l, int vol_r, int type) 636void audiohw_set_recvol(int vol_l, int vol_r, int type)
635{ 637{
636 int d_vol_l = 0; 638 int d_vol_l = 0;
diff --git a/firmware/export/wm8751.h b/firmware/export/wm8751.h
index 214643c64d..9b66981129 100644
--- a/firmware/export/wm8751.h
+++ b/firmware/export/wm8751.h
@@ -25,18 +25,21 @@
25#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | \ 25#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | \
26 BASS_CUTOFF_CAP | TREBLE_CUTOFF_CAP | \ 26 BASS_CUTOFF_CAP | TREBLE_CUTOFF_CAP | \
27 DEPTH_3D_CAP | LIN_GAIN_CAP | MIC_GAIN_CAP) 27 DEPTH_3D_CAP | LIN_GAIN_CAP | MIC_GAIN_CAP)
28 28/* Percentage from 0% to 100% in steps of 6.66%:
29 * Values: 0, 1, 2, ... 14, 15
30 * => 0%, 6%, 14%, ..., 93%, 100%
31 */
29AUDIOHW_SETTING(DEPTH_3D, "%", 0, 1, 0, 15, 0, (100 * val + 8) / 15) 32AUDIOHW_SETTING(DEPTH_3D, "%", 0, 1, 0, 15, 0, (100 * val + 8) / 15)
30#ifdef HAVE_RECORDING 33#ifdef HAVE_RECORDING
31 /* PGA -17.25dB to 30.0dB in 0.75dB increments 64 steps 34 /* PGA -17.25dB to 30.0dB in 0.75dB increments 64 steps
32 * digital gain 0dB to 30.0dB in 0.5dB increments 35 * digital gain 0dB to 30.0dB in 0.5dB increments
33 * we use 0.75dB fake steps through whole range 36 * we use 0.75dB fake steps through whole range
34 * 37 *
35 * This combined gives -17.25 to 60.0dB 38 * This combined gives -17.25 to 60.0dB
36 */ 39 */
37AUDIOHW_SETTING(LEFT_GAIN, "dB", 2, 75,-1725, 6000, 0, val * 5) 40AUDIOHW_SETTING(LEFT_GAIN, "dB", 2, 75,-1725, 6000, 0)
38AUDIOHW_SETTING(RIGHT_GAIN, "dB", 2, 75,-1725, 6000, 0, val * 5) 41AUDIOHW_SETTING(RIGHT_GAIN, "dB", 2, 75,-1725, 6000, 0)
39AUDIOHW_SETTING(MIC_GAIN, "dB", 2, 75,-1725, 6000, 3000, val * 5) 42AUDIOHW_SETTING(MIC_GAIN, "dB", 2, 75,-1725, 6000, 3000)
40 43
41void audiohw_set_recsrc(int source, bool recording); 44void audiohw_set_recsrc(int source, bool recording);
42#endif /* HAVE_RECORDING */ 45#endif /* HAVE_RECORDING */