Skip to contentSkip to conversation

ASoC: lm49453: Fix analog and digital volume ranges

PATCH In review [email protected] 3 participants 4 messages Dec 5, 2012 – Dec 6, 2012

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 ASoC: lm49453: Fix analog and digital volume ranges

From: MR Swami Reddy <[email protected]>

[PATCH] ASoC: lm49453: Fix analog and digital volume ranges

--

 sound/soc/codecs/lm49453.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
sound/soc/codecs/lm49453.c +4 -3
index 808e50a..afbefa2 100644
@@ -495,7 +495,8 @@ SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_PORT2_TX2_REG, 7, 1, 0),
 
 /* TLV Declarations */
 static const DECLARE_TLV_DB_SCALE(digital_tlv, -7650, 150, 1);
-static const DECLARE_TLV_DB_SCALE(port_tlv, 0, 600, 0);
+static const DECLARE_TLV_DB_SCALE(analog_tlv, 0, 200, 1);
+static const DECLARE_TLV_DB_SCALE(port_tlv, -1800, 600, 0);
 
 static const struct snd_kcontrol_new lm49453_sidetone_mixer_controls[] = {
 /* Sidetone supports mono only */
@@ -516,9 +517,9 @@ SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", LM49453_P0_STN_VOL_DMIC2R_REG,
 static const struct snd_kcontrol_new lm49453_snd_controls[] = {
 	/* mic1 and mic2 supports mono only */
 	SOC_SINGLE_TLV("Mic1 Volume", LM49453_P0_ADC_LEVELL_REG, 0, 6,
-			0, digital_tlv),
+			0, analog_tlv),
 	SOC_SINGLE_TLV("Mic2 Volume", LM49453_P0_ADC_LEVELR_REG, 0, 6,
-			0, digital_tlv),
+			0, analog_tlv),
 
 	SOC_DOUBLE_R_TLV("DMIC1 Volume", LM49453_P0_DMIC1_LEVELL_REG,
 			  LM49453_P0_DMIC1_LEVELR_REG, 0, 6, 0, digital_tlv),
#1 lore raw

sound/soc/codecs/lm49453.c SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_PORT2_TX2_REG, 7, 1, 0), · line 498

Quoted 4 lines · On Wed, 2012-12-05 at 16:18 +0530, [email protected] wrote:

/* TLV Declarations */
static const DECLARE_TLV_DB_SCALE(digital_tlv, -7650, 150, 1);

sound/soc/codecs/lm49453.c +1 -1
-static const DECLARE_TLV_DB_SCALE(port_tlv, 0, 600, 0);
+static const DECLARE_TLV_DB_SCALE(analog_tlv, 0, 200, 1);

The spec says your analog gain are 0 to 30dB in steps of 2dB, this doesnt sound right to me.

sound/soc/codecs/lm49453.c SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", LM49453_P0_STN_VOL_DMIC2R_REG, · line 520

Quoted 10 lines
sound/soc/codecs/lm49453.c +2 -1
+static const DECLARE_TLV_DB_SCALE(port_tlv, -1800, 600, 0);
 
 static const struct snd_kcontrol_new lm49453_sidetone_mixer_controls[] = {
 /* Sidetone supports mono only */
@@ -516,9 +517,9 @@ SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", LM49453_P0_STN_VOL_DMIC2R_REG,
 static const struct snd_kcontrol_new lm49453_snd_controls[] = {
 	/* mic1 and mic2 supports mono only */
 	SOC_SINGLE_TLV("Mic1 Volume", LM49453_P0_ADC_LEVELL_REG, 0, 6,
-			0, digital_tlv),
+			0, analog_tlv),

now i see a problem.
You have hidden the MIC gains and exposed only ADC gains. The name is wrong causing the confusion. Please make this ADC gain and add new control for MIC gain!
Your ADC gain is -76 to 18db, with 0.5dB steps, how does this reflect that?

sound/soc/codecs/lm49453.c SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", LM49453_P0_STN_VOL_DMIC2R_REG, · line 522

Quoted 3 lines
sound/soc/codecs/lm49453.c +1 -1
 	SOC_SINGLE_TLV("Mic2 Volume", LM49453_P0_ADC_LEVELR_REG, 0, 6,
-			0, digital_tlv),
+			0, analog_tlv),

Ditto.....

Quoted 7 lines
sound/soc/codecs/lm49453.c +0 -0
 	SOC_DOUBLE_R_TLV("DMIC1 Volume", LM49453_P0_DMIC1_LEVELL_REG,
 			  LM49453_P0_DMIC1_LEVELR_REG, 0, 6, 0, digital_tlv),

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

Signature · 1 line
~Vinod
author maintainer
#2 lore raw

Thanks Vinod. Yes, the ADC tlvs missed... I will update the patch.

Thanks
Swami

-----Original Message-----
From: Vinod Koul [mailto:[email protected]]
Sent: Thursday, December 06, 2012 12:59 AM
To: Reddy, M.R. Swami
Cc: [email protected]; Girdwood, Liam; Deshpande A, Vishwas; [email protected]
Subject: Re: [alsa-devel] [PATCH] ASoC: lm49453: Fix analog and digital volume ranges

sound/soc/codecs/lm49453.c SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_PORT2_TX2_REG, 7, 1, 0), · line 498

Quoted 4 lines · On Wed, 2012-12-05 at 16:18 +0530, [email protected] wrote:

