aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/tegra
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2011-02-03 15:56:14 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-02-09 07:11:05 -0500
commit3d8bc3901067700e790e8cc796aa438cffb5ac80 (patch)
tree251cf2e3f20616b651e633c61e4152a97119e82f /sound/soc/tegra
parentf7d3e403d7de06f8a42a7f34950ae972547c6d59 (diff)
ASoC: Tegra: Harmony: Add switch control for speaker
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/tegra')
-rw-r--r--sound/soc/tegra/harmony.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sound/soc/tegra/harmony.c b/sound/soc/tegra/harmony.c
index fcd316e1c94f..be95405df3f4 100644
--- a/sound/soc/tegra/harmony.c
+++ b/sound/soc/tegra/harmony.c
@@ -173,6 +173,10 @@ static const struct snd_soc_dapm_route harmony_audio_map[] = {
173 {"IN1L", NULL, "Mic Bias"}, 173 {"IN1L", NULL, "Mic Bias"},
174}; 174};
175 175
176static const struct snd_kcontrol_new harmony_controls[] = {
177 SOC_DAPM_PIN_SWITCH("Int Spk"),
178};
179
176static int harmony_asoc_init(struct snd_soc_pcm_runtime *rtd) 180static int harmony_asoc_init(struct snd_soc_pcm_runtime *rtd)
177{ 181{
178 struct snd_soc_codec *codec = rtd->codec; 182 struct snd_soc_codec *codec = rtd->codec;
@@ -191,13 +195,17 @@ static int harmony_asoc_init(struct snd_soc_pcm_runtime *rtd)
191 195
192 gpio_direction_output(pdata->gpio_spkr_en, 0); 196 gpio_direction_output(pdata->gpio_spkr_en, 0);
193 197
198 ret = snd_soc_add_controls(codec, harmony_controls,
199 ARRAY_SIZE(harmony_controls));
200 if (ret < 0)
201 return ret;
202
194 snd_soc_dapm_new_controls(dapm, harmony_dapm_widgets, 203 snd_soc_dapm_new_controls(dapm, harmony_dapm_widgets,
195 ARRAY_SIZE(harmony_dapm_widgets)); 204 ARRAY_SIZE(harmony_dapm_widgets));
196 205
197 snd_soc_dapm_add_routes(dapm, harmony_audio_map, 206 snd_soc_dapm_add_routes(dapm, harmony_audio_map,
198 ARRAY_SIZE(harmony_audio_map)); 207 ARRAY_SIZE(harmony_audio_map));
199 208
200 snd_soc_dapm_enable_pin(dapm, "Int Spk");
201 snd_soc_dapm_enable_pin(dapm, "Mic Jack"); 209 snd_soc_dapm_enable_pin(dapm, "Mic Jack");
202 snd_soc_dapm_sync(dapm); 210 snd_soc_dapm_sync(dapm);
203 211