21 #include <linux/module.h>
23 #include <linux/device.h>
34 #include "../codecs/wm9712.h"
38 #define TOSA_MIC_INT 1
39 #define TOSA_HEADSET 2
42 #define TOSA_SPK_OFF 1
44 static int tosa_jack_func;
45 static int tosa_spk_func;
52 switch (tosa_jack_func) {
86 tosa_ext_control(codec);
94 .startup = tosa_startup,
100 ucontrol->
value.integer.value[0] = tosa_jack_func;
109 if (tosa_jack_func == ucontrol->
value.integer.value[0])
112 tosa_jack_func = ucontrol->
value.integer.value[0];
113 tosa_ext_control(codec);
120 ucontrol->
value.integer.value[0] = tosa_spk_func;
129 if (tosa_spk_func == ucontrol->
value.integer.value[0])
132 tosa_spk_func = ucontrol->
value.integer.value[0];
133 tosa_ext_control(codec);
157 {
"Headphone Jack",
NULL,
"HPOUTL"},
158 {
"Headphone Jack",
NULL,
"HPOUTR"},
161 {
"Speaker",
NULL,
"LOUT2"},
162 {
"Speaker",
NULL,
"ROUT2"},
165 {
"MIC1",
NULL,
"Mic Bias"},
166 {
"MIC2",
NULL,
"Mic Bias"},
167 {
"Mic Bias",
NULL,
"Mic (Internal)"},
170 {
"Headset Jack",
NULL,
"HPOUTR"},
171 {
"LINEINR",
NULL,
"Mic Bias"},
172 {
"Mic Bias",
NULL,
"Headset Jack"},
175 static const char *jack_function[] = {
"Headphone",
"Mic",
"Line",
"Headset",
177 static const char *spk_function[] = {
"On",
"Off"};
178 static const struct soc_enum tosa_enum[] = {
184 SOC_ENUM_EXT(
"Jack Function", tosa_enum[0], tosa_get_jack,
186 SOC_ENUM_EXT(
"Speaker Function", tosa_enum[1], tosa_get_spk,
218 .stream_name =
"AC97 HiFi",
219 .cpu_dai_name =
"pxa2xx-ac97",
220 .codec_dai_name =
"wm9712-hifi",
221 .platform_name =
"pxa-pcm-audio",
222 .codec_name =
"wm9712-codec",
223 .init = tosa_ac97_init,
228 .stream_name =
"AC97 Aux",
229 .cpu_dai_name =
"pxa2xx-ac97-aux",
230 .codec_dai_name =
"wm9712-aux",
231 .platform_name =
"pxa-pcm-audio",
232 .codec_name =
"wm9712-codec",
240 .dai_link = tosa_dai,
258 dev_err(&pdev->
dev,
"snd_soc_register_card() failed: %d\n",
276 .name =
"tosa-audio",