当前位置: 首页>>代码示例>>C++>>正文


C++ snd_soc_register_dais函数代码示例

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


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


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