• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ snd_soc_register_dais函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中snd_soc_register_dais函数的典型用法代码示例。如果您正苦于以下问题:C++ snd_soc_register_dais函数的具体用法?C++ snd_soc_register_dais怎么用?C++ snd_soc_register_dais使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了snd_soc_register_dais函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: msm_fe_dai_dev_probe

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));
}
开发者ID:Kra1o5,项目名称:android_kernel_huawei_u8815-gb,代码行数:7,代码来源:msm-dai-fe.c


示例2: timpani_codec_probe

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;
}
开发者ID:404992361,项目名称:mi1_kernel,代码行数:32,代码来源:timpani.c


示例3: snd_adonisuniv_probe

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;
}
开发者ID:halaszk,项目名称:android_kernel_samsung_lt03,代码行数:31,代码来源:adonisuniv_wm5102.c


示例4: omap4_hdmi_soc_init

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;
}
开发者ID:lchao-bit,项目名称:linaro-kernel,代码行数:33,代码来源:omap4-hdmi-card.c


示例5: smdkc110_init

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;
}
开发者ID:mhgazz,项目名称:Android-Eclair-Kernel-Source-v2.6.29.6,代码行数:33,代码来源:smdkc110_spdif.c


示例6: asoc_vxrec_probe

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;
}
开发者ID:manusreload,项目名称:android_kernel_huawei_omap4,代码行数:9,代码来源:omap-vxrec.c


示例7: pxa2xx_ac97_dev_probe

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));
}
开发者ID:MiniBlu,项目名称:cm11_kernel_htc_msm8974a3ul,代码行数:10,代码来源:pxa2xx-ac97.c


示例8: msm_fe_dai_dev_probe

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));
}
开发者ID:SaberMod,项目名称:android_kernel_lge_hammerhead-sts,代码行数:10,代码来源:msm-dai-fe.c


示例9: ipq_lpass_dai_probe

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;
}
开发者ID:darcyg,项目名称:ap_project_v2,代码行数:11,代码来源:ipq-cpu-dai.c


示例10: acclaim_soc_init

/*
 * 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;
}
开发者ID:LeaderRider,项目名称:kernel3NookTablet,代码行数:56,代码来源:omap4_aic3100.c


示例11: psc_i2s_of_probe

/* ---------------------------------------------------------------------
 * 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(&regs->ipcr_acr.ipcr) & 0x80) != 0)
		;
	/* then wait for the transition to high */
	while ((in_8(&regs->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;

}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:57,代码来源:mpc5200_psc_i2s.c


示例12: pxa2xx_ac97_dev_probe

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));
}
开发者ID:AdiPat,项目名称:i9003_Kernel,代码行数:14,代码来源:pxa2xx-ac97.c


示例13: sdp4430_soc_init

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;
}
开发者ID:mephistophilis,项目名称:samsung_nowplus_kernel,代码行数:48,代码来源:sdp4430.c


示例14: psc_i2s_of_probe

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(&regs->ipcr_acr.ipcr) & 0x80) != 0)
		;
	/*                                      */
	while ((in_8(&regs->ipcr_acr.ipcr) & 0x80) == 0)
		;
	/*                         
                                                           
                                                       */

	/*    */
	out_8(&psc_dma->psc_regs->command,
			MPC52xx_PSC_TX_ENABLE | MPC52xx_PSC_RX_ENABLE);

	return 0;

}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:47,代码来源:mpc5200_psc_i2s.c


示例15: sst_platform_probe

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;
}
开发者ID:LittleForker,项目名称:linux-2.6,代码行数:19,代码来源:sst_platform.c


示例16: ssp_dai_probe

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;
}
开发者ID:kamarush,项目名称:ZTE_GXIn_Kernel-3.0.8,代码行数:41,代码来源:mid_ssp.c


示例17: sdp4430_soc_init

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;
}
开发者ID:atripathi,项目名称:i-bot,代码行数:39,代码来源:sdp4430.c


示例18: midas_audio_init

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;
}
开发者ID:adamoutler,项目名称:EK-GC100_Galaxy_Camera,代码行数:39,代码来源:midas_wm1811.c


示例19: midas_audio_init

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;
}
开发者ID:SaMioalz,项目名称:GT-N7000-ICS-3.0.y,代码行数:23,代码来源:midas_wm1811.c


示例20: omap4_audio_init

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;
}
开发者ID:nickh186,项目名称:Samsung-GT-P3113-AOSP-CM-Kernel-and-Ramdisk,代码行数:86,代码来源:omap_wm8994.c



注:本文中的snd_soc_register_dais函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ snd_soc_register_platform函数代码示例发布时间:2022-05-30
下一篇:
C++ snd_soc_register_component函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap