本文整理汇总了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函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:upworkstar,项目名称:AndroidAmazon,代码行数:19,代码来源:max97236.c
示例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;
}
开发者ID:alessandroste,项目名称:testBSP,代码行数:19,代码来源:nusmart-mach-es8388.c
示例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;
}
开发者ID:Adjustxx,项目名称:Savaged-Zen,代码行数:26,代码来源:s3c24xx_simtec_tlv320aic23.c
示例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;
}
开发者ID:ZhizhouTian,项目名称:s3c-linux,代码行数:19,代码来源:smdk6440_s5m8751.c
示例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;
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:43,代码来源:sdp4430.c
示例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;
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:42,代码来源:ad1836.c
示例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;
}
开发者ID:YCsuperlife,项目名称:imx53_kernel,代码行数:20,代码来源:imx-3stack-ak4647.c
示例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;
}
开发者ID:ashang,项目名称:xpenology-3.x,代码行数:20,代码来源:neo1973_wm8753.c
示例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;
}
开发者ID:AdiPat,项目名称:i9003_Kernel,代码行数:20,代码来源:am3517evm.c
示例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;
}
开发者ID:IoveSunny,项目名称:DreamBox,代码行数:20,代码来源:mini6410_wm9713.c
示例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;
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:27,代码来源:s3c24xx_simtec_hermes.c
示例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;
}
开发者ID:Adjustxx,项目名称:Savaged-Zen,代码行数:20,代码来源:jz4740.c
示例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);
}
开发者ID:A2109devs,项目名称:lenovo_a2109a_kernel,代码行数:20,代码来源:omap3pandora.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: 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
示例16: cs42l51_probe
static int cs42l51_probe(struct snd_soc_codec *codec)
{
struct cs42l51_private *cs42l51 = snd_soc_codec_get_drvdata(codec);
int ret, reg;
codec->control_data = cs42l51->control_data;
ret = cs42l51_fill_cache(codec);
if (ret < 0) {
dev_err(codec->dev, "failed to fill register cache\n");
return ret;
}
ret = snd_soc_codec_set_cache_io(codec, 8, 8, cs42l51->control_type);
if (ret < 0) {
dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
return ret;
}
/*
* DAC configuration
* - Use signal processor
* - auto mute
* - vol changes immediate
* - no de-emphasize
*/
reg = CS42L51_DAC_CTL_DATA_SEL(1)
| CS42L51_DAC_CTL_AMUTE | CS42L51_DAC_CTL_DACSZ(0);
ret = snd_soc_write(codec, CS42L51_DAC_CTL, reg);
if (ret < 0)
return ret;
snd_soc_add_controls(codec, cs42l51_snd_controls,
ARRAY_SIZE(cs42l51_snd_controls));
snd_soc_dapm_new_controls(codec, cs42l51_dapm_widgets,
ARRAY_SIZE(cs42l51_dapm_widgets));
snd_soc_dapm_add_routes(codec, cs42l51_routes,
ARRAY_SIZE(cs42l51_routes));
return 0;
}
开发者ID:Adjustxx,项目名称:Savaged-Zen,代码行数:41,代码来源:cs42l51.c
示例17: arizona_dai_set_sysclk
static int arizona_dai_set_sysclk(struct snd_soc_dai *dai,
int clk_id, unsigned int freq, int dir)
{
struct snd_soc_codec *codec = dai->codec;
struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
struct arizona_dai_priv *dai_priv = &priv->dai[dai->id - 1];
struct snd_soc_dapm_route routes[2];
switch (clk_id) {
case ARIZONA_CLK_SYSCLK:
case ARIZONA_CLK_ASYNCCLK:
break;
default:
return -EINVAL;
}
if (clk_id == dai_priv->clk)
return 0;
if (dai->active) {
dev_err(codec->dev, "Can't change clock on active DAI %d\n",
dai->id);
return -EBUSY;
}
memset(&routes, 0, sizeof(routes));
routes[0].sink = dai->driver->capture.stream_name;
routes[1].sink = dai->driver->playback.stream_name;
routes[0].source = arizona_dai_clk_str(dai_priv->clk);
routes[1].source = arizona_dai_clk_str(dai_priv->clk);
snd_soc_dapm_del_routes(&codec->dapm, routes, ARRAY_SIZE(routes));
routes[0].source = arizona_dai_clk_str(clk_id);
routes[1].source = arizona_dai_clk_str(clk_id);
snd_soc_dapm_add_routes(&codec->dapm, routes, ARRAY_SIZE(routes));
dai_priv->clk = clk_id;
return snd_soc_dapm_sync(&codec->dapm);
}
开发者ID:AirShark,项目名称:android_kernel_lenovo_redhookbay,代码行数:41,代码来源:arizona.c
示例18: ad1836_probe
static int ad1836_probe(struct snd_soc_codec *codec)
{
struct ad1836_priv *ad1836 = snd_soc_codec_get_drvdata(codec);
struct snd_soc_dapm_context *dapm = &codec->dapm;
int ret = 0;
codec->control_data = ad1836->control_data;
ret = snd_soc_codec_set_cache_io(codec, 4, 12, SND_SOC_SPI);
if (ret < 0) {
dev_err(codec->dev, "failed to set cache I/O: %d\n",
ret);
return ret;
}
/* default setting for ad1836 */
/* de-emphasis: 48kHz, power-on dac */
snd_soc_write(codec, AD1836_DAC_CTRL1, 0x300);
/* unmute dac channels */
snd_soc_write(codec, AD1836_DAC_CTRL2, 0x0);
/* high-pass filter enable, power-on adc */
snd_soc_write(codec, AD1836_ADC_CTRL1, 0x100);
/* unmute adc channles, adc aux mode */
snd_soc_write(codec, AD1836_ADC_CTRL2, 0x180);
/* left/right diff:PGA/MUX */
snd_soc_write(codec, AD1836_ADC_CTRL3, 0x3A);
/* volume */
snd_soc_write(codec, AD1836_DAC_L1_VOL, 0x3FF);
snd_soc_write(codec, AD1836_DAC_R1_VOL, 0x3FF);
snd_soc_write(codec, AD1836_DAC_L2_VOL, 0x3FF);
snd_soc_write(codec, AD1836_DAC_R2_VOL, 0x3FF);
snd_soc_write(codec, AD1836_DAC_L3_VOL, 0x3FF);
snd_soc_write(codec, AD1836_DAC_R3_VOL, 0x3FF);
snd_soc_add_controls(codec, ad1836_snd_controls,
ARRAY_SIZE(ad1836_snd_controls));
snd_soc_dapm_new_controls(dapm, ad1836_dapm_widgets,
ARRAY_SIZE(ad1836_dapm_widgets));
snd_soc_dapm_add_routes(dapm, audio_paths, ARRAY_SIZE(audio_paths));
return ret;
}
开发者ID:1yankeedt,项目名称:D710BST_FL24_Kernel,代码行数:41,代码来源:ad1836.c
示例19: mango210_wm8960_init_paifrx
static int mango210_wm8960_init_paifrx(struct snd_soc_codec *codec)
{
int ret;
/* Add mango210 specific Playback widgets */
snd_soc_dapm_new_controls(codec, wm8960_dapm_widgets_pbk,
ARRAY_SIZE(wm8960_dapm_widgets_pbk));
/* add iDMA controls */
ret = snd_soc_add_controls(codec, &s5p_idma_control, 1);
if (ret < 0)
return ret;
/* Set up PAIFRX audio path */
snd_soc_dapm_add_routes(codec, audio_map_rx, ARRAY_SIZE(audio_map_rx));
/* signal a DAPM event */
snd_soc_dapm_sync(codec);
/* Set the Codec DAI configuration */
ret = snd_soc_dai_set_fmt(&wm8960_dai, SND_SOC_DAIFMT_I2S
| SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBS_CFS);
if (ret < 0)
return ret;
/* Set the AP DAI configuration */
ret = snd_soc_dai_set_fmt(&s3c64xx_i2s_dai[I2S_NUM], SND_SOC_DAIFMT_I2S
| SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBS_CFS);
if (ret < 0)
return ret;
/* Set WM8960 to drive MCLK from its MCLK-pin */
ret = snd_soc_dai_set_clkdiv(&wm8960_dai, WM8960_SYSCLKSEL,
WM8960_SYSCLK_MCLK);
if (ret < 0)
return ret;
return 0;
}
开发者ID:Asure,项目名称:Dropad-kernel-2.6.32.9,代码行数:41,代码来源:mango210_wm8976.c
示例20: qi_lb60_codec_init
static int qi_lb60_codec_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
int ret;
snd_soc_dapm_nc_pin(codec, "LIN");
snd_soc_dapm_nc_pin(codec, "RIN");
ret = snd_soc_dai_set_fmt(cpu_dai, QI_LB60_DAIFMT);
if (ret < 0) {
dev_err(codec->dev, "Failed to set cpu dai format: %d\n", ret);
return ret;
}
snd_soc_dapm_new_controls(codec, qi_lb60_widgets, ARRAY_SIZE(qi_lb60_widgets));
snd_soc_dapm_add_routes(codec, qi_lb60_routes, ARRAY_SIZE(qi_lb60_routes));
snd_soc_dapm_sync(codec);
return 0;
}
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:21,代码来源:qi_lb60.c
注:本文中的snd_soc_dapm_add_routes函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论