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


C++ snd_soc_dapm_new_controls函数代码示例

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


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

示例1: sdp4430_twl6040_init

static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd)
{
	struct snd_soc_codec *codec = rtd->codec;
	struct snd_soc_dapm_context *dapm = &codec->dapm;
	int ret;

	/* Add SDP4430 specific widgets */
	ret = snd_soc_dapm_new_controls(dapm, sdp4430_twl6040_dapm_widgets,
				ARRAY_SIZE(sdp4430_twl6040_dapm_widgets));
	if (ret)
		return ret;

	/* Set up SDP4430 specific audio path audio_map */
	snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));

	/* SDP4430 connected pins */
	snd_soc_dapm_enable_pin(dapm, "Ext Mic");
	snd_soc_dapm_enable_pin(dapm, "Ext Spk");
	snd_soc_dapm_enable_pin(dapm, "AFML");
	snd_soc_dapm_enable_pin(dapm, "AFMR");
	snd_soc_dapm_enable_pin(dapm, "Headset Mic");
	snd_soc_dapm_enable_pin(dapm, "Headset Stereophone");

	ret = snd_soc_dapm_sync(dapm);
	if (ret)
		return ret;

	/* Headset jack detection */
	ret = snd_soc_jack_new(codec, "Headset Jack",
				SND_JACK_HEADSET, &hs_jack);
	if (ret)
		return ret;

	ret = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins),
				hs_jack_pins);

	if (machine_is_omap_4430sdp())
		twl6040_hs_jack_detect(codec, &hs_jack, SND_JACK_HEADSET);
	else
		snd_soc_jack_report(&hs_jack, SND_JACK_HEADSET, SND_JACK_HEADSET);

	return ret;
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:43,代码来源:sdp4430.c

示例2: smdk64xx_wm8580_init_paiftx

