本文整理汇总了C++中snd_soc_dapm_nc_pin函数的典型用法代码示例。如果您正苦于以下问题:C++ snd_soc_dapm_nc_pin函数的具体用法?C++ snd_soc_dapm_nc_pin怎么用?C++ snd_soc_dapm_nc_pin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了snd_soc_dapm_nc_pin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rx51_aic34_init
static int rx51_aic34_init(struct snd_soc_codec *codec)
{
int err;
/* Set up NC codec pins */
snd_soc_dapm_nc_pin(codec, "MIC3L");
snd_soc_dapm_nc_pin(codec, "MIC3R");
snd_soc_dapm_nc_pin(codec, "LINE1R");
/* Add RX-51 specific controls */
err = snd_soc_add_controls(codec, aic34_rx51_controls,
ARRAY_SIZE(aic34_rx51_controls));
if (err < 0)
return err;
/* Add RX-51 specific widgets */
snd_soc_dapm_new_controls(codec, aic34_dapm_widgets,
ARRAY_SIZE(aic34_dapm_widgets));
/* Set up RX-51 specific audio path audio_map */
snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
snd_soc_dapm_sync(codec);
return 0;
}
示例2: hx4700_ak4641_init
static int hx4700_ak4641_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_dapm_context *dapm = &codec->dapm;
int err;
snd_soc_dapm_nc_pin(dapm, "MOUT1");
snd_soc_dapm_nc_pin(dapm, "MICEXT");
snd_soc_dapm_nc_pin(dapm, "AUX");
err = snd_soc_jack_new(codec, "Headphone Jack",
SND_JACK_HEADPHONE, &hs_jack);
if (err)
return err;
err = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pin),
hs_jack_pin);
if (err)
return err;
err = snd_soc_jack_add_gpios(&hs_jack, 1, &hs_jack_gpio);
return err;
}
示例3: magician_uda1380_init
/*
* Logic for a uda1380 as connected on a HTC Magician
*/
static int magician_uda1380_init(struct snd_soc_codec *codec)
{
int err;
/* NC codec pins */
snd_soc_dapm_nc_pin(codec, "VOUTLHP");
snd_soc_dapm_nc_pin(codec, "VOUTRHP");
/* FIXME: is anything connected here? */
snd_soc_dapm_nc_pin(codec, "VINL");
snd_soc_dapm_nc_pin(codec, "VINR");
/* Add magician specific controls */
err = snd_soc_add_controls(codec, uda1380_magician_controls,
ARRAY_SIZE(uda1380_magician_controls));
if (err < 0)
return err;
/* Add magician specific widgets */
snd_soc_dapm_new_controls(codec, uda1380_dapm_widgets,
ARRAY_SIZE(uda1380_dapm_widgets));
/* Set up magician specific audio path interconnects */
snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
snd_soc_dapm_sync(codec);
return 0;
}
示例4: hx4700_ak4641_init
/*
* Logic for a ak4641 as connected on a HP iPAQ hx4700
*/
static int hx4700_ak4641_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_dapm_context *dapm = &codec->dapm;
int err;
/* NC codec pins */
/* FIXME: is anything connected here? */
snd_soc_dapm_nc_pin(dapm, "MOUT1");
snd_soc_dapm_nc_pin(dapm, "MICEXT");
snd_soc_dapm_nc_pin(dapm, "AUX");
/* Jack detection API stuff */
err = snd_soc_jack_new(codec, "Headphone Jack",
SND_JACK_HEADPHONE, &hs_jack);
if (err)
return err;
err = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pin),
hs_jack_pin);
if (err)
return err;
err = snd_soc_jack_add_gpios(&hs_jack, 1, &hs_jack_gpio);
return err;
}
示例5: mini210_wm8960_init
static int mini210_wm8960_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_nc_pin(dapm, "RINPUT1");
snd_soc_dapm_nc_pin(dapm, "LINPUT2");
snd_soc_dapm_nc_pin(dapm, "RINPUT2");
snd_soc_dapm_nc_pin(dapm, "OUT3");
snd_soc_dapm_new_controls(dapm, wm8960_dapm_widgets_cpt,
ARRAY_SIZE(wm8960_dapm_widgets_cpt));
snd_soc_dapm_new_controls(dapm, wm8960_dapm_widgets_cpt2,
ARRAY_SIZE(wm8960_dapm_widgets_cpt2));
snd_soc_dapm_add_routes(dapm, audio_map_tx, ARRAY_SIZE(audio_map_tx));
snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
snd_soc_dapm_enable_pin(dapm, "Mic Jack");
snd_soc_dapm_enable_pin(dapm, "Speaker_L");
snd_soc_dapm_enable_pin(dapm, "Speaker_R");
snd_soc_dapm_enable_pin(dapm, "Line Input 3 (FM)");
snd_soc_dapm_sync(dapm);
return 0;
}
示例6: rt5631_codec_init
static int rt5631_codec_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
//struct snd_soc_dai *codec_dai = rtd->codec_dai;
struct snd_soc_dapm_context *dapm = &codec->dapm;
int ret = 0;
printk(KERN_DEBUG "enter %s rt5631_snd_pdata: %p\n", __func__, rt5631_snd_pdata);
/* Add specific widgets */
snd_soc_dapm_new_controls(dapm, rt5631_dapm_widgets,
ARRAY_SIZE(rt5631_dapm_widgets));
/* Set up specific audio path interconnects */
snd_soc_dapm_add_routes(dapm, rt5631_dapm_intercon, ARRAY_SIZE(rt5631_dapm_intercon));
/* Setup spk/hp/mono output */
// rt5631_set_output(codec);
/* Setuo mic input */
// rt5631_set_input(codec);
/* not connected */
snd_soc_dapm_nc_pin(dapm, "MONO");
snd_soc_dapm_nc_pin(dapm, "AUXO2");
snd_soc_dapm_nc_pin(dapm, "DMIC");
snd_soc_dapm_nc_pin(dapm, "AXIL");
snd_soc_dapm_nc_pin(dapm, "AXIR");
/* always connected */
snd_soc_dapm_enable_pin(dapm, "Ext Spk");
snd_soc_dapm_enable_pin(dapm, "MAIN MIC");
/* disable connected */
snd_soc_dapm_disable_pin(dapm, "HP");
snd_soc_dapm_sync(dapm);
#if HP_DET
ret = snd_soc_jack_new(codec, "hp switch", SND_JACK_HEADPHONE, &rt5631_snd_priv->jack);
if (ret) {
printk(KERN_WARNING "Failed to alloc resource for hp switch\n");
} else {
ret = snd_soc_jack_add_pins(&rt5631_snd_priv->jack, ARRAY_SIZE(jack_pins), jack_pins);
if (ret) {
printk(KERN_WARNING "Failed to setup hp pins\n");
}
}
rt5631_snd_priv->data= (void*)codec;
init_timer(&rt5631_snd_priv->timer);
rt5631_snd_priv->timer.function = rt5631_timer_func;
rt5631_snd_priv->timer.data = (unsigned long)rt5631_snd_priv;
INIT_WORK(&rt5631_snd_priv->work, rt5631_work_func);
mutex_init(&rt5631_snd_priv->lock);
#endif
return 0;
}
示例7: rt5631_set_output
static void rt5631_set_output(struct snd_soc_codec *codec)
{
struct snd_soc_dapm_context *dapm = &codec->dapm;
if (rt5631_snd_pdata->spk_output != RT5631_SPK_STEREO) {
if (rt5631_snd_pdata->spk_output == RT5631_SPK_RIGHT) {
snd_soc_dapm_nc_pin(dapm, "SPOL");
snd_soc_update_bits(codec, RT5631_SPK_MONO_OUT_CTRL,
0xf000,
RT5631_M_SPKVOL_L_TO_SPOL_MIXER | RT5631_M_SPKVOL_R_TO_SPOL_MIXER);
} else {
snd_soc_dapm_nc_pin(dapm, "SPOR");
snd_soc_update_bits(codec, RT5631_SPK_MONO_OUT_CTRL,
0xf000,
RT5631_M_SPKVOL_L_TO_SPOR_MIXER | RT5631_M_SPKVOL_R_TO_SPOR_MIXER);
}
snd_soc_update_bits(codec, RT5631_SPK_MONO_HP_OUT_CTRL,
RT5631_SPK_L_MUX_SEL_MASK | RT5631_SPK_R_MUX_SEL_MASK | RT5631_HP_L_MUX_SEL_MASK | RT5631_HP_R_MUX_SEL_MASK,
RT5631_SPK_L_MUX_SEL_SPKMIXER_L | RT5631_SPK_R_MUX_SEL_SPKMIXER_R | RT5631_HP_L_MUX_SEL_HPVOL_L | RT5631_HP_R_MUX_SEL_HPVOL_R);
} else {
snd_soc_update_bits(codec, RT5631_SPK_MONO_OUT_CTRL,
0xf000,
RT5631_M_SPKVOL_R_TO_SPOL_MIXER | RT5631_M_SPKVOL_L_TO_SPOR_MIXER);
snd_soc_update_bits(codec, RT5631_SPK_MONO_HP_OUT_CTRL,
RT5631_SPK_L_MUX_SEL_MASK | RT5631_SPK_R_MUX_SEL_MASK | RT5631_HP_L_MUX_SEL_MASK | RT5631_HP_R_MUX_SEL_MASK,
RT5631_SPK_L_MUX_SEL_SPKMIXER_L | RT5631_SPK_R_MUX_SEL_SPKMIXER_R | RT5631_HP_L_MUX_SEL_HPVOL_L | RT5631_HP_R_MUX_SEL_HPVOL_R);
}
}
示例8: at91sam9g20ek_wm8731_init
/*
* Logic for a wm8731 as connected on a at91sam9g20ek board.
*/
static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_dai *codec_dai = rtd->codec_dai;
struct snd_soc_dapm_context *dapm = &codec->dapm;
int ret;
printk(KERN_DEBUG
"at91sam9g20ek_wm8731 "
": at91sam9g20ek_wm8731_init() called\n");
ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_MCLK,
MCLK_RATE, SND_SOC_CLOCK_IN);
if (ret < 0) {
printk(KERN_ERR "Failed to set WM8731 SYSCLK: %d\n", ret);
return ret;
}
/* not connected */
snd_soc_dapm_nc_pin(dapm, "RLINEIN");
snd_soc_dapm_nc_pin(dapm, "LLINEIN");
#ifndef ENABLE_MIC_INPUT
snd_soc_dapm_nc_pin(&rtd->card->dapm, "Int Mic");
#endif
return 0;
}
示例9: tosa_ac97_init
static int tosa_ac97_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_dapm_context *dapm = &codec->dapm;
int err;
snd_soc_dapm_nc_pin(dapm, "OUT3");
snd_soc_dapm_nc_pin(dapm, "MONOOUT");
/* add tosa specific controls */
err = snd_soc_add_controls(codec, tosa_controls,
ARRAY_SIZE(tosa_controls));
if (err < 0)
return err;
/* add tosa specific widgets */
snd_soc_dapm_new_controls(dapm, tosa_dapm_widgets,
ARRAY_SIZE(tosa_dapm_widgets));
/* set up tosa specific audio path audio_map */
snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
snd_soc_dapm_sync(dapm);
return 0;
}
示例10: smdk4x12_wm8960_init
static int smdk4x12_wm8960_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_dapm_context *dapm = &codec->dapm;
dprintk("+%s()\n", __FUNCTION__);
snd_soc_dapm_nc_pin(dapm, "RINPUT1");
snd_soc_dapm_nc_pin(dapm, "LINPUT2");
snd_soc_dapm_nc_pin(dapm, "RINPUT2");
snd_soc_dapm_nc_pin(dapm, "OUT3");
snd_soc_dapm_new_controls(dapm, smdk4x12_dapm_capture_widgets, ARRAY_SIZE(smdk4x12_dapm_capture_widgets));
snd_soc_dapm_new_controls(dapm, smdk4x12_dapm_playback_widgets, ARRAY_SIZE(smdk4x12_dapm_playback_widgets));
snd_soc_dapm_add_routes(dapm, smdk4x12_audio_map, ARRAY_SIZE(smdk4x12_audio_map));
snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
snd_soc_dapm_enable_pin(dapm, "Mic Jack");
snd_soc_dapm_enable_pin(dapm, "Speaker_L");
snd_soc_dapm_enable_pin(dapm, "Speaker_R");
snd_soc_dapm_disable_pin(dapm, "Line Input 3 (FM)");
dprintk("*%s(): dapm sync start\n", __FUNCTION__);
snd_soc_dapm_sync( dapm );
dprintk("*%s(): dapm sync end\n", __FUNCTION__);
dprintk("-%s()\n", __FUNCTION__);
return 0;
}
示例11: smartq_wm8987_init
static int smartq_wm8987_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_dapm_context *dapm = &rtd->card->dapm;
int err = 0;
/* set endpoints to not connected */
snd_soc_dapm_nc_pin(dapm, "LINPUT1");
snd_soc_dapm_nc_pin(dapm, "RINPUT1");
snd_soc_dapm_nc_pin(dapm, "OUT3");
snd_soc_dapm_nc_pin(dapm, "ROUT1");
/* Headphone jack detection */
err = snd_soc_card_jack_new(rtd->card, "Headphone Jack",
SND_JACK_HEADPHONE, &smartq_jack,
smartq_jack_pins,
ARRAY_SIZE(smartq_jack_pins));
if (err)
return err;
err = snd_soc_jack_add_gpios(&smartq_jack,
ARRAY_SIZE(smartq_jack_gpios),
smartq_jack_gpios);
return err;
}
示例12: rk2818_wm8988_init
/*
* Logic for a wm8988 as connected on a rockchip board.
*/
static int rk2818_wm8988_init(struct snd_soc_codec *codec)
{
struct snd_soc_dai *codec_dai = &codec->dai[0];
int ret;
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
ret = snd_soc_dai_set_sysclk(codec_dai, 0,
12000000, SND_SOC_CLOCK_IN);
if (ret < 0) {
printk(KERN_ERR "Failed to set WM8988 SYSCLK: %d\n", ret);
return ret;
}
/* Add specific widgets */
snd_soc_dapm_new_controls(codec, rk2818_dapm_widgets,
ARRAY_SIZE(rk2818_dapm_widgets));
snd_soc_dapm_nc_pin(codec, "LOUT2");
snd_soc_dapm_nc_pin(codec, "ROUT2");
/* Set up specific audio path audio_mapnects */
snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
snd_soc_dapm_sync(codec);
return 0;
}
示例13: evm_aic3x_init
/* Logic for a aic3x as connected on a davinci-evm */
static int evm_aic3x_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_card *card = rtd->card;
struct device_node *np = card->dev->of_node;
int ret;
/* Add davinci-evm specific widgets */
snd_soc_dapm_new_controls(&card->dapm, aic3x_dapm_widgets,
ARRAY_SIZE(aic3x_dapm_widgets));
if (np) {
ret = snd_soc_of_parse_audio_routing(card, "ti,audio-routing");
if (ret)
return ret;
} else {
/* Set up davinci-evm specific audio path audio_map */
snd_soc_dapm_add_routes(&card->dapm, audio_map,
ARRAY_SIZE(audio_map));
}
/* not connected */
snd_soc_dapm_nc_pin(&card->dapm, "MONO_LOUT");
snd_soc_dapm_nc_pin(&card->dapm, "HPLCOM");
snd_soc_dapm_nc_pin(&card->dapm, "HPRCOM");
return 0;
}
示例14: poodle_wm8731_init
/*
* Logic for a wm8731 as connected on a Sharp SL-C7x0 Device
*/
static int poodle_wm8731_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
int err;
snd_soc_dapm_nc_pin(codec, "LLINEIN");
snd_soc_dapm_nc_pin(codec, "RLINEIN");
snd_soc_dapm_enable_pin(codec, "MICIN");
/* Add poodle specific controls */
err = snd_soc_add_controls(codec, wm8731_poodle_controls,
ARRAY_SIZE(wm8731_poodle_controls));
if (err < 0)
return err;
/* Add poodle specific widgets */
snd_soc_dapm_new_controls(codec, wm8731_dapm_widgets,
ARRAY_SIZE(wm8731_dapm_widgets));
/* Set up poodle specific audio path audio_map */
snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
snd_soc_dapm_sync(codec);
return 0;
}
示例15: neo1973_wm8753_init
static int neo1973_wm8753_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_card *card = rtd->card;
/* set up NC codec pins */
snd_soc_dapm_nc_pin(&codec->dapm, "OUT3");
snd_soc_dapm_nc_pin(&codec->dapm, "OUT4");
snd_soc_dapm_nc_pin(&codec->dapm, "LINE1");
snd_soc_dapm_nc_pin(&codec->dapm, "LINE2");
/* set endpoints to default off mode */
snd_soc_dapm_disable_pin(&card->dapm, "GSM Line Out");
snd_soc_dapm_disable_pin(&card->dapm, "GSM Line In");
snd_soc_dapm_disable_pin(&card->dapm, "Headset Mic");
snd_soc_dapm_disable_pin(&card->dapm, "Handset Mic");
snd_soc_dapm_disable_pin(&card->dapm, "Stereo Out");
snd_soc_dapm_disable_pin(&card->dapm, "Handset Spk");
/* allow audio paths from the GSM modem to run during suspend */
snd_soc_dapm_ignore_suspend(&card->dapm, "GSM Line Out");
snd_soc_dapm_ignore_suspend(&card->dapm, "GSM Line In");
snd_soc_dapm_ignore_suspend(&card->dapm, "Headset Mic");
snd_soc_dapm_ignore_suspend(&card->dapm, "Handset Mic");
snd_soc_dapm_ignore_suspend(&card->dapm, "Stereo Out");
snd_soc_dapm_ignore_suspend(&card->dapm, "Handset Spk");
return 0;
}