本文整理汇总了C++中snd_soc_dapm_add_routes函数的典型用法代码示例。如果您正苦于以下问题:C++ snd_soc_dapm_add_routes函数的具体用法?C++ snd_soc_dapm_add_routes怎么用?C++ snd_soc_dapm_add_routes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了snd_soc_dapm_add_routes函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: max97236_add_widgets
static int max97236_add_widgets(struct snd_soc_codec *codec)
{
#ifdef DAPM_ENABLE
struct snd_soc_dapm_context *dapm = &codec->dapm;
#endif
snd_soc_add_codec_controls(codec, max97236_snd_controls,
ARRAY_SIZE(max97236_snd_controls));
#ifdef DAPM_ENABLE
snd_soc_dapm_new_controls(dapm, max97236_dapm_widgets,
ARRAY_SIZE(max97236_dapm_widgets));
snd_soc_dapm_add_routes(dapm, max97236_dapm_routes,
ARRAY_SIZE(max97236_dapm_routes));
#endif
return 0;
}
示例2: nusmart_es8388_init
static int nusmart_es8388_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_dapm_context *dapm = &codec->dapm;
snd_soc_add_codec_controls(codec, nusmart_controls,
ARRAY_SIZE(nusmart_controls));
snd_soc_dapm_new_controls(dapm, es8388_dapm_widgets,
ARRAY_SIZE(es8388_dapm_widgets));
snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
snd_soc_dapm_enable_pin(dapm, "Ext Spk");
snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
snd_soc_dapm_enable_pin(dapm, "Mic Jack");
snd_soc_dapm_enable_pin(dapm, "HeadSet Mic");
snd_soc_dapm_sync(dapm);
return 0;
}
示例3: 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;
snd_soc_dapm_new_controls(codec, dapm_widgets,
ARRAY_SIZE(dapm_widgets));
snd_soc_dapm_add_routes(codec, base_map, ARRAY_SIZE(base_map));
snd_soc_dapm_enable_pin(codec, "Headphone Jack");
snd_soc_dapm_enable_pin(codec, "Line In");
snd_soc_dapm_enable_pin(codec, "Line Out");
snd_soc_dapm_enable_pin(codec, "Mic Jack");
simtec_audio_init(rtd);
snd_soc_dapm_sync(codec);
return 0;
}
示例4: smdk6440_s5m8751_init
static int smdk6440_s5m8751_init(struct snd_soc_codec *codec)
{
int i;
/* Add smdk6440 specific widgets */
snd_soc_dapm_new_controls(codec, s5m8751_dapm_widgets,ARRAY_SIZE(s5m8751_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(s5m8751_dapm_widgets); i++)
snd_soc_dapm_set_endpoint(codec,
s5m8751_dapm_widgets[i].name, 1);
snd_soc_dapm_sync_endpoints(codec);
return 0;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: 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;
}
示例9: 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;
}
示例10: 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;
}
示例11: simtec_hermes_init
/**
* simtec_hermes_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_hermes_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;
}
示例12: 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;
}
示例13: 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);
}
示例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;
}
示例15: 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));
}