/* TLV Declarations */
static const DECLARE_TLV_DB_SCALE(digital_tlv, -7650, 150, 1);

sound/soc/codecs/lm49453.c +1 -1
-static const DECLARE_TLV_DB_SCALE(port_tlv, 0, 600, 0);
+static const DECLARE_TLV_DB_SCALE(analog_tlv, 0, 200, 1);

The spec says your analog gain are 0 to 30dB in steps of 2dB, this doesnt sound right to me.

sound/soc/codecs/lm49453.c SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", · line 520

Quoted 11 lines

+static const DECLARE_TLV_DB_SCALE(port_tlv, -1800, 600, 0);

static const struct snd_kcontrol_new
lm49453_sidetone_mixer_controls[] = {
/* Sidetone supports mono only */

sound/soc/codecs/lm49453.c +1 -1
@@ -516,9 +517,9 @@ SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", 
 LM49453_P0_STN_VOL_DMIC2R_REG,  static const struct snd_kcontrol_new lm49453_snd_controls[] = {
 	/* mic1 and mic2 supports mono only */
 	SOC_SINGLE_TLV("Mic1 Volume", LM49453_P0_ADC_LEVELL_REG, 0, 6,
-			0, digital_tlv),
+			0, analog_tlv),

now i see a problem.
You have hidden the MIC gains and exposed only ADC gains. The name is wrong causing the confusion. Please make this ADC gain and add new control for MIC gain! Your ADC gain is -76 to 18db, with 0.5dB steps, how does this reflect that?

sound/soc/codecs/lm49453.c SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", LM49453_P0_STN_VOL_DMIC2R_REG, · line 522

Quoted 3 lines
sound/soc/codecs/lm49453.c +1 -1
 	SOC_SINGLE_TLV("Mic2 Volume", LM49453_P0_ADC_LEVELR_REG, 0, 6,
-			0, digital_tlv),
+			0, analog_tlv),

Ditto.....

Quoted 7 lines
sound/soc/codecs/lm49453.c +0 -0
 	SOC_DOUBLE_R_TLV("DMIC1 Volume", LM49453_P0_DMIC1_LEVELL_REG,
 			  LM49453_P0_DMIC1_LEVELR_REG, 0, 6, 0, digital_tlv), 

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

--
~Vinod

#3 lore raw

Hi Swami,

Quoted 1 line · M.R. Swami

Thanks Vinod. Yes, the ADC tlvs missed... I will update the patch.

and while you are there, please fix the commit message as well.

Quoted 54 lines

Thanks
Swami

-----Original Message-----
From: Vinod Koul [mailto:[email protected]]
Sent: Thursday, December 06, 2012 12:59 AM
To: Reddy, M.R. Swami
Cc: [email protected]; Girdwood, Liam; Deshpande A, Vishwas; [email protected]
Subject: Re: [alsa-devel] [PATCH] ASoC: lm49453: Fix analog and digital volume ranges

sound/soc/codecs/lm49453.c SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_PORT2_TX2_REG, 7, 1, 0), · line 498

Quoted 4 lines · On Wed, 2012-12-05 at 16:18 +0530, [email protected] wrote:

/* TLV Declarations */
static const DECLARE_TLV_DB_SCALE(digital_tlv, -7650, 150, 1);

sound/soc/codecs/lm49453.c +1 -1
-static const DECLARE_TLV_DB_SCALE(port_tlv, 0, 600, 0);
+static const DECLARE_TLV_DB_SCALE(analog_tlv, 0, 200, 1);

The spec says your analog gain are 0 to 30dB in steps of 2dB, this doesnt sound right to me.

sound/soc/codecs/lm49453.c SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", · line 520

Quoted 11 lines

+static const DECLARE_TLV_DB_SCALE(port_tlv, -1800, 600, 0);

static const struct snd_kcontrol_new
lm49453_sidetone_mixer_controls[] = {
/* Sidetone supports mono only */

sound/soc/codecs/lm49453.c +1 -1
@@ -516,9 +517,9 @@ SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", 
 LM49453_P0_STN_VOL_DMIC2R_REG,  static const struct snd_kcontrol_new lm49453_snd_controls[] = {
 	/* mic1 and mic2 supports mono only */
 	SOC_SINGLE_TLV("Mic1 Volume", LM49453_P0_ADC_LEVELL_REG, 0, 6,
-			0, digital_tlv),
+			0, analog_tlv),

now i see a problem.
You have hidden the MIC gains and exposed only ADC gains. The name is wrong causing the confusion. Please make this ADC gain and add new control for MIC gain! Your ADC gain is -76 to 18db, with 0.5dB steps, how does this reflect that?

sound/soc/codecs/lm49453.c SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", LM49453_P0_STN_VOL_DMIC2R_REG, · line 522

Quoted 3 lines
sound/soc/codecs/lm49453.c +1 -1
 	SOC_SINGLE_TLV("Mic2 Volume", LM49453_P0_ADC_LEVELR_REG, 0, 6,
-			0, digital_tlv),
+			0, analog_tlv),

Ditto.....

Quoted 7 lines
sound/soc/codecs/lm49453.c +0 -0
 	SOC_DOUBLE_R_TLV("DMIC1 Volume", LM49453_P0_DMIC1_LEVELL_REG,
 			  LM49453_P0_DMIC1_LEVELR_REG, 0, 6, 0, digital_tlv), 

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

--
~Vinod

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

Signature · 1 line
Péter