diff options
| author | Cástor Muñoz <cmvidal@gmail.com> | 2014-12-06 18:58:25 +0100 |
|---|---|---|
| committer | Cástor Muñoz <cmvidal@gmail.com> | 2015-10-07 06:15:03 +0200 |
| commit | 42abc6a49670cd546737a4dc7542f9f3f62e3831 (patch) | |
| tree | 48cd6b9d86ff868be72c968b61cd9102eb33a547 /firmware/export | |
| parent | 67b4e7f958f4b6569dce8c50c117b22c9f1f9ca7 (diff) | |
| download | rockbox-42abc6a49670cd546737a4dc7542f9f3f62e3831.zip rockbox-42abc6a49670cd546737a4dc7542f9f3f62e3831.tar.gz rockbox-42abc6a49670cd546737a4dc7542f9f3f62e3831.tar.bz2 rockbox-42abc6a49670cd546737a4dc7542f9f3f62e3831.tar.xz | |
iPod Classic: capture support for CS42L55 codec
There are a couple of power saving options that can be selected using
defines, they configure the CODEC in a different way than OF does:
MONO_MIC: jack microphone is connected to left channel, disabling
right channel saves ~1 mW, there is no reason to not to do it.
BYPASS_PGA: this option only applies to the line-in, OF does not
bypass the PGA and configures it to 0 dB gain. At the beginning,
this patch was written based on CODEC datasheet, bypassing PGA
because it saves power and incrementes dinamic range ~1dB, i have
used this setup for a while without problems. Finally this option
was disabled at the last minute, i decided to do it after reviewing
the OF and realizing that CS42L55 datasheet recommends to bypass the
PGA only if the HW includes a couple of capacitors (see Typical
Connection Diagram, Note 4), at this moment i don't know if Classic
includes these capacitors (probably not). Anyway, i am not able to
tell the difference listening to voice recodings.
TODO:
- Use variable PGA gain for jack microphone (it is fixed to +12 dB.
as OF does).
- I am not a fan of having lots of unused #define options, these could
be useful for a generic driver but actually this driver is Classic
oriented, i am not sure if it could be considered disirable to
eliminate them in the final version.
Change-Id: I3dadf2341f44d5e13f3847e6c9de4a76cd6f0918
Diffstat (limited to 'firmware/export')
| -rw-r--r-- | firmware/export/cs42l55.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/firmware/export/cs42l55.h b/firmware/export/cs42l55.h index d8d177e..11ceb9b 100644 --- a/firmware/export/cs42l55.h +++ b/firmware/export/cs42l55.h @@ -23,13 +23,24 @@ #define __CS42L55_H__ #define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | BASS_CUTOFF_CAP | \ - TREBLE_CUTOFF_CAP | PRESCALER_CAP | LINEOUT_CAP) + TREBLE_CUTOFF_CAP | PRESCALER_CAP | LINEOUT_CAP | \ + LIN_GAIN_CAP | MIC_GAIN_CAP) AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -60, 12, -25) AUDIOHW_SETTING(BASS, "dB", 1, 15,-105, 120, 0) AUDIOHW_SETTING(TREBLE, "dB", 1, 15,-105, 120, 0) AUDIOHW_SETTING(BASS_CUTOFF, "", 0, 1, 1, 4, 2) AUDIOHW_SETTING(TREBLE_CUTOFF, "", 0, 1, 1, 4, 1) +#ifdef HAVE_RECORDING +#define PGA_GAIN_DB 12 /* PGA fixed gain, range: -6 to +12 dB */ +AUDIOHW_SETTING(LEFT_GAIN, "dB", 0, 1, -96, 0, 0) +AUDIOHW_SETTING(RIGHT_GAIN, "dB", 0, 1, -96, 0, 0) +AUDIOHW_SETTING(MIC_GAIN, "dB", 0, 1, -96, 0, 0, val + PGA_GAIN_DB) +#endif /* HAVE_RECORDING */ + +/* powered DSP modules */ +#define DSP_MODULE_TONE (1 << 0) +#define DSP_MODULE_MONITOR (1 << 1) void audiohw_enable_lineout(bool enable); |