Lines Matching +full:mic +full:- +full:int
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * tosa.c -- SoC audio for Tosa
12 * 1 - Jack Insertion
13 * 5 - Hookswitch (headset answer/hang up switch)
25 #include <asm/mach-types.h>
36 static int tosa_jack_func;
37 static int tosa_spk_func;
47 snd_soc_dapm_disable_pin_unlocked(dapm, "Mic (Internal)"); in tosa_ext_control()
52 snd_soc_dapm_enable_pin_unlocked(dapm, "Mic (Internal)"); in tosa_ext_control()
57 snd_soc_dapm_disable_pin_unlocked(dapm, "Mic (Internal)"); in tosa_ext_control()
73 static int tosa_startup(struct snd_pcm_substream *substream) in tosa_startup()
78 tosa_ext_control(&rtd->card->dapm); in tosa_startup()
87 static int tosa_get_jack(struct snd_kcontrol *kcontrol, in tosa_get_jack()
90 ucontrol->value.enumerated.item[0] = tosa_jack_func; in tosa_get_jack()
94 static int tosa_set_jack(struct snd_kcontrol *kcontrol, in tosa_set_jack()
99 if (tosa_jack_func == ucontrol->value.enumerated.item[0]) in tosa_set_jack()
102 tosa_jack_func = ucontrol->value.enumerated.item[0]; in tosa_set_jack()
103 tosa_ext_control(&card->dapm); in tosa_set_jack()
107 static int tosa_get_spk(struct snd_kcontrol *kcontrol, in tosa_get_spk()
110 ucontrol->value.enumerated.item[0] = tosa_spk_func; in tosa_get_spk()
114 static int tosa_set_spk(struct snd_kcontrol *kcontrol, in tosa_set_spk()
119 if (tosa_spk_func == ucontrol->value.enumerated.item[0]) in tosa_set_spk()
122 tosa_spk_func = ucontrol->value.enumerated.item[0]; in tosa_set_spk()
123 tosa_ext_control(&card->dapm); in tosa_set_spk()
128 static int tosa_hp_event(struct snd_soc_dapm_widget *w, in tosa_hp_event()
129 struct snd_kcontrol *k, int event) in tosa_hp_event()
139 SND_SOC_DAPM_MIC("Mic (Internal)", NULL),
154 /* internal mic is connected to mic1, mic2 differential - with bias */
155 {"MIC1", NULL, "Mic Bias"},
156 {"MIC2", NULL, "Mic Bias"},
157 {"Mic Bias", NULL, "Mic (Internal)"},
161 {"LINEINR", NULL, "Mic Bias"},
162 {"Mic Bias", NULL, "Headset Jack"},
165 static const char * const jack_function[] = {"Headphone", "Mic", "Line",
181 DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97")),
182 DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-hifi")),
183 DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
186 DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97-aux")),
187 DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-aux")),
188 DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
220 static int tosa_probe(struct platform_device *pdev) in tosa_probe()
223 int ret; in tosa_probe()
230 card->dev = &pdev->dev; in tosa_probe()
232 ret = devm_snd_soc_register_card(&pdev->dev, card); in tosa_probe()
234 dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", in tosa_probe()
241 static int tosa_remove(struct platform_device *pdev) in tosa_remove()
249 .name = "tosa-audio",
262 MODULE_ALIAS("platform:tosa-audio");