Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Kcontrols for ASoC TWL4030 CODEC
@ 2008-11-20 12:42 naveen krishna ch
  2008-11-20 13:36 ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: naveen krishna ch @ 2008-11-20 12:42 UTC (permalink / raw)
  To: alsa-devel; +Cc: Steve Sakoman

[-- Attachment #1: Type: text/plain, Size: 3111 bytes --]

Here i submit the patch for the kcontrols for ASoC TWL4030 CODEC.

This patch comes next to my first patch.

There seems some MUA issue so i attached the patch.

>From 228b912bef74c4f22f4afaa031ac0ce0fef652f1 Mon Sep 17 00:00:00 2001
From: chnaveenkrishna <chnaveen@chnaveen.mistral.in>
Date: Thu, 20 Nov 2008 18:11:45 +0530
Subject: [PATCH] Kcontrols for gain selection and enabling, disabling the
ADC, DAC-2

---
 sound/soc/codecs/twl4030.c |   61
+++++++++++++++++++++++++++++++++++++++----
 1 files changed, 55 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 3bc42b3..f258ea2 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -190,12 +190,61 @@ static void twl4030_init_chip(struct snd_soc_codec
*codec)
 }

 static const struct snd_kcontrol_new twl4030_snd_controls[] = {
-    SOC_DOUBLE_R("Master Playback Volume",
-         TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
-        0, 127, 0),
-    SOC_DOUBLE_R("Capture Volume",
-         TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA,
-        0, 127, 0),
+
+    /* Master Playback Volume Controls */
+        SOC_DOUBLE_R("Master PLayback Course Gain",
+                TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
+                6, 3, 0),
+
+        SOC_DOUBLE_R("Master Playback Fine Gain",
+                TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
+                0, 63, 0),
+
+        /* Master Capture Gain controls */
+        SOC_DOUBLE_R("Master Capture Gain",
+                TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA,
+                0, 31, 0),
+
+        /* Headset volume controls */
+        SOC_DOUBLE("Headset Volume",
+                TWL4030_REG_HS_GAIN_SET, 2, 0, 3, 0),
+
+        /* Ear Piece volume controls */
+        SOC_SINGLE("Earpiece Volume",
+                TWL4030_REG_EAR_CTL, 4, 3, 0),
+
+        /* Internal Class D Speaker volume controls */
+        SOC_DOUBLE_R("Internal Speaker Volume",
+                TWL4030_REG_ARXL2_APGA_CTL, TWL4030_REG_ARXR2_APGA_CTL,
+                 3, 17, 0),
+
+        /* External Class D Speaker volume controls */
+        SOC_DOUBLE_R("External Speaker Volume",
+                TWL4030_REG_PREDL_CTL, TWL4030_REG_PREDR_CTL,
+                4, 3, 0),
+
+    /* Predriver Carkit volume controls */
+        SOC_DOUBLE_R("Pre Car-Kit Volume",
+                TWL4030_REG_PRECKL_CTL, TWL4030_REG_PRECKR_CTL,
+                4, 3, 0),
+
+        SOC_DOUBLE("Main + Sub Mic Capture Gain",
+                TWL4030_REG_ANAMIC_GAIN, 3 , 0, 5, 0),
+
+        /* Loop gain controls*/
+        SOC_DOUBLE("Loop Gain", TWL4030_REG_ATX2ARXPGA,
+                3 , 0, 7, 0),
+
+        /* Left and Right ADC Switches */
+        SOC_SINGLE("ADCL", TWL4030_REG_AVADC_CTL, 3, 1, 0),
+
+        SOC_SINGLE("ADCR", TWL4030_REG_AVADC_CTL, 1, 1, 0),
+
+        /* Left and Right DAC-2 Switches */
+        SOC_SINGLE("DACL2", TWL4030_REG_AVDAC_CTL, 3, 1, 0),
+
+        SOC_SINGLE("DACR2", TWL4030_REG_AVDAC_CTL, 2, 1, 0),
+
 };

 /* add non dapm controls */