static int smdk64xx_wm8580_init_paiftx(struct snd_soc_codec *codec)
{
	/* Add smdk64xx specific Capture widgets */
	snd_soc_dapm_new_controls(codec, wm8580_dapm_widgets_cpt,
				  ARRAY_SIZE(wm8580_dapm_widgets_cpt));

	/* Set up PAIFTX audio path */
	snd_soc_dapm_add_routes(codec, audio_map_tx, ARRAY_SIZE(audio_map_tx));

	/* Enabling the microphone requires the fitting of a 0R
	 * resistor to connect the line from the microphone jack.
	 */
	snd_soc_dapm_disable_pin(codec, "MicIn");

	/* signal a DAPM event */
	snd_soc_dapm_sync(codec);

	return 0;
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:19,代码来源:smdk64xx_wm8580.c

示例3: smdk6440_wm8580_init

static int smdk6440_wm8580_init(struct snd_soc_codec *codec)
{
	int i;

	/* Add smdk6440 specific widgets */
	snd_soc_dapm_new_controls(codec, wm8580_dapm_widgets,ARRAY_SIZE(wm8580_dapm_widgets));

	/* set up smdk6440 specific audio paths */
	snd_soc_dapm_add_routes(codec, audio_map,ARRAY_SIZE(audio_map));

	/* No jack detect - mark all jacks as enabled */
	for (i = 0; i < ARRAY_SIZE(wm8580_dapm_widgets); i++)
		snd_soc_dapm_set_endpoint(codec,
					  wm8580_dapm_widgets[i].name, 1);

	snd_soc_dapm_sync_endpoints(codec);

	return 0;
}
开发者ID:ZhizhouTian,项目名称:s3c-linux,代码行数:19,代码来源:smdk6440_wm8580.c

示例4: msm_audrx_init

static int msm_audrx_init(struct snd_soc_pcm_runtime *rtd)
{

	struct snd_soc_codec *codec = rtd->codec;
	struct snd_soc_dapm_context *dapm = &codec->dapm;
	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
	int ret = 0;

	pr_debug("%s(),dev_name%s\n", __func__, dev_name(cpu_dai->dev));
	msm8x10_ext_spk_power_amp_init();

	mbhc_cfg.calibration = def_msm8x10_wcd_mbhc_cal();
	if (mbhc_cfg.calibration) {
		ret = msm8x10_wcd_hs_detect(codec, &mbhc_cfg);
		if (ret) {
			pr_err("%s: msm8x10_wcd_hs_detect failed\n", __func__);
			goto exit;
		}
	} else {
		ret = -ENOMEM;
		goto exit;
	}

	snd_soc_dapm_new_controls(dapm, msm8x10_dapm_widgets,
				ARRAY_SIZE(msm8x10_dapm_widgets));

	snd_soc_dapm_enable_pin(dapm, "Lineout amp");
	snd_soc_dapm_sync(dapm);

	ret = snd_soc_add_codec_controls(codec, msm_snd_controls,
					 ARRAY_SIZE(msm_snd_controls));
	if (ret < 0)
		return ret;

	msm_vibrator_amp_control_init();

exit:
	if (gpio_is_valid(ext_spk_amp_gpio))
		gpio_free(ext_spk_amp_gpio);

	return ret;
}
开发者ID:KaoTD,项目名称:Nokia-RM-1013-2.0.0.11,代码行数:42,代码来源:msm8x10.c

示例5: ad1836_probe

static int ad1836_probe(struct platform_device *pdev)
{
	struct snd_soc_device *socdev = platform_get_drvdata(pdev);
	struct snd_soc_codec *codec;
	int ret = 0;

	if (ad1836_codec == NULL) {
		dev_err(&pdev->dev, "Codec device not registered\n");
		return -ENODEV;
	}

	socdev->card->codec = ad1836_codec;
	codec = ad1836_codec;

	/* register pcms */
	ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
	if (ret < 0) {
		dev_err(codec->dev, "failed to create pcms: %d\n", ret);
		goto pcm_err;
	}

	snd_soc_add_controls(codec, ad1836_snd_controls,
			     ARRAY_SIZE(ad1836_snd_controls));
	snd_soc_dapm_new_controls(codec, ad1836_dapm_widgets,
				  ARRAY_SIZE(ad1836_dapm_widgets));
	snd_soc_dapm_add_routes(codec, audio_paths, ARRAY_SIZE(audio_paths));
	snd_soc_dapm_new_widgets(codec);

	ret = snd_soc_init_card(socdev);
	if (ret < 0) {
		dev_err(codec->dev, "failed to register card: %d\n", ret);
		goto card_err;
	}

	return ret;

card_err:
	snd_soc_free_pcms(socdev);
	snd_soc_dapm_free(socdev);
pcm_err:
	return ret;
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:42,代码来源:ad1836.c

示例6: am3517evm_aic23_init

static int am3517evm_aic23_init(struct snd_soc_pcm_runtime *rtd)
{
	struct snd_soc_codec *codec = rtd->codec;

	/* Add am3517-evm specific widgets */
	snd_soc_dapm_new_controls(codec, tlv320aic23_dapm_widgets,
				  ARRAY_SIZE(tlv320aic23_dapm_widgets));

	/* Set up davinci-evm specific audio path audio_map */
	snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));

	/* always connected */
	snd_soc_dapm_enable_pin(codec, "Line Out");
	snd_soc_dapm_enable_pin(codec, "Line In");
	snd_soc_dapm_enable_pin(codec, "Mic In");

	snd_soc_dapm_sync(codec);

	return 0;
}
开发者ID:AdiPat,项目名称:i9003_Kernel,代码行数:20,代码来源:am3517evm.c

示例7: mini6410_ac97_init

