[Rebase from R2]audio: sn95031: Modified Mic1 capture volume range
authorOmair Mohammed Abdullah <omair.m.abdullah@intel.com>
Tue, 20 Dec 2011 05:13:44 +0000 (10:43 +0530)
committerbuildbot <buildbot@intel.com>
Fri, 13 Jan 2012 09:39:27 +0000 (01:39 -0800)
BZ: 19775

Old_BZ: 17529
Mic1 Capture Volume control was set to a wrong range due to mismatch in
documentation. Setting it to the correct set of values {0, 9, 21, 30} db as per
the sn95031_v0.95c spec.

Change-Id: Iddcb0c370d1e5cb69c6092a4fe826de09e401d8f
Signed-off-by: Omair Mohammed Abdullah <omair.m.abdullah@intel.com>
Reviewed-on: http://android.intel.com:8080/29205
Reviewed-by: M, Arulselvan <arulselvan.m@intel.com>
Tested-by: M, Arulselvan <arulselvan.m@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
sound/soc/codecs/sn95031.c

index 8a79f1c..48bece7 100644 (file)
@@ -386,8 +386,14 @@ static const struct snd_kcontrol_new sn95031_input4_mux_control =
 
 static const char *sn95031_micmode_text[] = {"Single Ended", "Differential"};
 
-/* 0dB to 30dB in 10dB steps */
-static const DECLARE_TLV_DB_SCALE(mic_tlv, 0, 10, 0);
+/* {0, 9, 21, 30} db */
+static unsigned int mic_tlv[] = {
+       TLV_DB_RANGE_HEAD(4),
+       0, 0, TLV_DB_SCALE_ITEM(0, 0, 0),
+       1, 1, TLV_DB_SCALE_ITEM(900, 0, 0),
+       2, 2, TLV_DB_SCALE_ITEM(2100, 0, 0),
+       3, 3, TLV_DB_SCALE_ITEM(3000, 0, 0),
+};
 /* -62db to 9 db in 1db steps*/
 static const DECLARE_TLV_DB_SCALE(out_tlv, -6200, 100, 0);
 
@@ -500,9 +506,9 @@ static const struct snd_kcontrol_new sn95031_snd_controls[] = {
        SOC_ENUM("DMIC34 Capture Route", sn95031_dmic34_cfg_enum),
        SOC_ENUM("DMIC56 Capture Route", sn95031_dmic56_cfg_enum),
        SOC_SINGLE_TLV("Mic1 Capture Volume", SN95031_MICAMP1,
-                       2, 4, 0, mic_tlv),
+                       2, 3, 0, mic_tlv),
        SOC_SINGLE_TLV("Mic2 Capture Volume", SN95031_MICAMP2,
-                       2, 4, 0, mic_tlv),
+                       2, 3, 0, mic_tlv),
        /* Add digital volume and mute controls for Headphone/Headset*/
        SOC_DOUBLE_R_TLV("Headphone Playback Volume", SN95031_HSLVOLCTRL,
                                SN95031_HSRVOLCTRL, 0, 71, 1, out_tlv),