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


C++ snd_soc_register_card函数代码示例

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


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

示例1: rockchip_wm8900_audio_probe

static int rockchip_wm8900_audio_probe(struct platform_device *pdev)
{
	int ret;
	struct snd_soc_card *card = &rockchip_wm8900_snd_card;

	card->dev = &pdev->dev;

	ret = rockchip_of_get_sound_card_info(card);
	if (ret) {
		printk("%s() get sound card info failed:%d\n", __FUNCTION__, ret);
		return ret;
	}

	ret = snd_soc_register_card(card);
	if (ret)
		printk("%s() register card failed:%d\n", __FUNCTION__, ret);

	return ret;
}
开发者ID:lgeek,项目名称:linux-tronsmart-orion-r28,代码行数:19,代码来源:rk_wm8900.c

示例2: snd_smdk_probe

/*
 * After SMDKC110 Base Board's Rev is '0.1', 12MHz External OSC(X1)
 * is absent (or not connected), so we connect EXT_VOICE_CLK(OSC4),
 * 2.0484Mhz, directly with MCLK both Codec and SoC.
 */
static int __devinit snd_smdk_probe(struct platform_device *pdev)
{
	int ret = 0;

	xtal_freq = SMDK_WM8580_EXT_OSC;
	mclk_freq = SMDK_WM8580_EXT_MCLK;

	if (machine_is_smdkc110() || machine_is_smdkv210())
		xtal_freq = mclk_freq = SMDK_WM8580_EXT_VOICE;

	smdk_pcm.dev = &pdev->dev;
	ret = snd_soc_register_card(&smdk_pcm);
	if (ret) {
		dev_err(&pdev->dev, "snd_soc_register_card failed %d\n", ret);
		return ret;
	}

	return 0;
}
开发者ID:GerardGarcia,项目名称:linux,代码行数:24,代码来源:smdk_wm8580pcm.c

示例3: asoc_simple_card_probe

static int asoc_simple_card_probe(struct platform_device *pdev)
{
	struct asoc_simple_card_info *cinfo = pdev->dev.platform_data;
	struct device *dev = &pdev->dev;

	if (!cinfo) {
		dev_err(dev, "no info for asoc-simple-card\n");
		return -EINVAL;
	}

	if (!cinfo->name	||
	    !cinfo->card	||
	    !cinfo->codec	||
	    !cinfo->platform	||
	    !cinfo->cpu_dai.name ||
	    !cinfo->codec_dai.name) {
		dev_err(dev, "insufficient asoc_simple_card_info settings\n");
		return -EINVAL;
	}

	/*
	 * init snd_soc_dai_link
	 */
	cinfo->snd_link.name		= cinfo->name;
	cinfo->snd_link.stream_name	= cinfo->name;
	cinfo->snd_link.cpu_dai_name	= cinfo->cpu_dai.name;
	cinfo->snd_link.platform_name	= cinfo->platform;
	cinfo->snd_link.codec_name	= cinfo->codec;
	cinfo->snd_link.codec_dai_name	= cinfo->codec_dai.name;
	cinfo->snd_link.init		= asoc_simple_card_dai_init;

	/*
	 * init snd_soc_card
	 */
	cinfo->snd_card.name		= cinfo->card;
	cinfo->snd_card.owner		= THIS_MODULE;
	cinfo->snd_card.dai_link	= &cinfo->snd_link;
	cinfo->snd_card.num_links	= 1;
	cinfo->snd_card.dev		= &pdev->dev;

	return snd_soc_register_card(&cinfo->snd_card);
}
开发者ID:AnadoluPanteri,项目名称:kernel-plus-harmattan,代码行数:42,代码来源:simple-card.c

示例4: snappercl15_probe

static int __devinit snappercl15_probe(struct platform_device *pdev)
{
	struct snd_soc_card *card = &snd_soc_snappercl15;
	int ret;

	ret = ep93xx_i2s_acquire();
	if (ret)
		return ret;

	card->dev = &pdev->dev;

	ret = snd_soc_register_card(card);
	if (ret) {
		dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
			ret);
		ep93xx_i2s_release();
	}

	return ret;
}
开发者ID:404992361,项目名称:mi1_kernel,代码行数:20,代码来源:snappercl15.c

示例5: e750_probe

static int e750_probe(struct platform_device *pdev)
{
	struct snd_soc_card *card = &e750;
	int ret;

	ret = gpio_request_array(e750_audio_gpios,
				 ARRAY_SIZE(e750_audio_gpios));
	if (ret)
		return ret;

	card->dev = &pdev->dev;

	ret = snd_soc_register_card(card);
	if (ret) {
		dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
			ret);
		gpio_free_array(e750_audio_gpios, ARRAY_SIZE(e750_audio_gpios));
	}
	return ret;
}
开发者ID:383530895,项目名称:linux,代码行数:20,代码来源:e750_wm9705.c

