[alsa-devel] [PATCH 1/2] ASoC: dapm - Add DAPM for always active DAC or ADC

Joonyoung Shim jy0922.shim at samsung.com
Tue Mar 24 13:57:20 CET 2009


This patch supports DAPM widget for always active DAC or ADC regardless
of stream. This widgets will be used for voice call at TWL4030 codec.

TWL4030 codec use the digital signal for voice call, so it needs DAC and
ADC to change signal to digital or analog, however currently DAC and ADC
widgets cannot support voice call because they are activated only when
playback or capture is executed.

Signed-off-by: Joonyoung Shim <jy0922.shim at samsung.com>
---
 Documentation/sound/alsa/soc/dapm.txt |    3 +++
 include/sound/soc-dapm.h              |    6 ++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/Documentation/sound/alsa/soc/dapm.txt b/Documentation/sound/alsa/soc/dapm.txt
index 9e67632..50a1e21 100644
--- a/Documentation/sound/alsa/soc/dapm.txt
+++ b/Documentation/sound/alsa/soc/dapm.txt
@@ -93,6 +93,9 @@ e.g. stream widgets for HiFi playback and capture
 SND_SOC_DAPM_DAC("HiFi DAC", "HiFi Playback", REG, 3, 1),
 SND_SOC_DAPM_ADC("HiFi ADC", "HiFi Capture", REG, 2, 1),
 
+If you want always active DAC or ADC widget regardless of stream, you can use
+SND_SOC_DAPM_DAC_ACTIVE or SND_SOC_DAPM_ADC_ACTIVE instead, and stream name
+parameter isn't used.
 
 2.2 Path Domain Widgets
 -----------------------
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index a7def6a..5e26f81 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -143,6 +143,12 @@
 #define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \
 {	.id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \
 	.shift = wshift, .invert = winvert}
+#define SND_SOC_DAPM_DAC_ACTIVE(wname, wreg, wshift, winvert) \
+{	.id = snd_soc_dapm_dac, .name = wname, .reg = wreg, \
+	.shift = wshift, .invert = winvert, .active = 1}
+#define SND_SOC_DAPM_ADC_ACTIVE(wname, wreg, wshift, winvert) \
+{	.id = snd_soc_dapm_adc, .name = wname, .reg = wreg, \
+	.shift = wshift, .invert = winvert, .active = 1}
 
 /* generic register modifier widget */
 #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \
-- 
1.5.6.3


More information about the Alsa-devel mailing list