static int mini6410_ac97_init(struct snd_soc_codec *codec) {
	unsigned short val;

	/* add board specific widgets */
	snd_soc_dapm_new_controls(codec, mini6410_dapm_widgets,
			ARRAY_SIZE(mini6410_dapm_widgets));

	/* setup board specific audio path audio_map */
	snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));

	/* Prepare MIC input */
	val = codec->read(codec, AC97_3D_CONTROL);
	codec->write(codec, AC97_3D_CONTROL, val | 0xc000);

	/* Static setup for now */
	snd_soc_dapm_enable_pin(codec, "Mic (on-board)");
	snd_soc_dapm_sync(codec);

	return 0;
}
开发者ID:IoveSunny,项目名称:DreamBox,代码行数:20,代码来源:mini6410_wm9713.c

示例8: simtec_tlv320aic23_init

/**
 * simtec_tlv320aic23_init - initialise and add controls
 * @codec; The codec instance to attach to.
 *
 * Attach our controls and configure the necessary codec
 * mappings for our sound card instance.
*/
static int simtec_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
{
	struct snd_soc_codec *codec = rtd->codec;
	struct snd_soc_dapm_context *dapm = &codec->dapm;

	snd_soc_dapm_new_controls(dapm, dapm_widgets,
				  ARRAY_SIZE(dapm_widgets));

	snd_soc_dapm_add_routes(dapm, base_map, ARRAY_SIZE(base_map));

	snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
	snd_soc_dapm_enable_pin(dapm, "Line In");
	snd_soc_dapm_enable_pin(dapm, "Line Out");
	snd_soc_dapm_enable_pin(dapm, "Mic Jack");

	simtec_audio_init(rtd);
	snd_soc_dapm_sync(dapm);

	return 0;
}
开发者ID:1yankeedt,项目名称:D710BST_FL24_Kernel,代码行数:27,代码来源:s3c24xx_simtec_tlv320aic23.c

示例9: jz4740_codec_dev_probe

static int jz4740_codec_dev_probe(struct snd_soc_codec *codec)
{
	snd_soc_update_bits(codec, JZ4740_REG_CODEC_1,
			JZ4740_CODEC_1_SW2_ENABLE, JZ4740_CODEC_1_SW2_ENABLE);

	snd_soc_add_controls(codec, jz4740_codec_controls,
		ARRAY_SIZE(jz4740_codec_controls));

	snd_soc_dapm_new_controls(codec, jz4740_codec_dapm_widgets,
		ARRAY_SIZE(jz4740_codec_dapm_widgets));

	snd_soc_dapm_add_routes(codec, jz4740_codec_dapm_routes,
		ARRAY_SIZE(jz4740_codec_dapm_routes));

	snd_soc_dapm_new_widgets(codec);

	jz4740_codec_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

	return 0;
}
开发者ID:Adjustxx,项目名称:Savaged-Zen,代码行数:20,代码来源:jz4740.c

示例10: omap3pandora_in_init

static int omap3pandora_in_init(struct snd_soc_codec *codec)
{
	int ret;

	/* Not comnnected */
	snd_soc_dapm_nc_pin(codec, "HSMIC");
	snd_soc_dapm_nc_pin(codec, "CARKITMIC");
	snd_soc_dapm_nc_pin(codec, "DIGIMIC0");
	snd_soc_dapm_nc_pin(codec, "DIGIMIC1");

	ret = snd_soc_dapm_new_controls(codec, omap3pandora_in_dapm_widgets,
				ARRAY_SIZE(omap3pandora_in_dapm_widgets));
	if (ret < 0)
		return ret;

	snd_soc_dapm_add_routes(codec, omap3pandora_in_map,
		ARRAY_SIZE(omap3pandora_in_map));

	return snd_soc_dapm_sync(codec);
}
开发者ID:A2109devs,项目名称:lenovo_a2109a_kernel,代码行数:20,代码来源:omap3pandora.c

示例11: zylonite_wm9713_init