示例6: hx4700_audio_probe

static int hx4700_audio_probe(struct platform_device *pdev)
{
	int ret;

	if (!machine_is_h4700())
		return -ENODEV;

	ret = gpio_request_array(hx4700_audio_gpios,
				ARRAY_SIZE(hx4700_audio_gpios));
	if (ret)
		return ret;

	snd_soc_card_hx4700.dev = &pdev->dev;
	ret = snd_soc_register_card(&snd_soc_card_hx4700);
	if (ret)
		gpio_free_array(hx4700_audio_gpios,
				ARRAY_SIZE(hx4700_audio_gpios));

	return ret;
}
开发者ID:3null,项目名称:linux,代码行数:20,代码来源:hx4700.c

示例7: zed_adau1761_probe

static int __devinit zed_adau1761_probe(struct platform_device *pdev)
{
	struct snd_soc_card *card = &zed_adau1761_card;
	struct device_node *of_node = pdev->dev.of_node;

	if (!of_node)
		return -ENXIO;

	card->dev = &pdev->dev;

	zed_adau1761_dai_link.codec_of_node = of_parse_phandle(of_node, "audio-codec", 0);
	zed_adau1761_dai_link.cpu_dai_of_node = of_parse_phandle(of_node, "cpu-dai", 0);
	zed_adau1761_dai_link.platform_of_node = of_parse_phandle(of_node, "pcm", 0);

	if (!zed_adau1761_dai_link.codec_of_node || !zed_adau1761_dai_link.cpu_dai_of_node ||
		!zed_adau1761_dai_link.platform_of_node)
		return -ENXIO;

	return snd_soc_register_card(card);
}
开发者ID:andywu24,项目名称:linux-digilent,代码行数:20,代码来源:zed_adau1761.c

示例8: dfl61wl1273_probe

static __devinit int dfl61wl1273_probe(struct platform_device *pdev)
{
	int err;
	struct snd_soc_card *card = &dfl61wl1273_sound_card;

	if (!machine_is_nokia_rm680() && !machine_is_nokia_rm696())
		return -ENODEV;	
	printk(KERN_INFO "ALSA for WL1273 on Nokia DFL61 init\n");

	card->dev = &pdev->dev;

	err = snd_soc_register_card(card);
	if (err) {
		printk(KERN_ERR "Error: %d\n", err);
		return err;
	}

	printk(KERN_INFO "DFL61 WL1273 init done\n");

	return 0;
}
开发者ID:7hunderbug,项目名称:kernel-adaptation-n950-n9,代码行数:21,代码来源:dfl61-wl1273.c

示例9: simone_probe

static int __devinit simone_probe(struct platform_device *pdev)
{
	struct snd_soc_card *card = &snd_soc_simone;
	int ret;

	simone_snd_ac97_device = platform_device_register_simple("ac97-codec",
								 -1, NULL, 0);
	if (IS_ERR(simone_snd_ac97_device))
		return PTR_ERR(simone_snd_ac97_device);

	card->dev = &pdev->dev;

	ret = snd_soc_register_card(card);
	if (ret) {
		dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
			ret);
		platform_device_unregister(simone_snd_ac97_device);
	}

	return ret;
}
开发者ID:33d,项目名称:linux-2.6.21-hh20,代码行数:21,代码来源:simone.c

示例10: poodle_probe

static int __devinit poodle_probe(struct platform_device *pdev)
{
	struct snd_soc_card *card = &poodle;
	int ret;

	locomo_gpio_set_dir(&poodle_locomo_device.dev,
		POODLE_LOCOMO_GPIO_AMP_ON, 0);
	/*                                               */
	locomo_gpio_set_dir(&poodle_locomo_device.dev,
		POODLE_LOCOMO_GPIO_MUTE_L, 0);
	locomo_gpio_set_dir(&poodle_locomo_device.dev,
		POODLE_LOCOMO_GPIO_MUTE_R, 0);

	card->dev = &pdev->dev;

	ret = snd_soc_register_card(card);
	if (ret)
		dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
			ret);
	return ret;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:21,代码来源:poodle.c

示例11: sunxi_snddaudio0_dev_probe

