aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-02 10:55:52 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-02 12:37:38 -0500
commitf2e2026c98b74028b55901711c5df98e6d2ad8c6 (patch)
tree0f582158fe6d32e4f5e5371129d878e376043d69 /sound
parent3631e8d43e385e851f88637244a287433246c097 (diff)
ASoC: Add WM8958 based headset detection on Littlemill
The board supports CODECs that won't work with this but the CODEC driver will check to see if it's running on the right chip for us. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/samsung/littlemill.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sound/soc/samsung/littlemill.c b/sound/soc/samsung/littlemill.c
index d2a44ab3c207..5d7680f4b7c1 100644
--- a/sound/soc/samsung/littlemill.c
+++ b/sound/soc/samsung/littlemill.c
@@ -154,8 +154,11 @@ static struct snd_soc_dapm_route audio_paths[] = {
154 { "Headphone", NULL, "HPOUT1R" }, 154 { "Headphone", NULL, "HPOUT1R" },
155}; 155};
156 156
157static struct snd_soc_jack littlemill_headset;
158
157static int littlemill_late_probe(struct snd_soc_card *card) 159static int littlemill_late_probe(struct snd_soc_card *card)
158{ 160{
161 struct snd_soc_codec *codec = card->rtd[0].codec;
159 struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; 162 struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai;
160 int ret; 163 int ret;
161 164
@@ -164,6 +167,18 @@ static int littlemill_late_probe(struct snd_soc_card *card)
164 if (ret < 0) 167 if (ret < 0)
165 return ret; 168 return ret;
166 169
170 ret = snd_soc_jack_new(codec, "Headset",
171 SND_JACK_HEADSET | SND_JACK_MECHANICAL |
172 SND_JACK_BTN_0 | SND_JACK_BTN_1 |
173 SND_JACK_BTN_2 | SND_JACK_BTN_3 |
174 SND_JACK_BTN_4 | SND_JACK_BTN_5,
175 &littlemill_headset);
176 if (ret)
177 return ret;
178
179 /* This will check device compatibility itself */
180 wm8958_mic_detect(codec, &littlemill_headset, NULL, NULL);
181
167 return 0; 182 return 0;
168} 183}
169 184