static __devinit int msm_fe_dai_dev_probe(struct platform_device *pdev) { dev_dbg(&pdev->dev, "%s: dev name %s\n", __func__, dev_name(&pdev->dev)); return snd_soc_register_dais(&pdev->dev, msm_fe_dais, ARRAY_SIZE(msm_fe_dais)); }
static int timpani_codec_probe(struct platform_device *pdev) { struct snd_soc_codec *codec; struct timpani_drv_data *priv; pr_info("%s()\n", __func__); priv = kzalloc(sizeof(struct timpani_drv_data), GFP_KERNEL); if (priv == NULL) return -ENOMEM; codec = &priv->codec; snd_soc_codec_set_drvdata(codec, priv); priv->codec_pdata = pdev->dev.platform_data; mutex_init(&codec->mutex); INIT_LIST_HEAD(&codec->dapm_widgets); INIT_LIST_HEAD(&codec->dapm_paths); codec->name = "TIMPANI"; codec->owner = THIS_MODULE; codec->read = timpani_codec_read; codec->write = timpani_codec_write; codec->dai = timpani_codec_dai; codec->num_dai = ARRAY_SIZE(timpani_codec_dai); codec->control_data = platform_get_drvdata(pdev); timpani_codec = codec; snd_soc_register_dais(timpani_codec_dai, ARRAY_SIZE(timpani_codec_dai)); snd_soc_register_codec(codec); return 0; }
static int __init omap4panda_soc_init(void) { int ret = 0; if (!machine_is_omap4_panda()) { pr_err("Not Panda board!\n"); return -ENODEV; } pr_info("OMA4 Panda SoC init\n"); omap4panda_snd_device = platform_device_alloc("soc-audio", -1); if (!omap4panda_snd_device) { pr_err("Platform device allocation failed\n"); return -ENOMEM; } snd_soc_register_dais(&omap4panda_snd_device->dev, dai, ARRAY_SIZE(dai)); platform_set_drvdata(omap4panda_snd_device, &snd_soc_omap4panda); ret = platform_device_add(omap4panda_snd_device); if (ret) goto plat_err; twl6040_power_mode = 0; return 0; plat_err: platform_device_put(omap4panda_snd_device); return ret; }
static int __devinit snd_adonisuniv_probe(struct platform_device *pdev) { int ret; struct wm5102_machine_priv *wm5102; wm5102 = kzalloc(sizeof *wm5102, GFP_KERNEL); if (!wm5102) { pr_err("Failed to allocate memory\n"); return -ENOMEM; } exynos5_audio_set_mclk(1, 0); ret = snd_soc_register_dais(&pdev->dev, adonisuniv_ext_dai, ARRAY_SIZE(adonisuniv_ext_dai)); if (ret != 0) pr_err("Failed to register external DAIs: %d\n", ret); snd_soc_card_set_drvdata(&adonisuniv, wm5102); adonisuniv.dev = &pdev->dev; ret = snd_soc_register_card(&adonisuniv); if (ret) { dev_err(&pdev->dev, "snd_soc_register_card failed %d\n", ret); kfree(wm5102); } adonisuniv_gpio_init(); return ret; }
static int __init omap4_hdmi_soc_init(void) { int ret; if (!(machine_is_omap_4430sdp() || machine_is_omap4_panda())) return -ENODEV; printk(KERN_INFO "OMAP4 HDMI audio SoC init\n"); if (machine_is_omap4_panda()) snd_soc_omap4_hdmi.name = "PandaHDMI"; omap4_hdmi_snd_device = platform_device_alloc("soc-audio", OMAP4_HDMI_SND_DEV_ID); if (!omap4_hdmi_snd_device) { printk(KERN_ERR "Platform device allocation failed\n"); return -ENOMEM; } ret = snd_soc_register_dais(&omap4_hdmi_snd_device->dev, dai, ARRAY_SIZE(dai)); if (ret < 0) goto err; platform_set_drvdata(omap4_hdmi_snd_device, &snd_soc_omap4_hdmi); ret = platform_device_add(omap4_hdmi_snd_device); if (ret) goto err; return 0; err: printk(KERN_ERR "Unable to add platform device\n"); platform_device_put(omap4_hdmi_snd_device); return ret; }
static int __init smdkc110_init(void) { int ret; s3cdbg("Entered %s\n", __FUNCTION__); s3c_gpio_cfgpin (S5PC11X_GPC1(0), S3C_GPIO_SFN(3)); //GPC1CON[0] spdif_0_out s3c_gpio_setpull(S5PC11X_GPC1(0), S3C_GPIO_PULL_NONE); s3c_gpio_setpin (S5PC11X_GPC1(0), S3C_GPIO_PULL_NONE); s3c_gpio_cfgpin (S5PC11X_GPC1(1), S3C_GPIO_SFN(3)); //GPC1CON[1] spdif_extcal s3c_gpio_setpull(S5PC11X_GPC1(1), S3C_GPIO_PULL_NONE); s3c_gpio_setpin (S5PC11X_GPC1(1), S3C_GPIO_PULL_NONE); //Modified as per 2.6.29 ret=snd_soc_register_dais(spdif_dai,ARRAY_SIZE(spdif_dai)); if(ret){ s3cdbg("spdif_dai registration failed"); return ret; } smdkc110_snd_device = platform_device_alloc("soc-audio", 0); if (!smdkc110_snd_device){ s3cdbg("soc-audio allocation failed"); return -ENOMEM; } platform_set_drvdata(smdkc110_snd_device, &smdkc110_snd_devdata); smdkc110_snd_devdata.dev = &smdkc110_snd_device->dev; ret = platform_device_add(smdkc110_snd_device); if (ret) platform_device_put(smdkc110_snd_device); return ret; }
static int __devinit archos_omap4_soc_probe(struct platform_device *pdev) { int ret, no_twl6040; pr_info("%s: Archos Device SoC init\n", __func__); no_twl6040 = 0; if (!no_twl6040) { /* Master clock has to be enable to feed the TWL6040 */ pt_audio_device_io = archos_audio_twl6040_get_io(); } archos_omap4_snd_device = platform_device_alloc("soc-audio", -1); if (!archos_omap4_snd_device) { printk(KERN_ERR "Platform device allocation failed\n"); return -ENOMEM; } ret = snd_soc_register_dais(&archos_omap4_snd_device->dev, dai, ARRAY_SIZE(dai)); if (ret < 0) goto err; if (no_twl6040) platform_set_drvdata(archos_omap4_snd_device, &snd_soc_archos_omap4_no_twl6040); else platform_set_drvdata(archos_omap4_snd_device, &snd_soc_archos_omap4); ret = platform_device_add(archos_omap4_snd_device); if (ret) goto err_dev; /* regulators */ dmic_1v8 = regulator_get(&archos_omap4_snd_device->dev, "DMIC_1V8"); if (IS_ERR(dmic_1v8)) dev_dbg(&archos_omap4_snd_device->dev, "no DMIC_1V8\n"); if (!no_twl6040) { twl6040_codec = snd_soc_card_get_codec(&snd_soc_archos_omap4, "twl6040-codec"); if(twl6040_codec <= 0) { printk(KERN_ERR "archos_omap4: could not find `twl6040-codec`\n"); ret = -ENODEV; goto err_dev; } } return ret; err_dev: snd_soc_unregister_dais(&archos_omap4_snd_device->dev, ARRAY_SIZE(dai)); err: platform_device_put(archos_omap4_snd_device); if (!IS_ERR(dmic_1v8)) { regulator_disable(dmic_1v8); regulator_put(dmic_1v8); } return ret; }
static __devinit int asoc_vxrec_probe(struct platform_device *pdev) { int ret; ret = snd_soc_register_dais(&pdev->dev, omap_vxrec_dai, ARRAY_SIZE(omap_vxrec_dai)); return ret; }
static int __init sdp4430_soc_init(void) { int ret; if (!machine_is_omap_4430sdp() && !machine_is_omap4_panda() && !machine_is_omap_tabletblaze()) { pr_debug("Not SDP4430, BlazeTablet or PandaBoard!\n"); return -ENODEV; } printk(KERN_INFO "SDP4430 SoC init\n"); if (machine_is_omap_4430sdp()) snd_soc_sdp4430.name = "SDP4430"; else if (machine_is_omap4_panda()) snd_soc_sdp4430.name = "Panda"; else if (machine_is_omap_tabletblaze()) snd_soc_sdp4430.name = "Tablet44xx"; sdp4430_snd_device = platform_device_alloc("soc-audio", -1); if (!sdp4430_snd_device) { printk(KERN_ERR "Platform device allocation failed\n"); return -ENOMEM; } ret = snd_soc_register_dais(&sdp4430_snd_device->dev, dai, ARRAY_SIZE(dai)); if (ret < 0) goto err; platform_set_drvdata(sdp4430_snd_device, &snd_soc_sdp4430); ret = platform_device_add(sdp4430_snd_device); if (ret) goto err_dev; twl6040_codec = snd_soc_card_get_codec(&snd_soc_sdp4430, "twl6040-codec"); if(twl6040_codec <= 0) { printk(KERN_ERR "sdp4430: could not find `twl6040-codec`\n"); ret = -ENODEV; goto err_dev; } av_switch_reg = regulator_get(&sdp4430_snd_device->dev, "av-switch"); if (IS_ERR(av_switch_reg)) { ret = PTR_ERR(av_switch_reg); printk(KERN_ERR "couldn't get AV Switch regulator %d\n", ret); goto err_dev; } return ret; err_dev: snd_soc_unregister_dais(&sdp4430_snd_device->dev, ARRAY_SIZE(dai)); err: platform_device_put(sdp4430_snd_device); return ret; }
static __devinit int pxa2xx_ac97_dev_probe(struct platform_device *pdev) { if (pdev->id != -1) { dev_err(&pdev->dev, "PXA2xx has only one AC97 port.\n"); return -ENXIO; } return snd_soc_register_dais(&pdev->dev, pxa_ac97_dai_driver, ARRAY_SIZE(pxa_ac97_dai_driver)); }
static __devinit int msm_fe_dai_dev_probe(struct platform_device *pdev) { if (pdev->dev.of_node) dev_set_name(&pdev->dev, "%s", "msm-dai-fe"); dev_dbg(&pdev->dev, "%s: dev name %s\n", __func__, dev_name(&pdev->dev)); return snd_soc_register_dais(&pdev->dev, msm_fe_dais, ARRAY_SIZE(msm_fe_dais)); }
static __devinit int ipq_lpass_dai_probe(struct platform_device *pdev) { int ret; ret = snd_soc_register_dais(&pdev->dev, ipq_cpu_dais, ARRAY_SIZE(ipq_cpu_dais)); if (ret) dev_err(&pdev->dev, "%s: error registering soc dais\n", __func__); return ret; }
/* * Initialization routine. */ static int __init acclaim_soc_init (void) { int ret; struct device *dev; unsigned char board_ver = 3; void __iomem *phymux_base = NULL; u32 val; printk(KERN_INFO "Audio SoC init\n"); acclaim_snd_device = platform_device_alloc("soc-audio", -1); if (!acclaim_snd_device) { printk(KERN_INFO "Platform device allocation failed\n"); return -ENOMEM; } #ifdef CONFIG_ABE_44100 #warning "Configuring the ABE at 44.1 Khz." #endif if(board_ver == 3) { printk(KERN_INFO "Found Board EVT 2.1-ABE support Enabled\n"); platform_set_drvdata(acclaim_snd_device, &snd_soc_card_acclaim_abe); } else { printk(KERN_INFO "Not found Board EVT 2.1 - ABE support ommitted.\n"); platform_set_drvdata(acclaim_snd_device, &snd_soc_card_acclaim); } ret = platform_device_add(acclaim_snd_device); if (ret){ printk(KERN_INFO "%s: platform device allocation failed\n", __func__); goto err_dev; } ret=snd_soc_register_dais(&acclaim_snd_device->dev, mach_dai, ARRAY_SIZE(mach_dai)); if (ret < 0) goto err; dev = &acclaim_snd_device->dev; /* * Enable the GPIO related code-base on the ACCLAIM Board for * Headphone/MIC Detection */ phymux_base = ioremap (0x4a100000, 0x1000); val = __raw_readl(phymux_base + 0x90); val = ((val & 0xFEFCFFFE) | 0x01030003); /*__raw_writel (0x01030003, phymux_base + 0x90); */ __raw_writel (val, phymux_base + 0x90); iounmap(phymux_base); return 0; err_dev: snd_soc_unregister_dais(&acclaim_snd_device->dev, ARRAY_SIZE(mach_dai)); err: platform_device_put(acclaim_snd_device); return ret; }
static int __init sdp4430_soc_init(void) { int ret = 0; if (!machine_is_omap_4430sdp() && !machine_is_omap_tabletblaze()) { pr_debug("Not SDP4430 or BlazeTablet\n"); return -ENODEV; } printk(KERN_INFO "SDP4430 SoC init\n"); sdp4430_snd_device = platform_device_alloc("soc-audio", -1); if (!sdp4430_snd_device) { printk(KERN_ERR "Platform device allocation failed\n"); return -ENOMEM; } snd_soc_register_dais(&sdp4430_snd_device->dev, dai, ARRAY_SIZE(dai)); platform_set_drvdata(sdp4430_snd_device, &snd_soc_sdp4430); ret = platform_device_add(sdp4430_snd_device); if (ret) goto plat_err; av_switch_reg = regulator_get(&sdp4430_snd_device->dev, "av-switch"); if (IS_ERR(av_switch_reg)) { ret = PTR_ERR(av_switch_reg); printk(KERN_ERR "couldn't get AV Switch regulator %d\n", ret); goto reg_err; } /* Default mode is low-power, MCLK not required */ twl6040_power_mode = 0; cdc_tcxo_set_req_int(CDC_TCXO_CLK2, 0); /* * CDC CLK2 supplies TWL6040 MCLK, drive it from REQ2INT to * have full control of MCLK gating */ cdc_tcxo_set_req_prio(CDC_TCXO_CLK2, CDC_TCXO_PRIO_REQINT); return ret; reg_err: platform_device_del(sdp4430_snd_device); plat_err: printk(KERN_ERR "Unable to add platform device\n"); platform_device_put(sdp4430_snd_device); return ret; }
/* --------------------------------------------------------------------- * OF platform bus binding code: * - Probe/remove operations * - OF device match table */ static int __devinit psc_i2s_of_probe(struct of_device *op, const struct of_device_id *match) { int rc; struct psc_dma *psc_dma; struct mpc52xx_psc __iomem *regs; rc = mpc5200_audio_dma_create(op); if (rc != 0) return rc; rc = snd_soc_register_dais(psc_i2s_dai, ARRAY_SIZE(psc_i2s_dai)); if (rc != 0) { pr_err("Failed to register DAI\n"); return 0; } psc_dma = dev_get_drvdata(&op->dev); regs = psc_dma->psc_regs; /* Configure the serial interface mode; defaulting to CODEC8 mode */ psc_dma->sicr = MPC52xx_PSC_SICR_DTS1 | MPC52xx_PSC_SICR_I2S | MPC52xx_PSC_SICR_CLKPOL; out_be32(&psc_dma->psc_regs->sicr, psc_dma->sicr | MPC52xx_PSC_SICR_SIM_CODEC_8); /* Check for the codec handle. If it is not present then we * are done */ if (!of_get_property(op->node, "codec-handle", NULL)) return 0; /* Due to errata in the dma mode; need to line up enabling * the transmitter with a transition on the frame sync * line */ /* first make sure it is low */ while ((in_8(®s->ipcr_acr.ipcr) & 0x80) != 0) ; /* then wait for the transition to high */ while ((in_8(®s->ipcr_acr.ipcr) & 0x80) == 0) ; /* Finally, enable the PSC. * Receiver must always be enabled; even when we only want * transmit. (see 15.3.2.3 of MPC5200B User's Guide) */ /* Go */ out_8(&psc_dma->psc_regs->command, MPC52xx_PSC_TX_ENABLE | MPC52xx_PSC_RX_ENABLE); return 0; }
static __devinit int pxa2xx_ac97_dev_probe(struct platform_device *pdev) { if (pdev->id != -1) { dev_err(&pdev->dev, "PXA2xx has only one AC97 port.\n"); return -ENXIO; } /* Punt most of the init to the SoC probe; we may need the machine * driver to do interesting things with the clocking to get us up * and running. */ return snd_soc_register_dais(&pdev->dev, pxa_ac97_dai, ARRAY_SIZE(pxa_ac97_dai)); }
static int __init sdp4430_soc_init(void) { struct i2c_adapter *adapter; int ret; if (!machine_is_omap_4430sdp() && !machine_is_omap4_panda()) { pr_debug("Not SDP4430 or PandaBoard!\n"); return -ENODEV; } printk(KERN_INFO "SDP4430 SoC init\n"); sdp4430_snd_device = platform_device_alloc("soc-audio", -1); if (!sdp4430_snd_device) { printk(KERN_ERR "Platform device allocation failed\n"); return -ENOMEM; } snd_soc_register_dais(&sdp4430_snd_device->dev, dai, ARRAY_SIZE(dai)); platform_set_drvdata(sdp4430_snd_device, &snd_soc_sdp4430); ret = platform_device_add(sdp4430_snd_device); if (ret) goto err; adapter = i2c_get_adapter(1); if (!adapter) { printk(KERN_ERR "can't get i2c adapter\n"); return -ENODEV; } tps6130x_client = i2c_new_device(adapter, &tps6130x_hwmon_info); if (!tps6130x_client) { printk(KERN_ERR "can't add i2c device\n"); return -ENODEV; } /* Only configure the TPS6130x on SDP4430 */ if (machine_is_omap_4430sdp()) sdp4430_tps6130x_configure(); return 0; err: printk(KERN_ERR "Unable to add platform device\n"); platform_device_put(sdp4430_snd_device); return ret; }
static int __devinit psc_i2s_of_probe(struct platform_device *op) { int rc; struct psc_dma *psc_dma; struct mpc52xx_psc __iomem *regs; rc = snd_soc_register_dais(&op->dev, psc_i2s_dai, ARRAY_SIZE(psc_i2s_dai)); if (rc != 0) { pr_err("Failed to register DAI\n"); return rc; } psc_dma = dev_get_drvdata(&op->dev); regs = psc_dma->psc_regs; /* */ psc_dma->sicr = MPC52xx_PSC_SICR_DTS1 | MPC52xx_PSC_SICR_I2S | MPC52xx_PSC_SICR_CLKPOL; out_be32(&psc_dma->psc_regs->sicr, psc_dma->sicr | MPC52xx_PSC_SICR_SIM_CODEC_8); /* */ if (!of_get_property(op->dev.of_node, "codec-handle", NULL)) return 0; /* */ /* */ while ((in_8(®s->ipcr_acr.ipcr) & 0x80) != 0) ; /* */ while ((in_8(®s->ipcr_acr.ipcr) & 0x80) == 0) ; /* */ /* */ out_8(&psc_dma->psc_regs->command, MPC52xx_PSC_TX_ENABLE | MPC52xx_PSC_RX_ENABLE); return 0; }
static int sst_platform_probe(struct platform_device *pdev) { int ret; pr_debug("sst_platform_probe called\n"); ret = snd_soc_register_platform(&pdev->dev, &sst_soc_platform_drv); if (ret) { pr_err("registering soc platform failed\n"); return ret; } ret = snd_soc_register_dais(&pdev->dev, sst_platform_dai, ARRAY_SIZE(sst_platform_dai)); if (ret) { pr_err("registering cpu dais failed\n"); snd_soc_unregister_platform(&pdev->dev); } return ret; }
static int __init cosmopolitan_soc_init(void) { int ret; if (!machine_is_cosmopolitan()) { pr_debug("Not COSMOPOLITAN!\n"); return -ENODEV; } printk(KERN_INFO "COSMOPOLITAN SoC init\n"); sdp4430_snd_device = platform_device_alloc("soc-audio", -1); if (!sdp4430_snd_device) { printk(KERN_ERR "Platform device allocation failed\n"); return -ENOMEM; } snd_soc_register_dais(&sdp4430_snd_device->dev, dai, ARRAY_SIZE(dai)); platform_set_drvdata(sdp4430_snd_device, &snd_soc_sdp4430); ret = platform_device_add(sdp4430_snd_device); if (ret) goto plat_err; /* Default mode is low-power, MCLK not required */ twl6040_power_mode = 0; cdc_tcxo_set_req_int(CDC_TCXO_CLK2, 0); /* * CDC CLK2 supplies TWL6040 MCLK, drive it from REQ2INT to * have full control of MCLK gating */ cdc_tcxo_set_req_prio(CDC_TCXO_CLK2, CDC_TCXO_PRIO_REQINT); return ret; plat_err: printk(KERN_ERR "Unable to add platform device\n"); platform_device_put(sdp4430_snd_device); return ret; }
static int ssp_dai_probe(struct platform_device *pdev) { int ret; struct workqueue_struct *ssp_dai_wq; pr_debug("SSP DAI: FCT %s enters\n", __func__); ret = snd_soc_register_platform(&pdev->dev, &soc_ssp_platform_drv); if (ret) { pr_err("registering SSP PLATFORM failed\n"); snd_soc_unregister_dai(&pdev->dev); return -EBUSY; } ret = snd_soc_register_dais(&pdev->dev, intel_ssp_platform_dai, ARRAY_SIZE(intel_ssp_platform_dai)); if (ret) { pr_err("registering cpu DAIs failed\n"); snd_soc_unregister_dai(&pdev->dev); return -EBUSY; } ssp_dai_wq = create_workqueue("ssp_transfer_data"); if (!ssp_dai_wq) { pr_err("work queue failed\n"); snd_soc_unregister_dai(&pdev->dev); return -ENOMEM; } platform_set_drvdata(pdev, ssp_dai_wq); pr_debug("SSP DAI: FCT %s leaves %d\n", __func__, ret); return ret; }
static int __init sdp4430_soc_init(void) { int ret; if (!machine_is_omap_4430sdp() && !machine_is_omap4_panda()) { pr_debug("Not SDP4430 or PandaBoard!\n"); return -ENODEV; } printk(KERN_INFO "SDP4430 SoC init\n"); if (machine_is_omap_4430sdp()) snd_soc_sdp4430.name = "SDP4430"; else if (machine_is_omap4_panda()) snd_soc_sdp4430.name = "Panda"; sdp4430_snd_device = platform_device_alloc("soc-audio", -1); if (!sdp4430_snd_device) { printk(KERN_ERR "Platform device allocation failed\n"); return -ENOMEM; } ret = snd_soc_register_dais(&sdp4430_snd_device->dev, dai, ARRAY_SIZE(dai)); if (ret < 0) goto err; platform_set_drvdata(sdp4430_snd_device, &snd_soc_sdp4430); ret = platform_device_add(sdp4430_snd_device); if (ret) goto err; twl6040_codec = snd_soc_card_get_codec(&snd_soc_sdp4430, "twl6040-codec"); return 0; err: printk(KERN_ERR "Unable to add platform device\n"); platform_device_put(sdp4430_snd_device); return ret; }
static int __init midas_audio_init(void) { struct wm1811_machine_priv *wm1811; int ret; wm1811 = kzalloc(sizeof *wm1811, GFP_KERNEL); if (!wm1811) { pr_err("Failed to allocate memory\n"); ret = -ENOMEM; goto err_kzalloc; } snd_soc_card_set_drvdata(&midas, wm1811); midas_snd_device = platform_device_alloc("soc-audio", -1); if (!midas_snd_device) { ret = -ENOMEM; goto err_device_alloc; } ret = snd_soc_register_dais(&midas_snd_device->dev, midas_ext_dai, ARRAY_SIZE(midas_ext_dai)); if (ret != 0) pr_err("Failed to register external DAIs: %d\n", ret); platform_set_drvdata(midas_snd_device, &midas); ret = platform_device_add(midas_snd_device); if (ret) platform_device_put(midas_snd_device); midas_gpio_init(); return ret; err_device_alloc: kfree(wm1811); err_kzalloc: return ret; }
static int __init midas_audio_init(void) { int ret; midas_snd_device = platform_device_alloc("soc-audio", -1); if (!midas_snd_device) return -ENOMEM; ret = snd_soc_register_dais(&midas_snd_device->dev, midas_ext_dai, ARRAY_SIZE(midas_ext_dai)); if (ret != 0) pr_err("Failed to register external DAIs: %d\n", ret); platform_set_drvdata(midas_snd_device, &midas); ret = platform_device_add(midas_snd_device); if (ret) platform_device_put(midas_snd_device); midas_gpio_init(); return ret; }
static int __init omap4_audio_init(void) { int ret; hp_output_mode = 1; ear_select.gpio = omap_muxtbl_get_gpio_by_name(ear_select.label); if (ear_select.gpio == -EINVAL) return -EINVAL; ret = gpio_request(ear_select.gpio, "ear_select"); if (ret < 0) goto ear_select_err; gpio_direction_output(ear_select.gpio, hp_output_mode); main_mic_bias.gpio = omap_muxtbl_get_gpio_by_name(main_mic_bias.label); if (main_mic_bias.gpio == -EINVAL) { pr_err("failed to get gpio name for %s\n", main_mic_bias.label); ret = -EINVAL; goto main_mic_err; } ret = gpio_request(main_mic_bias.gpio, "main_mic_bias"); if (ret < 0) goto main_mic_err; gpio_direction_output(main_mic_bias.gpio, 0); pm_qos_add_request(&pm_qos_handle, PM_QOS_CPU_DMA_LATENCY, PM_QOS_DEFAULT_VALUE); #if defined(CONFIG_MACH_SAMSUNG_ESPRESSO) \ || defined(CONFIG_MACH_SAMSUNG_ESPRESSO_CHN_CMCC) sub_mic_bias.gpio = omap_muxtbl_get_gpio_by_name(sub_mic_bias.label); if (sub_mic_bias.gpio == -EINVAL) { pr_err("failed to get gpio name for %s\n", sub_mic_bias.label); ret = -EINVAL; goto sub_mic_err; } ret = gpio_request(sub_mic_bias.gpio, "sub_mic_bias"); if (ret < 0) goto sub_mic_err; gpio_direction_output(sub_mic_bias.gpio, 0); #endif omap4_wm8994_snd_device = platform_device_alloc("soc-audio", -1); if (!omap4_wm8994_snd_device) { pr_err("Platform device allocation failed\n"); ret = -ENOMEM; goto device_err; } ret = snd_soc_register_dais(&omap4_wm8994_snd_device->dev, ext_dai, ARRAY_SIZE(ext_dai)); if (ret != 0) { pr_err("Failed to register external DAIs: %d\n", ret); goto dai_err; } platform_set_drvdata(omap4_wm8994_snd_device, &omap4_wm8994); ret = platform_device_add(omap4_wm8994_snd_device); if (ret) { pr_err("Platform device allocation failed\n"); goto err; } return ret; err: snd_soc_unregister_dai(&omap4_wm8994_snd_device->dev); dai_err: platform_device_put(omap4_wm8994_snd_device); device_err: #if defined(CONFIG_MACH_SAMSUNG_ESPRESSO) \ || defined(CONFIG_MACH_SAMSUNG_ESPRESSO_CHN_CMCC) gpio_free(sub_mic_bias.gpio); sub_mic_err: #endif gpio_free(main_mic_bias.gpio); main_mic_err: gpio_free(ear_select.gpio); ear_select_err: return ret; }
static int __init sdp4430_soc_init(void) { int ret; if (!machine_is_omap_4430sdp() && !machine_is_omap4_panda() && !machine_is_omap_tabletblaze()) { pr_debug("Not SDP4430, BlazeTablet or PandaBoard!\n"); return -ENODEV; } printk(KERN_INFO "SDP4430 SoC init\n"); if (machine_is_omap_4430sdp()) snd_soc_sdp4430.name = "SDP4430"; else if (machine_is_omap4_panda()) snd_soc_sdp4430.name = "Panda"; else if (machine_is_omap_tabletblaze()) snd_soc_sdp4430.name = "Tablet44xx"; sdp4430_snd_device = platform_device_alloc("soc-audio", -1); if (!sdp4430_snd_device) { printk(KERN_ERR "Platform device allocation failed\n"); return -ENOMEM; } ret = snd_soc_register_dais(&sdp4430_snd_device->dev, dai, ARRAY_SIZE(dai)); if (ret < 0) goto err; platform_set_drvdata(sdp4430_snd_device, &snd_soc_sdp4430); ret = platform_device_add(sdp4430_snd_device); if (ret) goto err_dev; twl6040_codec = snd_soc_card_get_codec(&snd_soc_sdp4430, "twl6040-codec"); if(twl6040_codec <= 0) { printk(KERN_ERR "sdp4430: could not find `twl6040-codec`\n"); ret = -ENODEV; goto err_dev; } /*av_switch_reg = regulator_get(&sdp4430_snd_device->dev, "av-switch"); if (IS_ERR(av_switch_reg)) { ret = PTR_ERR(av_switch_reg); printk(KERN_ERR "couldn't get AV Switch regulator %d\n", ret); goto err_dev; }*/ /* Default mode is low-power, MCLK not required */ twl6040_power_mode = 0; cdc_tcxo_set_req_int(CDC_TCXO_CLK2, 0); /* * CDC CLK2 supplies TWL6040 MCLK, drive it from REQ2INT to * have full control of MCLK gating */ cdc_tcxo_set_req_prio(CDC_TCXO_CLK2, CDC_TCXO_PRIO_REQINT); return ret; err_dev: snd_soc_unregister_dais(&sdp4430_snd_device->dev, ARRAY_SIZE(dai)); err: platform_device_put(sdp4430_snd_device); return ret; }
static int __init atmel_ssc_modinit(void) { return snd_soc_register_dais(atmel_ssc_dai, ARRAY_SIZE(atmel_ssc_dai)); }
static __devinit int asoc_echo_probe(struct platform_device *pdev) { return snd_soc_register_dais(&pdev->dev, omap_echo_dai, ARRAY_SIZE(omap_echo_dai)); }
static int __init pxa3xx_ssp_modinit(void) { return snd_soc_register_dais(ARRAY_AND_SIZE(pxa3xx_ssp_dai)); }
static int __init msm_cpu_dai_init(void) { return snd_soc_register_dais(msm_cpu_dai, ARRAY_SIZE(msm_cpu_dai)); }