17 #include <linux/module.h>
29 #include "../codecs/wm8750.h"
35 #define SPITZ_HEADSET 3
36 #define SPITZ_HP_OFF 4
37 #define SPITZ_SPK_ON 0
38 #define SPITZ_SPK_OFF 1
41 #define SPITZ_AUDIO_CLOCK 12288000
43 static int spitz_jack_func;
44 static int spitz_spk_func;
45 static int spitz_mic_gpio;
55 switch (spitz_jack_func) {
114 spitz_ext_control(&codec->
dapm);
127 unsigned int clk = 0;
160 .startup = spitz_startup,
161 .hw_params = spitz_hw_params,
164 static int spitz_get_jack(
struct snd_kcontrol *kcontrol,
167 ucontrol->
value.integer.value[0] = spitz_jack_func;
171 static int spitz_set_jack(
struct snd_kcontrol *kcontrol,
176 if (spitz_jack_func == ucontrol->
value.integer.value[0])
179 spitz_jack_func = ucontrol->
value.integer.value[0];
180 spitz_ext_control(&card->
dapm);
187 ucontrol->
value.integer.value[0] = spitz_spk_func;
196 if (spitz_spk_func == ucontrol->
value.integer.value[0])
199 spitz_spk_func = ucontrol->
value.integer.value[0];
200 spitz_ext_control(&card->
dapm);
226 {
"Headphone Jack",
NULL,
"LOUT1"},
227 {
"Headphone Jack",
NULL,
"ROUT1"},
230 {
"Headset Jack",
NULL,
"ROUT1"},
233 {
"Ext Spk",
NULL ,
"ROUT2"},
234 {
"Ext Spk",
NULL ,
"LOUT2"},
237 {
"LINPUT1",
NULL,
"Mic Bias"},
238 {
"Mic Bias",
NULL,
"Mic Jack"},
241 {
"LINPUT1",
NULL,
"Line Jack"},
244 static const char *jack_function[] = {
"Headphone",
"Mic",
"Line",
"Headset",
246 static const char *spk_function[] = {
"On",
"Off"};
247 static const struct soc_enum spitz_enum[] = {
253 SOC_ENUM_EXT(
"Jack Function", spitz_enum[0], spitz_get_jack,
255 SOC_ENUM_EXT(
"Speaker Function", spitz_enum[1], spitz_get_spk,
282 .stream_name =
"WM8750",
283 .cpu_dai_name =
"pxa2xx-i2s",
284 .codec_dai_name =
"wm8750-hifi",
285 .platform_name =
"pxa-pcm-audio",
286 .codec_name =
"wm8750.0-001b",
287 .init = spitz_wm8750_init,
297 .dai_link = &spitz_dai,
300 .controls = wm8750_spitz_controls,
301 .num_controls =
ARRAY_SIZE(wm8750_spitz_controls),
302 .dapm_widgets = wm8750_dapm_widgets,
303 .num_dapm_widgets =
ARRAY_SIZE(wm8750_dapm_widgets),
304 .dapm_routes = spitz_audio_map,
305 .num_dapm_routes =
ARRAY_SIZE(spitz_audio_map),
310 static int __init spitz_init(
void)
314 if (!(machine_is_spitz() || machine_is_borzoi() || machine_is_akita()))
317 if (machine_is_borzoi() || machine_is_spitz())
331 if (!spitz_snd_device) {
336 platform_set_drvdata(spitz_snd_device, &snd_soc_spitz);
352 static void __exit spitz_exit(
void)