diff options
author | Lopez Cruz, Misael <x0052729@ti.com> | 2009-03-04 12:39:07 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-03-06 08:37:06 -0500 |
commit | 979c036e090332cd3a090ce8b4eb50c3aa28dea0 (patch) | |
tree | 30dcf933aebf0c170fd11be0212bff6c798179de /sound/soc/omap/sdp3430.c | |
parent | 4f5b31c3f29f4351d2740faed3a6c569b800b39d (diff) |
ASoC: Add DAPM machine widgets to SDP3430 driver
Add DAPM machine domain widgets to SDP3430 machine driver.
Interconnection:
* Ext Mic: MAINMIC, SUBMIC
* Ext Spk: HFL, HFR
* Headset Jack: HSMIC, HSOL, HSOR
Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/omap/sdp3430.c')
-rw-r--r-- | sound/soc/omap/sdp3430.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/sound/soc/omap/sdp3430.c b/sound/soc/omap/sdp3430.c index e226fa75669c..4eab4b491dee 100644 --- a/sound/soc/omap/sdp3430.c +++ b/sound/soc/omap/sdp3430.c | |||
@@ -81,12 +81,76 @@ static struct snd_soc_ops sdp3430_ops = { | |||
81 | .hw_params = sdp3430_hw_params, | 81 | .hw_params = sdp3430_hw_params, |
82 | }; | 82 | }; |
83 | 83 | ||
84 | /* SDP3430 machine DAPM */ | ||
85 | static const struct snd_soc_dapm_widget sdp3430_twl4030_dapm_widgets[] = { | ||
86 | SND_SOC_DAPM_MIC("Ext Mic", NULL), | ||
87 | SND_SOC_DAPM_SPK("Ext Spk", NULL), | ||
88 | SND_SOC_DAPM_HP("Headset Jack", NULL), | ||
89 | }; | ||
90 | |||
91 | static const struct snd_soc_dapm_route audio_map[] = { | ||
92 | /* External Mics: MAINMIC, SUBMIC with bias*/ | ||
93 | {"MAINMIC", NULL, "Mic Bias 1"}, | ||
94 | {"SUBMIC", NULL, "Mic Bias 2"}, | ||
95 | {"Mic Bias 1", NULL, "Ext Mic"}, | ||
96 | {"Mic Bias 2", NULL, "Ext Mic"}, | ||
97 | |||
98 | /* External Speakers: HFL, HFR */ | ||
99 | {"Ext Spk", NULL, "HFL"}, | ||
100 | {"Ext Spk", NULL, "HFR"}, | ||
101 | |||
102 | /* Headset: HSMIC (with bias), HSOL, HSOR */ | ||
103 | {"Headset Jack", NULL, "HSOL"}, | ||
104 | {"Headset Jack", NULL, "HSOR"}, | ||
105 | {"HSMIC", NULL, "Headset Mic Bias"}, | ||
106 | {"Headset Mic Bias", NULL, "Headset Jack"}, | ||
107 | }; | ||
108 | |||
109 | static int sdp3430_twl4030_init(struct snd_soc_codec *codec) | ||
110 | { | ||
111 | int ret; | ||
112 | |||
113 | /* Add SDP3430 specific widgets */ | ||
114 | ret = snd_soc_dapm_new_controls(codec, sdp3430_twl4030_dapm_widgets, | ||
115 | ARRAY_SIZE(sdp3430_twl4030_dapm_widgets)); | ||
116 | if (ret) | ||
117 | return ret; | ||
118 | |||
119 | /* Set up SDP3430 specific audio path audio_map */ | ||
120 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | ||
121 | |||
122 | /* SDP3430 connected pins */ | ||
123 | snd_soc_dapm_enable_pin(codec, "Ext Mic"); | ||
124 | snd_soc_dapm_enable_pin(codec, "Ext Spk"); | ||
125 | snd_soc_dapm_enable_pin(codec, "Headset Jack"); | ||
126 | |||
127 | /* TWL4030 not connected pins */ | ||
128 | snd_soc_dapm_nc_pin(codec, "AUXL"); | ||
129 | snd_soc_dapm_nc_pin(codec, "AUXR"); | ||
130 | snd_soc_dapm_nc_pin(codec, "CARKITMIC"); | ||
131 | snd_soc_dapm_nc_pin(codec, "DIGIMIC0"); | ||
132 | snd_soc_dapm_nc_pin(codec, "DIGIMIC1"); | ||
133 | |||
134 | snd_soc_dapm_nc_pin(codec, "OUTL"); | ||
135 | snd_soc_dapm_nc_pin(codec, "OUTR"); | ||
136 | snd_soc_dapm_nc_pin(codec, "EARPIECE"); | ||
137 | snd_soc_dapm_nc_pin(codec, "PREDRIVEL"); | ||
138 | snd_soc_dapm_nc_pin(codec, "PREDRIVER"); | ||
139 | snd_soc_dapm_nc_pin(codec, "CARKITL"); | ||
140 | snd_soc_dapm_nc_pin(codec, "CARKITR"); | ||
141 | |||
142 | ret = snd_soc_dapm_sync(codec); | ||
143 | |||
144 | return ret; | ||
145 | } | ||
146 | |||
84 | /* Digital audio interface glue - connects codec <--> CPU */ | 147 | /* Digital audio interface glue - connects codec <--> CPU */ |
85 | static struct snd_soc_dai_link sdp3430_dai = { | 148 | static struct snd_soc_dai_link sdp3430_dai = { |
86 | .name = "TWL4030", | 149 | .name = "TWL4030", |
87 | .stream_name = "TWL4030", | 150 | .stream_name = "TWL4030", |
88 | .cpu_dai = &omap_mcbsp_dai[0], | 151 | .cpu_dai = &omap_mcbsp_dai[0], |
89 | .codec_dai = &twl4030_dai, | 152 | .codec_dai = &twl4030_dai, |
153 | .init = sdp3430_twl4030_init, | ||
90 | .ops = &sdp3430_ops, | 154 | .ops = &sdp3430_ops, |
91 | }; | 155 | }; |
92 | 156 | ||