Lines Matching +full:mic +full:- +full:int
1 // SPDX-License-Identifier: GPL-2.0-only
3 * wm9705.c -- ALSA Soc WM9705 codec support
88 SOC_SINGLE("Mic Playback Volume", AC97_MIC, 0, 31, 1),
89 SOC_SINGLE("Mic 20dB Boost Switch", AC97_MIC, 6, 1, 0),
94 static const char *wm9705_mic[] = {"Mic 1", "Mic 2"};
95 static const char *wm9705_rec_sel[] = {"Mic", "CD", "NC", "NC",
109 SOC_DAPM_SINGLE("Mic Playback Switch", AC97_MIC, 15, 1, 1),
114 /* Mic source */
126 SND_SOC_DAPM_MUX("Mic Source", SND_SOC_NOPM, 0, 0,
148 SND_SOC_DAPM_PGA("Mic PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
177 {"HP Mixer", "Mic Playback Switch", "Mic PGA"},
202 {"Mic Source", "Mic 1", "MIC1"},
203 {"Mic Source", "Mic 2", "MIC2"},
204 {"Mic PGA", NULL, "Mic Source"},
208 {"Left Capture Source", "Mic", "Mic Source"},
216 {"Right Capture Source", "Mic", "Mic Source"},
231 static int ac97_prepare(struct snd_pcm_substream *substream, in ac97_prepare()
234 struct snd_soc_component *component = dai->component; in ac97_prepare()
235 int reg; in ac97_prepare()
239 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in ac97_prepare()
244 return snd_soc_component_write(component, reg, substream->runtime->rate); in ac97_prepare()
258 .name = "wm9705-hifi",
276 .name = "wm9705-aux",
288 static int wm9705_soc_suspend(struct snd_soc_component *component) in wm9705_soc_suspend()
290 regcache_cache_bypass(component->regmap, true); in wm9705_soc_suspend()
292 regcache_cache_bypass(component->regmap, false); in wm9705_soc_suspend()
297 static int wm9705_soc_resume(struct snd_soc_component *component) in wm9705_soc_resume()
300 int ret; in wm9705_soc_resume()
302 ret = snd_ac97_reset(wm9705->ac97, true, WM9705_VENDOR_ID, in wm9705_soc_resume()
316 static int wm9705_soc_probe(struct snd_soc_component *component) in wm9705_soc_probe()
321 if (wm9705->mfd_pdata) { in wm9705_soc_probe()
322 wm9705->ac97 = wm9705->mfd_pdata->ac97; in wm9705_soc_probe()
323 regmap = wm9705->mfd_pdata->regmap; in wm9705_soc_probe()
325 wm9705->ac97 = snd_soc_new_ac97_component(component, WM9705_VENDOR_ID, in wm9705_soc_probe()
327 if (IS_ERR(wm9705->ac97)) { in wm9705_soc_probe()
328 dev_err(component->dev, "Failed to register AC97 codec\n"); in wm9705_soc_probe()
329 return PTR_ERR(wm9705->ac97); in wm9705_soc_probe()
332 regmap = regmap_init_ac97(wm9705->ac97, &wm9705_regmap_config); in wm9705_soc_probe()
334 snd_soc_free_ac97_component(wm9705->ac97); in wm9705_soc_probe()
338 return -ENXIO; in wm9705_soc_probe()
341 snd_soc_component_set_drvdata(component, wm9705->ac97); in wm9705_soc_probe()
351 if (IS_ENABLED(CONFIG_SND_SOC_AC97_BUS) && !wm9705->mfd_pdata) { in wm9705_soc_remove()
353 snd_soc_free_ac97_component(wm9705->ac97); in wm9705_soc_remove()
373 static int wm9705_probe(struct platform_device *pdev) in wm9705_probe()
377 wm9705 = devm_kzalloc(&pdev->dev, sizeof(*wm9705), GFP_KERNEL); in wm9705_probe()
379 return -ENOMEM; in wm9705_probe()
381 wm9705->mfd_pdata = dev_get_platdata(&pdev->dev); in wm9705_probe()
384 return devm_snd_soc_register_component(&pdev->dev, in wm9705_probe()
390 .name = "wm9705-codec",