diff options
-rw-r--r-- | sound/soc/tegra/harmony.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/sound/soc/tegra/harmony.c b/sound/soc/tegra/harmony.c index bf0dbafbf6d0..b160b7113f45 100644 --- a/sound/soc/tegra/harmony.c +++ b/sound/soc/tegra/harmony.c | |||
@@ -107,6 +107,36 @@ static struct snd_soc_ops harmony_asoc_ops = { | |||
107 | .hw_params = harmony_asoc_hw_params, | 107 | .hw_params = harmony_asoc_hw_params, |
108 | }; | 108 | }; |
109 | 109 | ||
110 | static const struct snd_soc_dapm_widget harmony_dapm_widgets[] = { | ||
111 | SND_SOC_DAPM_HP("Headphone Jack", NULL), | ||
112 | SND_SOC_DAPM_MIC("Mic Jack", NULL), | ||
113 | }; | ||
114 | |||
115 | static const struct snd_soc_dapm_route harmony_audio_map[] = { | ||
116 | {"Headphone Jack", NULL, "HPOUTR"}, | ||
117 | {"Headphone Jack", NULL, "HPOUTL"}, | ||
118 | {"Mic Bias", NULL, "Mic Jack"}, | ||
119 | {"IN1L", NULL, "Mic Bias"}, | ||
120 | }; | ||
121 | |||
122 | static int harmony_asoc_init(struct snd_soc_pcm_runtime *rtd) | ||
123 | { | ||
124 | struct snd_soc_codec *codec = rtd->codec; | ||
125 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
126 | |||
127 | snd_soc_dapm_new_controls(dapm, harmony_dapm_widgets, | ||
128 | ARRAY_SIZE(harmony_dapm_widgets)); | ||
129 | |||
130 | snd_soc_dapm_add_routes(dapm, harmony_audio_map, | ||
131 | ARRAY_SIZE(harmony_audio_map)); | ||
132 | |||
133 | snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); | ||
134 | snd_soc_dapm_enable_pin(dapm, "Mic Jack"); | ||
135 | snd_soc_dapm_sync(dapm); | ||
136 | |||
137 | return 0; | ||
138 | } | ||
139 | |||
110 | static struct snd_soc_dai_link harmony_wm8903_dai = { | 140 | static struct snd_soc_dai_link harmony_wm8903_dai = { |
111 | .name = "WM8903", | 141 | .name = "WM8903", |
112 | .stream_name = "WM8903 PCM", | 142 | .stream_name = "WM8903 PCM", |
@@ -114,6 +144,7 @@ static struct snd_soc_dai_link harmony_wm8903_dai = { | |||
114 | .platform_name = "tegra-pcm-audio", | 144 | .platform_name = "tegra-pcm-audio", |
115 | .cpu_dai_name = "tegra-i2s.0", | 145 | .cpu_dai_name = "tegra-i2s.0", |
116 | .codec_dai_name = "wm8903-hifi", | 146 | .codec_dai_name = "wm8903-hifi", |
147 | .init = harmony_asoc_init, | ||
117 | .ops = &harmony_asoc_ops, | 148 | .ops = &harmony_asoc_ops, |
118 | }; | 149 | }; |
119 | 150 | ||