static int __devinit sunxi_snddaudio0_dev_probe(struct platform_device *pdev)
{
	int ret = 0;
	script_item_u val;
	script_item_value_type_e  type;
	struct snd_soc_card *card = &snd_soc_sunxi_snddaudio;

	type = script_get_item(TDM_NAME, "daudio_select", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
        pr_err("[I2S0] daudio_select type err!\n");
    }
	daudio_pcm_select = val.val;

	type = script_get_item(TDM_NAME, "daudio_master", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
        pr_err("[I2S0] daudio_master type err!\n");
    }
	daudio_master = val.val;
	
	type = script_get_item(TDM_NAME, "audio_format", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
        pr_err("[I2S0] audio_format type err!\n");
    }
	audio_format = val.val;

	type = script_get_item(TDM_NAME, "signal_inversion", &val);
	if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {
        pr_err("[I2S0] signal_inversion type err!\n");
    }
	signal_inversion = val.val;
 #ifdef CONFIG_HAS_EARLYSUSPEND
	register_early_suspend(&rt3261_early_suspend_handler);
 #endif
	card->dev = &pdev->dev;
	ret = snd_soc_register_card(card);
	if (ret) {
		dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ret);
	}
	return ret;
}
开发者ID:xwliu,项目名称:Cubietruck_Plus-kernel-source,代码行数:40,代码来源:h3_rt3261.c

示例12: omap_abe_probe

static __devinit int omap_abe_probe(struct platform_device *pdev)
{
	struct omap_abe_twl6040_data *pdata = dev_get_platdata(&pdev->dev);
	struct snd_soc_card *card = &omap_abe_card;
	int ret;

	card->dev = &pdev->dev;

	if (!pdata) {
		dev_err(&pdev->dev, "Missing pdata\n");
		return -ENODEV;
	}

	if (pdata->card_name) {
		card->name = pdata->card_name;
	} else {
		dev_err(&pdev->dev, "Card name is not provided\n");
		return -ENODEV;
	}

	if (!pdata->mclk_freq) {
		dev_err(&pdev->dev, "MCLK frequency missing\n");
		return -ENODEV;
	}

	if (pdata->has_dmic) {
		card->dai_link = twl6040_dmic_dai;
		card->num_links = ARRAY_SIZE(twl6040_dmic_dai);
	} else {
		card->dai_link = twl6040_only_dai;
		card->num_links = ARRAY_SIZE(twl6040_only_dai);
	}

	ret = snd_soc_register_card(card);
	if (ret)
		dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
			ret);

	return ret;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:40,代码来源:omap-abe-twl6040.c

示例13: rockchip_hdmi_spdif_audio_probe

static int rockchip_hdmi_spdif_audio_probe(struct platform_device *pdev)
{
	int ret;
	struct snd_soc_card *card = &rockchip_hdmi_spdif_snd_card;

	card->dev = &pdev->dev;

	ret = rockchip_of_get_sound_card_info_(card, false);
	if (ret) {
		pr_err("%s() get sound card info failed:%d\n",
		       __func__, ret);
		return ret;
	}

	ret = snd_soc_register_card(card);

	if (ret)
		pr_err("%s() register card failed:%d\n",
		       __func__, ret);

	return ret;
}
开发者ID:jack-ma,项目名称:popmetal-android-kernel-3.10,代码行数:22,代码来源:rk_hdmi_spdif.c

示例14: bfin_eval_adav80x_probe

static int bfin_eval_adav80x_probe(struct platform_device *pdev)
{
	struct snd_soc_card *card = &bfin_eval_adav80x;
	const char *codec_name;

	switch (platform_get_device_id(pdev)->driver_data) {
	case BFIN_EVAL_ADAV801:
		codec_name = "spi0.1";
		break;
	case BFIN_EVAL_ADAV803:
		codec_name = "adav803.0-0034";
		break;
	default:
		return -EINVAL;
	}

	bfin_eval_adav80x_dais[0].codec_name = codec_name;

	card->dev = &pdev->dev;

	return snd_soc_register_card(&bfin_eval_adav80x);
}
开发者ID:3null,项目名称:linux,代码行数:22,代码来源:bfin-eval-adav80x.c

示例15: bf5xx_ad1836_driver_probe

static int bf5xx_ad1836_driver_probe(struct platform_device *pdev)
{
	struct snd_soc_card *card = &bf5xx_ad1836;
	const char **link_name;
	int ret;

	link_name = pdev->dev.platform_data;
	if (!link_name) {
		dev_err(&pdev->dev, "No platform data supplied\n");
		return -EINVAL;
	}
	bf5xx_ad1836_dai.cpu_dai_name = link_name[0];
	bf5xx_ad1836_dai.codec_name = link_name[1];

	card->dev = &pdev->dev;
	platform_set_drvdata(pdev, card);

	ret = snd_soc_register_card(card);
	if (ret)
		dev_err(&pdev->dev, "Failed to register card\n");
	return ret;
}
开发者ID:3null,项目名称:linux,代码行数:22,代码来源:bf5xx-ad1836.c


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