17 #include <linux/module.h>
20 #include <linux/i2c.h>
32 #include "../codecs/wm8731.h"
36 #define POODLE_HP_OFF 0
37 #define POODLE_SPK_ON 1
38 #define POODLE_SPK_OFF 0
41 #define POODLE_AUDIO_CLOCK 12288000
43 static int poodle_jack_func;
44 static int poodle_spk_func;
82 poodle_ext_control(&codec->
dapm);
105 unsigned int clk = 0;
138 .startup = poodle_startup,
139 .hw_params = poodle_hw_params,
140 .shutdown = poodle_shutdown,
143 static int poodle_get_jack(
struct snd_kcontrol *kcontrol,
146 ucontrol->
value.integer.value[0] = poodle_jack_func;
150 static int poodle_set_jack(
struct snd_kcontrol *kcontrol,
155 if (poodle_jack_func == ucontrol->
value.integer.value[0])
158 poodle_jack_func = ucontrol->
value.integer.value[0];
159 poodle_ext_control(&card->
dapm);
163 static int poodle_get_spk(
struct snd_kcontrol *kcontrol,
166 ucontrol->
value.integer.value[0] = poodle_spk_func;
170 static int poodle_set_spk(
struct snd_kcontrol *kcontrol,
175 if (poodle_spk_func == ucontrol->
value.integer.value[0])
178 poodle_spk_func = ucontrol->
value.integer.value[0];
179 poodle_ext_control(&card->
dapm);
206 {
"Headphone Jack",
NULL,
"LHPOUT"},
207 {
"Headphone Jack",
NULL,
"RHPOUT"},
210 {
"Ext Spk",
NULL,
"ROUT"},
211 {
"Ext Spk",
NULL,
"LOUT"},
214 static const char *jack_function[] = {
"Off",
"Headphone"};
215 static const char *spk_function[] = {
"Off",
"On"};
216 static const struct soc_enum poodle_enum[] = {
222 SOC_ENUM_EXT(
"Jack Function", poodle_enum[0], poodle_get_jack,
224 SOC_ENUM_EXT(
"Speaker Function", poodle_enum[1], poodle_get_spk,
246 .stream_name =
"WM8731",
247 .cpu_dai_name =
"pxa2xx-i2s",
248 .codec_dai_name =
"wm8731-hifi",
249 .platform_name =
"pxa-pcm-audio",
250 .codec_name =
"wm8731.0-001b",
251 .init = poodle_wm8731_init,
260 .dai_link = &poodle_dai,
264 .controls = wm8731_poodle_controls,
265 .num_controls =
ARRAY_SIZE(wm8731_poodle_controls),
266 .dapm_widgets = wm8731_dapm_widgets,
267 .num_dapm_widgets =
ARRAY_SIZE(wm8731_dapm_widgets),
268 .dapm_routes = poodle_audio_map,
269 .num_dapm_routes =
ARRAY_SIZE(poodle_audio_map),
289 dev_err(&pdev->
dev,
"snd_soc_register_card() failed: %d\n",
304 .name =
"poodle-audio",
307 .probe = poodle_probe,