[alsa-devel] [PATCH 0/2] ASoC: cs42l52: HP gain enum and PCM Mixer dB scale fixes.
Hi,
The two patches in the serie contains the following fixes:
- Use the correct shift value in hp_gain_enum, effectively allowing the higher gain values to be effective and the correct gain value to be reported to userland wrt what is written to the register.
- Fix the PCM Mixer dB scale so that userland can report the correct dB gain values. Note that in its current form, the PCM Mixer control will only allow the range [-0.5 dB (0x7f), +12 dB (0x18)] to be programmed to the hardware. I don't know if it is intentional or not.
Regards,
Nicolas Schichan (2): ASoC: cs42l52: use correct PCM mixer TLV dB scale to match datasheet. ASoC: cs42l52: fix hp_gain_enum shift value.
sound/soc/codecs/cs42l52.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Signed-off-by: Nicolas Schichan nschichan@freebox.fr --- sound/soc/codecs/cs42l52.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c index 030f53c..756c204 100644 --- a/sound/soc/codecs/cs42l52.c +++ b/sound/soc/codecs/cs42l52.c @@ -193,6 +193,8 @@ static DECLARE_TLV_DB_SCALE(mic_tlv, 1600, 100, 0);
static DECLARE_TLV_DB_SCALE(pga_tlv, -600, 50, 0);
+static DECLARE_TLV_DB_SCALE(mix_tlv, -50, 50, 0); + static const unsigned int limiter_tlv[] = { TLV_DB_RANGE_HEAD(2), 0, 2, TLV_DB_SCALE_ITEM(-3000, 600, 0), @@ -441,7 +443,7 @@ static const struct snd_kcontrol_new cs42l52_snd_controls[] = {
SOC_DOUBLE_R_SX_TLV("PCM Mixer Volume", CS42L52_PCMA_MIXER_VOL, CS42L52_PCMB_MIXER_VOL, - 0, 0x7f, 0x19, hl_tlv), + 0, 0x7f, 0x19, mix_tlv), SOC_DOUBLE_R("PCM Mixer Switch", CS42L52_PCMA_MIXER_VOL, CS42L52_PCMB_MIXER_VOL, 7, 1, 1),
Signed-off-by: Nicolas Schichan nschichan@freebox.fr --- sound/soc/codecs/cs42l52.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c index 756c204..987f728 100644 --- a/sound/soc/codecs/cs42l52.c +++ b/sound/soc/codecs/cs42l52.c @@ -262,7 +262,7 @@ static const char * const hp_gain_num_text[] = { };
static const struct soc_enum hp_gain_enum = - SOC_ENUM_SINGLE(CS42L52_PB_CTL1, 4, + SOC_ENUM_SINGLE(CS42L52_PB_CTL1, 5, ARRAY_SIZE(hp_gain_num_text), hp_gain_num_text);
static const char * const beep_pitch_text[] = {
On Wed, May 29, 2013 at 08:01:18PM +0200, Nicolas Schichan wrote:
Hi,
The two patches in the serie contains the following fixes:
- Use the correct shift value in hp_gain_enum, effectively allowing the higher gain values to be effective and the correct gain value to be reported to userland wrt what is written to the register.
To repeat what I said last time you should use my current e-mail address.
On 05/29/2013 08:03 PM, Mark Brown wrote:
On Wed, May 29, 2013 at 08:01:18PM +0200, Nicolas Schichan wrote:
Hi,
The two patches in the serie contains the following fixes:
- Use the correct shift value in hp_gain_enum, effectively allowing the higher gain values to be effective and the correct gain value to be reported to userland wrt what is written to the register.
To repeat what I said last time you should use my current e-mail address.
Sorry about that, I had missed the message you send yesterday.
On Wed, 29 May 2013, Nicolas Schichan wrote:
Hi,
The two patches in the serie contains the following fixes:
- Use the correct shift value in hp_gain_enum, effectively allowing
the higher gain values to be effective and the correct gain value to be reported to userland wrt what is written to the register.
- Fix the PCM Mixer dB scale so that userland can report the correct
dB gain values. Note that in its current form, the PCM Mixer control will only allow the range [-0.5 dB (0x7f), +12 dB (0x18)] to be programmed to the hardware. I don't know if it is intentional or not.
Regards,
Nicolas Schichan (2): ASoC: cs42l52: use correct PCM mixer TLV dB scale to match datasheet. ASoC: cs42l52: fix hp_gain_enum shift value.
sound/soc/codecs/cs42l52.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
-- 1.7.10.4
Acked-by: Brian Austin brian.austin@cirrus.com
participants (3)
-
Brian Austin
-
Mark Brown
-
Nicolas Schichan