static int zylonite_wm9713_init(struct snd_soc_pcm_runtime *rtd)
{
	struct snd_soc_codec *codec = rtd->codec;

	if (clk_pout)
		snd_soc_dai_set_pll(rtd->codec_dai, 0, 0,
				    clk_get_rate(pout), 0);

	snd_soc_dapm_new_controls(codec, zylonite_dapm_widgets,
				  ARRAY_SIZE(zylonite_dapm_widgets));

	snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));

	/* Static setup for now */
	snd_soc_dapm_enable_pin(codec, "Headphone");
	snd_soc_dapm_enable_pin(codec, "Headset Earpiece");

	snd_soc_dapm_sync(codec);
	return 0;
}
开发者ID:AdiPat,项目名称:i9003_Kernel,代码行数:20,代码来源:zylonite.c

示例12: omap3pandora_in_init

static int omap3pandora_in_init(struct snd_soc_pcm_runtime *rtd)
{
	struct snd_soc_codec *codec = rtd->codec;
	struct snd_soc_dapm_context *dapm = &codec->dapm;
	int ret;

	/* Not comnnected */
	snd_soc_dapm_nc_pin(dapm, "HSMIC");
	snd_soc_dapm_nc_pin(dapm, "CARKITMIC");
	snd_soc_dapm_nc_pin(dapm, "DIGIMIC0");
	snd_soc_dapm_nc_pin(dapm, "DIGIMIC1");

	ret = snd_soc_dapm_new_controls(dapm, omap3pandora_in_dapm_widgets,
				ARRAY_SIZE(omap3pandora_in_dapm_widgets));
	if (ret < 0)
		return ret;

	return snd_soc_dapm_add_routes(dapm, omap3pandora_in_map,
		ARRAY_SIZE(omap3pandora_in_map));
}
开发者ID:AiWinters,项目名称:linux,代码行数:20,代码来源:omap3pandora.c

示例13: neo1973_lm4857_init

static int neo1973_lm4857_init(struct snd_soc_dapm_context *dapm)
{
	int ret;

	ret = snd_soc_dapm_new_controls(dapm, neo1973_lm4857_dapm_widgets,
			ARRAY_SIZE(neo1973_lm4857_dapm_widgets));
	if (ret)
		return ret;

	ret = snd_soc_dapm_add_routes(dapm, neo1973_lm4857_routes,
			ARRAY_SIZE(neo1973_lm4857_routes));
	if (ret)
		return ret;

	snd_soc_dapm_ignore_suspend(dapm, "Stereo Out");
	snd_soc_dapm_ignore_suspend(dapm, "Handset Spk");
	snd_soc_dapm_ignore_suspend(dapm, "Headphone");

	return 0;
}
开发者ID:ashang,项目名称:xpenology-3.x,代码行数:20,代码来源:neo1973_wm8753.c

示例14: osk_tlv320aic23_init

static int osk_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
{
	struct snd_soc_codec *codec = rtd->codec;
	struct snd_soc_dapm_context *dapm = &codec->dapm;

	/* Add osk5912 specific widgets */
	snd_soc_dapm_new_controls(dapm, tlv320aic23_dapm_widgets,
				  ARRAY_SIZE(tlv320aic23_dapm_widgets));

	/* Set up osk5912 specific audio path audio_map */
	snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));

	snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
	snd_soc_dapm_enable_pin(dapm, "Line In");
	snd_soc_dapm_enable_pin(dapm, "Mic Jack");

	snd_soc_dapm_sync(dapm);

	return 0;
}
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:20,代码来源:osk5912.c

示例15: imx_3stack_ak4647_init

static int imx_3stack_ak4647_init(struct snd_soc_codec *codec)
{
	int i, ret;
	for (i = 0; i < ARRAY_SIZE(ak4647_card_controls); i++) {
		ret = snd_ctl_add(codec->card,
				  snd_soc_cnew(&ak4647_card_controls[i],
					       codec, NULL));
		if (ret < 0)
			return ret;
	}

	snd_soc_dapm_new_controls(codec, imx_3stack_dapm_widgets,
				  ARRAY_SIZE(imx_3stack_dapm_widgets));

	snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));

	snd_soc_dapm_sync(codec);

	return 0;
}
开发者ID:YCsuperlife,项目名称:imx53_kernel,代码行数:20,代码来源:imx-3stack-ak4647.c


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