-- 
1.5.3.4

-- 
Thanks,

(: Naveen Krishna Ch :)

[-- Attachment #2: kcontrols-patch --]
[-- Type: application/octet-stream, Size: 2879 bytes --]

From 228b912bef74c4f22f4afaa031ac0ce0fef652f1 Mon Sep 17 00:00:00 2001
From: chnaveenkrishna <chnaveen@chnaveen.mistral.in>
Date: Thu, 20 Nov 2008 18:11:45 +0530
Subject: [PATCH] Kcontrols for gain selection and enabling, disabling the ADC, DAC-2

---
 sound/soc/codecs/twl4030.c |   61 +++++++++++++++++++++++++++++++++++++++----
 1 files changed, 55 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 3bc42b3..f258ea2 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -190,12 +190,61 @@ static void twl4030_init_chip(struct snd_soc_codec *codec)
 }
 
 static const struct snd_kcontrol_new twl4030_snd_controls[] = {
-	SOC_DOUBLE_R("Master Playback Volume",
-		 TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
-		0, 127, 0),
-	SOC_DOUBLE_R("Capture Volume",
-		 TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA,
-		0, 127, 0),
+	
+	/* Master Playback Volume Controls */
+        SOC_DOUBLE_R("Master PLayback Course Gain",
+                TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
+                6, 3, 0),
+
+        SOC_DOUBLE_R("Master Playback Fine Gain",
+                TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
+                0, 63, 0),
+
+        /* Master Capture Gain controls */
+        SOC_DOUBLE_R("Master Capture Gain",
+                TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA,
+                0, 31, 0),
+
+        /* Headset volume controls */
+        SOC_DOUBLE("Headset Volume",
+                TWL4030_REG_HS_GAIN_SET, 2, 0, 3, 0),
+
+        /* Ear Piece volume controls */
+        SOC_SINGLE("Earpiece Volume",
+                TWL4030_REG_EAR_CTL, 4, 3, 0),
+
+        /* Internal Class D Speaker volume controls */
+        SOC_DOUBLE_R("Internal Speaker Volume",
+                TWL4030_REG_ARXL2_APGA_CTL, TWL4030_REG_ARXR2_APGA_CTL,
+                 3, 17, 0),
+
+        /* External Class D Speaker volume controls */
+        SOC_DOUBLE_R("External Speaker Volume",
+                TWL4030_REG_PREDL_CTL, TWL4030_REG_PREDR_CTL,
+                4, 3, 0),
+	
+	/* Predriver Carkit volume controls */
+        SOC_DOUBLE_R("Pre Car-Kit Volume",
+                TWL4030_REG_PRECKL_CTL, TWL4030_REG_PRECKR_CTL,
+                4, 3, 0),
+
+        SOC_DOUBLE("Main + Sub Mic Capture Gain",
+                TWL4030_REG_ANAMIC_GAIN, 3 , 0, 5, 0),
+
+        /* Loop gain controls*/
+        SOC_DOUBLE("Loop Gain", TWL4030_REG_ATX2ARXPGA,
+                3 , 0, 7, 0),
+
+        /* Left and Right ADC Switches */
+        SOC_SINGLE("ADCL", TWL4030_REG_AVADC_CTL, 3, 1, 0),
+
+        SOC_SINGLE("ADCR", TWL4030_REG_AVADC_CTL, 1, 1, 0),
+
+        /* Left and Right DAC-2 Switches */
+        SOC_SINGLE("DACL2", TWL4030_REG_AVDAC_CTL, 3, 1, 0),
+
+        SOC_SINGLE("DACR2", TWL4030_REG_AVDAC_CTL, 2, 1, 0),
+
 };
 
 /* add non dapm controls */
-- 
1.5.3.4


[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-11-20 14:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-20 12:42 Kcontrols for ASoC TWL4030 CODEC naveen krishna ch
2008-11-20 13:36 ` Mark Brown
2008-11-20 14:01   ` naveen krishna ch
2008-11-20 14:04     ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox