Patchwork [1/2] UBUNTU: SAUCE: Change maximum ABE volume values

login
register
mail settings
Submitter Lee Jones
Date Oct. 14, 2010, 2:47 p.m.
Message ID <280429fd166ced2557b1a9b784d01060a8bfb713.1287067043.git.lee.jones@canonical.com>
Download mbox | patch
Permalink /patch/67832/
State Accepted
Delegated to: Stefan Bader
Headers show

Comments

Lee Jones - Oct. 14, 2010, 2:47 p.m.
From: Liam Girdwood <lrg@slimlogic.co.uk>

BugLink: http://bugs.launchpad.net/bugs/637947

Signed-off-by: Lee Jones <lee.jones@canonical.com>
---
 sound/soc/omap/abe/abe_dat.c  |    3 +-
 sound/soc/omap/abe/abe_def.h  |    2 +-
 sound/soc/omap/omap-abe-dsp.c |  128 ++++++++++++++++++++--------------------
 3 files changed, 67 insertions(+), 66 deletions(-)

Patch

diff --git a/sound/soc/omap/abe/abe_dat.c b/sound/soc/omap/abe/abe_dat.c
index 415a86d..fea1364 100644
--- a/sound/soc/omap/abe/abe_dat.c
+++ b/sound/soc/omap/abe/abe_dat.c
@@ -657,7 +657,7 @@  u32 abe_current_event_id;
  * ABE CONST AREA FOR PARAMETERS TRANSLATION
  */
 const u32 abe_db2lin_table[sizeof_db2lin_table] = {
-
+#if 0
 	0x00000000,		/* SMEM coding of -120 dB */
 	0x00000000,		/* SMEM coding of -119 dB */
 	0x00000000,		/* SMEM coding of -118 dB */
@@ -688,6 +688,7 @@  const u32 abe_db2lin_table[sizeof_db2lin_table] = {
 	0x00000005,		/* SMEM coding of -93 dB */
 	0x00000006,		/* SMEM coding of -92 dB */
 	0x00000007,		/* SMEM coding of -91 dB */
+#endif
 	0x00000008,		/* SMEM coding of -90 dB */
 	0x00000009,		/* SMEM coding of -89 dB */
 	0x0000000A,		/* SMEM coding of -88 dB */
diff --git a/sound/soc/omap/abe/abe_def.h b/sound/soc/omap/abe/abe_def.h
index cf5ba66..e6af48d 100644
--- a/sound/soc/omap/abe/abe_def.h
+++ b/sound/soc/omap/abe/abe_def.h
@@ -246,7 +246,7 @@ 
 /*
  * ABE CONST AREA FOR PARAMETERS TRANSLATION
  */
-#define min_mdb (-12000)
+#define min_mdb (-9000)
 #define max_mdb (3000)
 #define sizeof_db2lin_table (1 + ((max_mdb - min_mdb)/100))
 #define sizeof_alpha_iir_table 61
diff --git a/sound/soc/omap/omap-abe-dsp.c b/sound/soc/omap/omap-abe-dsp.c
index d877864..9b2759a 100644
--- a/sound/soc/omap/omap-abe-dsp.c
+++ b/sound/soc/omap/omap-abe-dsp.c
@@ -255,59 +255,59 @@  void abe_dsp_disable_data_transfer(int port)
  * These TLV settings will need fine tuned for each individual control
  */
 
-/* Media DL1 volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(mm_dl1_tlv, -12000, 100, 3000);
+/* Media DL1 volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(mm_dl1_tlv, -9000, 100, 0);
 
-/* Media DL1 volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(tones_dl1_tlv, -12000, 100, 3000);
+/* Media DL1 volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(tones_dl1_tlv, -9000, 100, 0);
 
-/* Media DL1 volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(voice_dl1_tlv, -12000, 100, 3000);
+/* Media DL1 volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(voice_dl1_tlv, -9000, 100, 0);
 
-/* Media DL1 volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(capture_dl1_tlv, -12000, 100, 3000);
+/* Media DL1 volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(capture_dl1_tlv, -9000, 100, 0);
 
-/* Media DL2 volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(mm_dl2_tlv, -12000, 100, 3000);
+/* Media DL2 volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(mm_dl2_tlv, -9000, 100, 0);
 
-/* Media DL2 volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(tones_dl2_tlv, -12000, 100, 3000);
+/* Media DL2 volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(tones_dl2_tlv, -9000, 100, 0);
 
-/* Media DL2 volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(voice_dl2_tlv, -12000, 100, 3000);
+/* Media DL2 volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(voice_dl2_tlv, -9000, 100, 0);
 
-/* Media DL2 volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(capture_dl2_tlv, -12000, 100, 3000);
+/* Media DL2 volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(capture_dl2_tlv, -9000, 100, 0);
 
-/* SDT volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(sdt_ul_tlv, -12000, 100, 3000);
+/* SDT volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(sdt_ul_tlv, -9000, 100, 0);
 
-/* SDT volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(sdt_dl_tlv, -12000, 100, 3000);
+/* SDT volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(sdt_dl_tlv, -9000, 100, 0);
 
-/* AUDUL volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(audul_mm_tlv, -12000, 100, 3000);
+/* AUDUL volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(audul_mm_tlv, -9000, 100, 0);
 
-/* AUDUL volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(audul_tones_tlv, -12000, 100, 3000);
+/* AUDUL volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(audul_tones_tlv, -9000, 100, 0);
 
-/* AUDUL volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(audul_vx_ul_tlv, -12000, 100, 3000);
+/* AUDUL volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(audul_vx_ul_tlv, -9000, 100, 0);
 
-/* AUDUL volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(audul_vx_dl_tlv, -12000, 100, 3000);
+/* AUDUL volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(audul_vx_dl_tlv, -9000, 100, 0);
 
-/* VXREC volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(vxrec_mm_dl_tlv, -12000, 100, 3000);
+/* VXREC volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(vxrec_mm_dl_tlv, -9000, 100, 0);
 
-/* VXREC volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(vxrec_tones_tlv, -12000, 100, 3000);
+/* VXREC volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(vxrec_tones_tlv, -9000, 100, 0);
 
-/* VXREC volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(vxrec_vx_dl_tlv, -12000, 100, 3000);
+/* VXREC volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(vxrec_vx_dl_tlv, -9000, 100, 0);
 
-/* VXREC volume control from -120 to 30 dB in 1 dB steps */
-static DECLARE_TLV_DB_SCALE(vxrec_vx_ul_tlv, -12000, 100, 3000);
+/* VXREC volume control from -90 to 30 dB in 1 dB steps */
+static DECLARE_TLV_DB_SCALE(vxrec_vx_ul_tlv, -9000, 100, 0);
 
 /*TODO: we have to use the shift value atm to represent register id due to current HAL*/
 static int dl1_put_mixer(struct snd_kcontrol *kcontrol,
@@ -540,7 +540,7 @@  static int volume_put_sdt_mixer(struct snd_kcontrol *kcontrol,
 
 	pm_runtime_get_sync(&pdev->dev);
 
-	abe_write_mixer(MIXSDT, -12000 + (ucontrol->value.integer.value[0] * 100),
+	abe_write_mixer(MIXSDT, -9000 + (ucontrol->value.integer.value[0] * 100),
 				RAMP_0MS, mc->reg);
 	pm_runtime_put_sync(&pdev->dev);
 
@@ -557,7 +557,7 @@  static int volume_put_audul_mixer(struct snd_kcontrol *kcontrol,
 	struct platform_device *pdev = abe->pdev;
 
 	pm_runtime_get_sync(&pdev->dev);
-	abe_write_mixer(MIXAUDUL, -12000 + (ucontrol->value.integer.value[0] * 100),
+	abe_write_mixer(MIXAUDUL, -9000 + (ucontrol->value.integer.value[0] * 100),
 				RAMP_0MS, mc->reg);
 	pm_runtime_put_sync(&pdev->dev);
 
@@ -573,7 +573,7 @@  static int volume_put_vxrec_mixer(struct snd_kcontrol *kcontrol,
 	struct platform_device *pdev = abe->pdev;
 
 	pm_runtime_get_sync(&pdev->dev);
-	abe_write_mixer(MIXVXREC, -12000 + (ucontrol->value.integer.value[0] * 100),
+	abe_write_mixer(MIXVXREC, -9000 + (ucontrol->value.integer.value[0] * 100),
 				RAMP_0MS, mc->reg);
 	pm_runtime_put_sync(&pdev->dev);
 
@@ -589,7 +589,7 @@  static int volume_put_dl1_mixer(struct snd_kcontrol *kcontrol,
 	struct platform_device *pdev = abe->pdev;
 
 	pm_runtime_get_sync(&pdev->dev);
-	abe_write_mixer(MIXDL1, -12000 + (ucontrol->value.integer.value[0] * 100),
+	abe_write_mixer(MIXDL1, -9000 + (ucontrol->value.integer.value[0] * 100),
 				RAMP_0MS, mc->reg);
 	pm_runtime_put_sync(&pdev->dev);
 
@@ -605,7 +605,7 @@  static int volume_put_dl2_mixer(struct snd_kcontrol *kcontrol,
 	struct platform_device *pdev = abe->pdev;
 
 	pm_runtime_get_sync(&pdev->dev);
-	abe_write_mixer(MIXDL2, -12000 + (ucontrol->value.integer.value[0] * 100),
+	abe_write_mixer(MIXDL2, -9000 + (ucontrol->value.integer.value[0] * 100),
 				RAMP_0MS, mc->reg);
 	pm_runtime_put_sync(&pdev->dev);
 
@@ -623,7 +623,7 @@  static int volume_get_dl1_mixer(struct snd_kcontrol *kcontrol,
 
 	pm_runtime_get_sync(&pdev->dev);
 	abe_read_mixer(MIXDL1, &val, mc->reg);
-	ucontrol->value.integer.value[0] = (val + 12000) / 100;
+	ucontrol->value.integer.value[0] = (val + 9000) / 100;
 	pm_runtime_put_sync(&pdev->dev);
 
 	return 0;
@@ -640,7 +640,7 @@  static int volume_get_dl2_mixer(struct snd_kcontrol *kcontrol,
 
 	pm_runtime_get_sync(&pdev->dev);
 	abe_read_mixer(MIXDL2, &val, mc->reg);
-	ucontrol->value.integer.value[0] = (val + 12000) / 100;
+	ucontrol->value.integer.value[0] = (val + 9000) / 100;
 	pm_runtime_put_sync(&pdev->dev);
 
 	return 0;
@@ -657,7 +657,7 @@  static int volume_get_audul_mixer(struct snd_kcontrol *kcontrol,
 
 	pm_runtime_get_sync(&pdev->dev);
 	abe_read_mixer(MIXAUDUL, &val, mc->reg);
-	ucontrol->value.integer.value[0] = (val + 12000) / 100;
+	ucontrol->value.integer.value[0] = (val + 9000) / 100;
 	pm_runtime_put_sync(&pdev->dev);
 
 	return 0;
@@ -674,7 +674,7 @@  static int volume_get_vxrec_mixer(struct snd_kcontrol *kcontrol,
 
 	pm_runtime_get_sync(&pdev->dev);
 	abe_read_mixer(MIXVXREC, &val, mc->reg);
-	ucontrol->value.integer.value[0] = (val + 12000) / 100;
+	ucontrol->value.integer.value[0] = (val + 9000) / 100;
 	pm_runtime_put_sync(&pdev->dev);
 
 	return 0;
@@ -691,7 +691,7 @@  static int volume_get_sdt_mixer(struct snd_kcontrol *kcontrol,
 
 	pm_runtime_get_sync(&pdev->dev);
 	abe_read_mixer(MIXSDT, &val, mc->reg);
-	ucontrol->value.integer.value[0] = (val + 12000) / 100;
+	ucontrol->value.integer.value[0] = (val + 9000) / 100;
 	pm_runtime_put_sync(&pdev->dev);
 
 	return 0;
@@ -957,66 +957,66 @@  static const struct snd_kcontrol_new pdm_ul1_switch_controls =
 static const struct snd_kcontrol_new abe_controls[] = {
 	/* DL1 mixer gains */
 	SOC_SINGLE_EXT_TLV("DL1 Media Playback Volume",
-		MIX_DL1_INPUT_MM_DL, 0, 149, 0,
+		MIX_DL1_INPUT_MM_DL, 0, 120, 0,
 		volume_get_dl1_mixer, volume_put_dl1_mixer, mm_dl1_tlv),
 	SOC_SINGLE_EXT_TLV("DL1 Tones Playback Volume",
-		MIX_DL1_INPUT_TONES, 0, 149, 0,
+		MIX_DL1_INPUT_TONES, 0, 120, 0,
 		volume_get_dl1_mixer, volume_put_dl1_mixer, tones_dl1_tlv),
 	SOC_SINGLE_EXT_TLV("DL1 Voice Playback Volume",
-		MIX_DL1_INPUT_VX_DL, 0, 149, 0,
+		MIX_DL1_INPUT_VX_DL, 0, 120, 0,
 		volume_get_dl1_mixer, volume_put_dl1_mixer, voice_dl1_tlv),
 	SOC_SINGLE_EXT_TLV("DL1 Capture Playback Volume",
-		MIX_DL1_INPUT_MM_UL2, 0, 149, 0,
+		MIX_DL1_INPUT_MM_UL2, 0, 120, 0,
 		volume_get_dl1_mixer, volume_put_dl1_mixer, capture_dl1_tlv),
 
 	/* DL2 mixer gains */
 	SOC_SINGLE_EXT_TLV("DL2 Media Playback Volume",
-		MIX_DL2_INPUT_MM_DL, 0, 149, 0,
+		MIX_DL2_INPUT_MM_DL, 0, 120, 0,
 		volume_get_dl2_mixer, volume_put_dl2_mixer, mm_dl2_tlv),
 	SOC_SINGLE_EXT_TLV("DL2 Tones Playback Volume",
-		MIX_DL2_INPUT_TONES, 0, 149, 0,
+		MIX_DL2_INPUT_TONES, 0, 120, 0,
 		volume_get_dl2_mixer, volume_put_dl2_mixer, tones_dl2_tlv),
 	SOC_SINGLE_EXT_TLV("DL2 Voice Playback Volume",
-		MIX_DL2_INPUT_VX_DL, 0, 149, 0,
+		MIX_DL2_INPUT_VX_DL, 0, 120, 0,
 		volume_get_dl2_mixer, volume_put_dl2_mixer, voice_dl2_tlv),
 	SOC_SINGLE_EXT_TLV("DL2 Capture Playback Volume",
-		MIX_DL2_INPUT_MM_UL2, 0, 149, 0,
+		MIX_DL2_INPUT_MM_UL2, 0, 120, 0,
 		volume_get_dl2_mixer, volume_put_dl2_mixer, capture_dl2_tlv),
 
 	/* VXREC mixer gains */
 	SOC_SINGLE_EXT_TLV("VXREC Media Volume",
-		MIX_VXREC_INPUT_MM_DL, 0, 149, 0,
+		MIX_VXREC_INPUT_MM_DL, 0, 120, 0,
 		volume_get_vxrec_mixer, volume_put_vxrec_mixer, vxrec_mm_dl_tlv),
 	SOC_SINGLE_EXT_TLV("VXREC Tones Volume",
-		MIX_VXREC_INPUT_TONES, 0, 149, 0,
+		MIX_VXREC_INPUT_TONES, 0, 120, 0,
 		volume_get_vxrec_mixer, volume_put_vxrec_mixer, vxrec_tones_tlv),
 	SOC_SINGLE_EXT_TLV("VXREC Voice DL Volume",
-		MIX_VXREC_INPUT_VX_UL, 0, 149, 0,
+		MIX_VXREC_INPUT_VX_UL, 0, 120, 0,
 		volume_get_vxrec_mixer, volume_put_vxrec_mixer, vxrec_vx_dl_tlv),
 	SOC_SINGLE_EXT_TLV("VXREC Voice UL Volume",
-		MIX_VXREC_INPUT_VX_DL, 0, 149, 0,
+		MIX_VXREC_INPUT_VX_DL, 0, 120, 0,
 		volume_get_vxrec_mixer, volume_put_vxrec_mixer, vxrec_vx_ul_tlv),
 
 	/* AUDUL mixer gains */
 	SOC_SINGLE_EXT_TLV("AUDUL Media Volume",
-		MIX_AUDUL_INPUT_MM_DL, 0, 149, 0,
+		MIX_AUDUL_INPUT_MM_DL, 0, 120, 0,
 		volume_get_audul_mixer, volume_put_audul_mixer, audul_mm_tlv),
 	SOC_SINGLE_EXT_TLV("AUDUL Tones Volume",
-		MIX_AUDUL_INPUT_TONES, 0, 149, 0,
+		MIX_AUDUL_INPUT_TONES, 0, 120, 0,
 		volume_get_audul_mixer, volume_put_audul_mixer, audul_tones_tlv),
 	SOC_SINGLE_EXT_TLV("AUDUL Voice UL Volume",
-		MIX_AUDUL_INPUT_UPLINK, 0, 149, 0,
+		MIX_AUDUL_INPUT_UPLINK, 0, 120, 0,
 		volume_get_audul_mixer, volume_put_audul_mixer, audul_vx_ul_tlv),
 	SOC_SINGLE_EXT_TLV("AUDUL Voice DL Volume",
-		MIX_AUDUL_INPUT_VX_DL, 0, 149, 0,
+		MIX_AUDUL_INPUT_VX_DL, 0, 120, 0,
 		volume_get_audul_mixer, volume_put_audul_mixer, audul_vx_dl_tlv),
 
 	/* SDT mixer gains */
 	SOC_SINGLE_EXT_TLV("SDT UL Volume",
-		MIX_SDT_INPUT_UP_MIXER, 0, 149, 0,
+		MIX_SDT_INPUT_UP_MIXER, 0, 120, 0,
 		volume_get_sdt_mixer, volume_put_sdt_mixer, sdt_ul_tlv),
 	SOC_SINGLE_EXT_TLV("SDT DL Volume",
-		MIX_SDT_INPUT_DL1_MIXER, 0, 149, 0,
+		MIX_SDT_INPUT_DL1_MIXER, 0, 120, 0,
 		volume_get_sdt_mixer, volume_put_sdt_mixer, sdt_dl_tlv),
 
 	SOC_ENUM_EXT("DL1 Equalizer Profile",