summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/drivers/audio/wm8975.c2
-rw-r--r--firmware/export/wm8975.h5
2 files changed, 7 insertions, 0 deletions
diff --git a/firmware/drivers/audio/wm8975.c b/firmware/drivers/audio/wm8975.c
index 88be2cf5ce..a1af1331f2 100644
--- a/firmware/drivers/audio/wm8975.c
+++ b/firmware/drivers/audio/wm8975.c
@@ -296,6 +296,8 @@ void audiohw_disable_recording(void)
296 wm8975_write(PWRMGMT1, wm8975_regs[PWRMGMT1]); 296 wm8975_write(PWRMGMT1, wm8975_regs[PWRMGMT1]);
297} 297}
298 298
299/* volume in 0 .. 63, corresponds to -17.25dB .. 30dB in steps of 0.75dB
300 * microphone has an extra 20dB boost so 0 .. 63 corresponds to 2.75dB .. 50dB */
299void audiohw_set_recvol(int left, int right, int type) 301void audiohw_set_recvol(int left, int right, int type)
300{ 302{
301 switch (type) 303 switch (type)
diff --git a/firmware/export/wm8975.h b/firmware/export/wm8975.h
index cdae7af865..b8ef17910c 100644
--- a/firmware/export/wm8975.h
+++ b/firmware/export/wm8975.h
@@ -29,8 +29,13 @@ AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -74, 6, -25)
29AUDIOHW_SETTING(BASS, "dB", 0, 1, -6, 9, 0) 29AUDIOHW_SETTING(BASS, "dB", 0, 1, -6, 9, 0)
30AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -6, 9, 0) 30AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -6, 9, 0)
31#ifdef HAVE_RECORDING 31#ifdef HAVE_RECORDING
32/* The input PGAs have a gain range from -17.25dB .. 30dB in steps of 0.75dB
33 * Values: 0, 1, ..., 63
34 * => -17.25, -16.5dB, ..., 30.0dB */
32AUDIOHW_SETTING(LEFT_GAIN, "dB", 1, 1, 0, 63, 23, ((val - 23) * 15) / 2) 35AUDIOHW_SETTING(LEFT_GAIN, "dB", 1, 1, 0, 63, 23, ((val - 23) * 15) / 2)
33AUDIOHW_SETTING(RIGHT_GAIN, "dB", 1, 1, 0, 63, 23, ((val - 23) * 15) / 2) 36AUDIOHW_SETTING(RIGHT_GAIN, "dB", 1, 1, 0, 63, 23, ((val - 23) * 15) / 2)
37/* The microphone has an extra 20dB boost before the input PGA so 0 .. 63
38 * corresponds to 2.75dB .. 50dB */
34AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1, 0, 63, 0, ((val - 23) * 15) / 2 + 200) 39AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1, 0, 63, 0, ((val - 23) * 15) / 2 + 200)
35#endif /* HAVE_RECORDING */ 40#endif /* HAVE_RECORDING */
36 41