27 #include <linux/module.h>
39 #define OMAP3_PANDORA_DAC_POWER_GPIO 118
40 #define OMAP3_PANDORA_AMP_POWER_GPIO 14
42 #define PREFIX "ASoC omap3pandora: "
44 static struct regulator *omap3pandora_dac_reg;
121 0, 0, omap3pandora_dac_event,
124 0, 0,
NULL, 0, omap3pandora_hp_event,
137 {
"PCM DAC",
NULL,
"APLL Enable"},
138 {
"Headphone Amplifier",
NULL,
"PCM DAC"},
139 {
"Line Out",
NULL,
"PCM DAC"},
140 {
"Headphone Jack",
NULL,
"Headphone Amplifier"},
144 {
"AUXL",
NULL,
"Line In"},
145 {
"AUXR",
NULL,
"Line In"},
147 {
"MAINMIC",
NULL,
"Mic Bias 1"},
148 {
"Mic Bias 1",
NULL,
"Mic (internal)"},
150 {
"SUBMIC",
NULL,
"Mic Bias 2"},
151 {
"Mic Bias 2",
NULL,
"Mic (external)"},
203 .hw_params = omap3pandora_hw_params,
210 .stream_name =
"HiFi Out",
211 .cpu_dai_name =
"omap-mcbsp.2",
212 .codec_dai_name =
"twl4030-hifi",
213 .platform_name =
"omap-pcm-audio",
214 .codec_name =
"twl4030-codec",
217 .ops = &omap3pandora_ops,
218 .init = omap3pandora_out_init,
221 .stream_name =
"Line/Mic In",
222 .cpu_dai_name =
"omap-mcbsp.4",
223 .codec_dai_name =
"twl4030-hifi",
224 .platform_name =
"omap-pcm-audio",
225 .codec_name =
"twl4030-codec",
228 .ops = &omap3pandora_ops,
229 .init = omap3pandora_in_init,
234 static struct snd_soc_card snd_soc_card_omap3pandora = {
235 .name =
"omap3pandora",
237 .dai_link = omap3pandora_dai,
243 static int __init omap3pandora_soc_init(
void)
247 if (!machine_is_omap3_pandora())
250 pr_info(
"OMAP3 Pandora SoC init\n");
260 pr_err(
PREFIX "Failed to set DAC power GPIO direction\n");
272 pr_err(
PREFIX "Failed to set amp power GPIO direction\n");
277 if (omap3pandora_snd_device ==
NULL) {
283 platform_set_drvdata(omap3pandora_snd_device, &snd_soc_card_omap3pandora);
292 if (IS_ERR(omap3pandora_dac_reg)) {
293 pr_err(
PREFIX "Failed to get DAC regulator from %s: %ld\n",
294 dev_name(&omap3pandora_snd_device->
dev),
295 PTR_ERR(omap3pandora_dac_reg));
296 ret = PTR_ERR(omap3pandora_dac_reg);
314 static void __exit omap3pandora_soc_exit(
void)