您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ snd_soc_dapm_nc_pin函数代码示例

51自学网 2021-06-03 08:03:09
  C++
这篇教程C++ snd_soc_dapm_nc_pin函数代码示例写得很实用,希望能帮到您。

本文整理汇总了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函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:26,


示例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;}
开发者ID:MiniBlu,项目名称:cm11_kernel_htc_msm8974a3ul,代码行数:27,


示例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;}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:31,


示例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;}
开发者ID:3null,项目名称:linux,代码行数:30,


示例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;}
开发者ID:abc2402878,项目名称:linux-tiny210v2,代码行数:25,


示例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;}
开发者ID:nspierbundel,项目名称:amlogic-common-3.0.8,代码行数:60,


示例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);    }}
开发者ID:nspierbundel,项目名称:amlogic-common-3.0.8,代码行数:32,


示例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;}
开发者ID:19Dan01,项目名称:linux,代码行数:31,


示例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;}
开发者ID:1yankeedt,项目名称:D710BST_FL24_Kernel,代码行数:25,


示例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;}
开发者ID:TOPEET-Develop,项目名称:iTop4412_kernel_public_merge,代码行数:32,


示例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;}
开发者ID:Chong-Li,项目名称:cse522,代码行数:25,


示例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;}
开发者ID:smartassfox,项目名称:android_kernel_p81hd,代码行数:30,


示例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;}
开发者ID:AshishNamdev,项目名称:linux,代码行数:28,


示例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;}
开发者ID:Ale1ster,项目名称:kerneldir,代码行数:28,


示例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;}
开发者ID:908626950,项目名称:linux,代码行数:29,


示例16: omap3pandora_out_init

static int omap3pandora_out_init(struct snd_soc_pcm_runtime *rtd){	struct snd_soc_codec *codec = rtd->codec;	struct snd_soc_dapm_context *dapm = &codec->dapm;	int ret;	/* All TWL4030 output pins are floating */	snd_soc_dapm_nc_pin(dapm, "EARPIECE");	snd_soc_dapm_nc_pin(dapm, "PREDRIVEL");	snd_soc_dapm_nc_pin(dapm, "PREDRIVER");	snd_soc_dapm_nc_pin(dapm, "HSOL");	snd_soc_dapm_nc_pin(dapm, "HSOR");	snd_soc_dapm_nc_pin(dapm, "CARKITL");	snd_soc_dapm_nc_pin(dapm, "CARKITR");	snd_soc_dapm_nc_pin(dapm, "HFL");	snd_soc_dapm_nc_pin(dapm, "HFR");	snd_soc_dapm_nc_pin(dapm, "VIBRA");	ret = snd_soc_dapm_new_controls(dapm, omap3pandora_out_dapm_widgets,				ARRAY_SIZE(omap3pandora_out_dapm_widgets));	if (ret < 0)		return ret;	return snd_soc_dapm_add_routes(dapm, omap3pandora_out_map,		ARRAY_SIZE(omap3pandora_out_map));}
开发者ID:AiWinters,项目名称:linux,代码行数:26,


示例17: aml_m1_codec_init

static int aml_m1_codec_init(struct snd_soc_codec *codec){    struct snd_soc_card *card = codec->socdev->card;    int err;    //Add board specific DAPM widgets and routes    err = snd_soc_dapm_new_controls(codec, aml_m1_dapm_widgets, ARRAY_SIZE(aml_m1_dapm_widgets));    if(err){        dev_warn(card->dev, "Failed to register DAPM widgets/n");        return 0;    }    err = snd_soc_dapm_add_routes(codec, intercon,        ARRAY_SIZE(intercon));    if(err){        dev_warn(card->dev, "Failed to setup dapm widgets routine/n");        return 0;    }#if HP_DET    if ((soc_cs42l52_dai.ac97_pdata) && ((struct cs42l52_platform_data *) (soc_cs42l52_dai.ac97_pdata))->is_hp_pluged)        hp_detect_flag = ((struct cs42l52_platform_data *) (soc_cs42l52_dai.ac97_pdata))->is_hp_pluged() ? (0) : (1);    else        hp_detect_flag = 1; // If is_hp_pluged function is not registered in bsp, set speaker as default.    err = snd_soc_jack_new(card, "hp_switch",        SND_JACK_HEADSET, &hp_jack);    if(err){        dev_warn(card->dev, "Failed to alloc resource for hook switch/n");    }else{        err = snd_soc_jack_add_pins(&hp_jack, ARRAY_SIZE(hp_jack_pins), hp_jack_pins);        if(err){            dev_warn(card->dev, "Failed to setup hook hp jack pin/n");        }    }    // create a timer to poll the HP IN status    spin_lock_init(&lock);    timer.function = &cs42l52_hp_detect_timer;    timer.data = (unsigned long)codec;    timer.expires = jiffies + HZ*10;    init_timer(&timer);    INIT_WORK(&cs42l52_work.cs42l52_workqueue, cs42l52_hp_detect_queue);#endif    snd_soc_dapm_nc_pin(codec,"LINPUT1");    snd_soc_dapm_nc_pin(codec,"RINPUT1");    snd_soc_dapm_enable_pin(codec, "Ext Spk");    snd_soc_dapm_disable_pin(codec, "HP");    snd_soc_dapm_enable_pin(codec, "MIC IN");    snd_soc_dapm_disable_pin(codec, "HP MIC");    snd_soc_dapm_disable_pin(codec, "FM IN");    snd_soc_dapm_sync(codec);    return 0;}
开发者ID:KaZoom,项目名称:buildroot-linux-kernel-m3,代码行数:58,


示例18: corgi_wm8731_init

/* * Logic for a wm8731 as connected on a Sharp SL-C7x0 Device */static int corgi_wm8731_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, "LLINEIN");	snd_soc_dapm_nc_pin(dapm, "RLINEIN");	return 0;}
开发者ID:3null,项目名称:linux,代码行数:13,


示例19: omap4_wm8994_init

int omap4_wm8994_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 *aif1_dai = &rtd->codec_dai[0];	int ret;	the_codec = codec;	ret = snd_soc_add_controls(codec, omap4_controls,				ARRAY_SIZE(omap4_controls));	ret = snd_soc_dapm_new_controls(dapm, omap4_dapm_widgets,					ARRAY_SIZE(omap4_dapm_widgets));	if (ret != 0)		dev_err(codec->dev, "Failed to add DAPM widgets: %d/n", ret);	ret = snd_soc_dapm_add_routes(dapm, omap4_dapm_routes,					ARRAY_SIZE(omap4_dapm_routes));	if (ret != 0)		dev_err(codec->dev, "Failed to add DAPM routes: %d/n", ret);	/* set up NC codec pins */	snd_soc_dapm_nc_pin(dapm, "IN2LP:VXRN");	snd_soc_dapm_nc_pin(dapm, "IN2LN");#ifdef CONFIG_MACH_SAMSUNG_ESPRESSO_10	snd_soc_dapm_nc_pin(dapm, "IN2RP:VXRP");	snd_soc_dapm_nc_pin(dapm, "IN2RN");#endif	snd_soc_dapm_ignore_suspend(dapm, "RCV");	snd_soc_dapm_ignore_suspend(dapm, "SPK");	snd_soc_dapm_ignore_suspend(dapm, "LINEOUT");	snd_soc_dapm_ignore_suspend(dapm, "HP");	snd_soc_dapm_ignore_suspend(dapm, "Main Mic");#if defined(CONFIG_MACH_SAMSUNG_ESPRESSO) /	|| defined(CONFIG_MACH_SAMSUNG_ESPRESSO_CHN_CMCC)	snd_soc_dapm_ignore_suspend(dapm, "Sub Mic");#endif	snd_soc_dapm_ignore_suspend(dapm, "Headset Mic");	snd_soc_dapm_ignore_suspend(dapm, "AIF1DACDAT");	snd_soc_dapm_ignore_suspend(dapm, "AIF2DACDAT");	snd_soc_dapm_ignore_suspend(dapm, "AIF3DACDAT");	snd_soc_dapm_ignore_suspend(dapm, "AIF1ADCDAT");	snd_soc_dapm_ignore_suspend(dapm, "AIF2ADCDAT");	snd_soc_dapm_ignore_suspend(dapm, "AIF3ADCDAT");	ret = snd_soc_dai_set_sysclk(aif1_dai, WM8994_SYSCLK_MCLK2,				     32768, SND_SOC_CLOCK_IN);	if (ret < 0)		dev_err(codec->dev, "Failed to boot clocking/n");	return snd_soc_dapm_sync(dapm);}
开发者ID:nickh186,项目名称:Samsung-GT-P3113-AOSP-CM-Kernel-and-Ramdisk,代码行数:54,


示例20: zoom2_twl4030_init

static int zoom2_twl4030_init(struct snd_soc_pcm_runtime *rtd){	struct snd_soc_codec *codec = rtd->codec;	int ret;	unsigned short reg;	g_rtd = rtd;	/* Add ZOOM2 specific controls */	ret = snd_soc_add_controls(codec, zoom2_controls,			ARRAY_SIZE(zoom2_controls));	if (ret)		return ret;	/* Add Zoom2 specific widgets */	ret = snd_soc_dapm_new_controls(codec->dapm, zoom2_twl4030_dapm_widgets,				ARRAY_SIZE(zoom2_twl4030_dapm_widgets));	if (ret)		return ret;	/* Set up Zoom2 specific audio path audio_map */	snd_soc_dapm_add_routes(codec->dapm, audio_map, ARRAY_SIZE(audio_map));	reg = codec->driver->read(codec, TWL4030_REG_VOICE_IF);	reg |= TWL4030_VIF_DIN_EN | TWL4030_VIF_DOUT_EN | TWL4030_VIF_EN;	codec->driver->write(codec, TWL4030_REG_VOICE_IF, reg);	/* Zoom2 connected pins */	snd_soc_dapm_enable_pin(codec->dapm, "Ext Mic");	snd_soc_dapm_enable_pin(codec->dapm, "Ext Spk");	snd_soc_dapm_enable_pin(codec->dapm, "Headset Mic");	snd_soc_dapm_enable_pin(codec->dapm, "Headset Stereophone");	snd_soc_dapm_enable_pin(codec->dapm, "Aux In");	/* TWL4030 not connected pins */	snd_soc_dapm_nc_pin(codec->dapm, "CARKITMIC");	snd_soc_dapm_nc_pin(codec->dapm, "DIGIMIC0");	snd_soc_dapm_nc_pin(codec->dapm, "DIGIMIC1");	snd_soc_dapm_nc_pin(codec->dapm, "OUTL");	snd_soc_dapm_nc_pin(codec->dapm, "OUTR");	snd_soc_dapm_nc_pin(codec->dapm, "EARPIECE");	snd_soc_dapm_nc_pin(codec->dapm, "PREDRIVEL");	snd_soc_dapm_nc_pin(codec->dapm, "PREDRIVER");	snd_soc_dapm_nc_pin(codec->dapm, "CARKITL");	snd_soc_dapm_nc_pin(codec->dapm, "CARKITR");	ret = snd_soc_dapm_sync(codec->dapm);	return ret;}
开发者ID:kapoloclubs,项目名称:diana,代码行数:51,


示例21: rx51_aic34_init

static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd){	struct snd_soc_codec *codec = rtd->codec;	struct snd_soc_card *card = rtd->card;	struct rx51_audio_pdata *pdata = snd_soc_card_get_drvdata(card);	struct snd_soc_dapm_context *dapm = &codec->dapm;	int err;	/* Set up NC codec pins */	snd_soc_dapm_nc_pin(dapm, "MIC3L");	snd_soc_dapm_nc_pin(dapm, "MIC3R");	snd_soc_dapm_nc_pin(dapm, "LINE1R");	err = tpa6130a2_add_controls(codec);	if (err < 0) {		dev_err(card->dev, "Failed to add TPA6130A2 controls/n");		return err;	}	snd_soc_limit_volume(codec, "TPA6130A2 Headphone Playback Volume", 42);	err = omap_mcbsp_st_add_controls(rtd, 2);	if (err < 0) {		dev_err(card->dev, "Failed to add MCBSP controls/n");		return err;	}	/* AV jack detection */	err = snd_soc_jack_new(codec, "AV Jack",			       SND_JACK_HEADSET | SND_JACK_VIDEOOUT,			       &rx51_av_jack);	if (err) {		dev_err(card->dev, "Failed to add AV Jack/n");		return err;	}	/* prepare gpio for snd_soc_jack_add_gpios */	rx51_av_jack_gpios[0].gpio = desc_to_gpio(pdata->jack_detection_gpio);	devm_gpiod_put(card->dev, pdata->jack_detection_gpio);	err = snd_soc_jack_add_gpios(&rx51_av_jack,				     ARRAY_SIZE(rx51_av_jack_gpios),				     rx51_av_jack_gpios);	if (err) {		dev_err(card->dev, "Failed to add GPIOs/n");		return err;	}	return err;}
开发者ID:Abioy,项目名称:kasan,代码行数:50,


示例22: zoom2_twl4030_init

static int zoom2_twl4030_init(struct snd_soc_codec *codec){	int ret;	/* Add Zoom2 specific widgets */	ret = snd_soc_dapm_new_controls(codec, zoom2_twl4030_dapm_widgets,				ARRAY_SIZE(zoom2_twl4030_dapm_widgets));	if (ret)		return ret;	/* Set up Zoom2 specific audio path audio_map */	snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));	/* Zoom2 connected pins */	snd_soc_dapm_enable_pin(codec, "Ext Mic");	snd_soc_dapm_enable_pin(codec, "Ext Spk");	snd_soc_dapm_enable_pin(codec, "Headset Mic");	snd_soc_dapm_enable_pin(codec, "Headset Stereophone");	snd_soc_dapm_enable_pin(codec, "Aux In");	/* TWL4030 not connected pins */	snd_soc_dapm_nc_pin(codec, "CARKITMIC");	snd_soc_dapm_nc_pin(codec, "DIGIMIC0");	snd_soc_dapm_nc_pin(codec, "DIGIMIC1");	snd_soc_dapm_nc_pin(codec, "EARPIECE");	snd_soc_dapm_nc_pin(codec, "PREDRIVEL");	snd_soc_dapm_nc_pin(codec, "PREDRIVER");	snd_soc_dapm_nc_pin(codec, "CARKITL");	snd_soc_dapm_nc_pin(codec, "CARKITR");	ret = snd_soc_dapm_sync(codec);	return ret;}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:34,


示例23: neo1973_wm8753_init

static int neo1973_wm8753_init(struct snd_soc_pcm_runtime *rtd){	struct snd_soc_codec *codec = rtd->codec;	struct snd_soc_dapm_context *dapm = &codec->dapm;	int ret;	/*                      */	snd_soc_dapm_nc_pin(dapm, "OUT3");	snd_soc_dapm_nc_pin(dapm, "OUT4");	snd_soc_dapm_nc_pin(dapm, "LINE1");	snd_soc_dapm_nc_pin(dapm, "LINE2");	/*                              */	ret = snd_soc_dapm_new_controls(dapm, neo1973_wm8753_dapm_widgets,			ARRAY_SIZE(neo1973_wm8753_dapm_widgets));	if (ret)		return ret;	/*                               */	ret = snd_soc_add_card_controls(rtd->card, neo1973_wm8753_controls,			ARRAY_SIZE(neo1973_wm8753_controls));	if (ret)		return ret;	/*                                      */	ret = snd_soc_dapm_add_routes(dapm, neo1973_wm8753_routes,			ARRAY_SIZE(neo1973_wm8753_routes));	if (ret)		return ret;	/*                                   */	snd_soc_dapm_disable_pin(dapm, "GSM Line Out");	snd_soc_dapm_disable_pin(dapm, "GSM Line In");	snd_soc_dapm_disable_pin(dapm, "Headset Mic");	snd_soc_dapm_disable_pin(dapm, "Handset Mic");	/*                                                            */	snd_soc_dapm_ignore_suspend(dapm, "GSM Line Out");	snd_soc_dapm_ignore_suspend(dapm, "GSM Line In");	snd_soc_dapm_ignore_suspend(dapm, "Headset Mic");	snd_soc_dapm_ignore_suspend(dapm, "Handset Mic");	if (machine_is_neo1973_gta02()) {		ret = neo1973_gta02_wm8753_init(codec);		if (ret)			return ret;	}	return 0;}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:50,


示例24: n810_aic33_init

static int n810_aic33_init(struct snd_soc_pcm_runtime *rtd){	struct snd_soc_codec *codec = rtd->codec;	int err;	/* Not connected */	snd_soc_dapm_nc_pin(codec, "MONO_LOUT");	snd_soc_dapm_nc_pin(codec, "HPLCOM");	snd_soc_dapm_nc_pin(codec, "HPRCOM");	snd_soc_dapm_nc_pin(codec, "MIC3L");	snd_soc_dapm_nc_pin(codec, "MIC3R");	snd_soc_dapm_nc_pin(codec, "LINE1R");	snd_soc_dapm_nc_pin(codec, "LINE2L");	snd_soc_dapm_nc_pin(codec, "LINE2R");	/* Add N810 specific controls */	err = snd_soc_add_controls(codec, aic33_n810_controls,				ARRAY_SIZE(aic33_n810_controls));	if (err < 0)		return err;	/* Add N810 specific widgets */	snd_soc_dapm_new_controls(codec, aic33_dapm_widgets,				  ARRAY_SIZE(aic33_dapm_widgets));	/* Set up N810 specific audio path audio_map */	snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));	snd_soc_dapm_sync(codec);	return 0;}
开发者ID:Adjustxx,项目名称:Savaged-Zen,代码行数:32,


示例25: smartq_wm8987_init

static int smartq_wm8987_init(struct snd_soc_codec *codec){	int err = 0;	/* Add SmartQ specific widgets */	snd_soc_dapm_new_controls(codec, wm8987_dapm_widgets,				  ARRAY_SIZE(wm8987_dapm_widgets));	/* add SmartQ specific controls */	err = snd_soc_add_controls(codec, wm8987_smartq_controls,				   ARRAY_SIZE(wm8987_smartq_controls));	if (err < 0)		return err;	/* setup SmartQ specific audio path */	snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));	/* set endpoints to not connected */	snd_soc_dapm_nc_pin(codec, "LINPUT1");	snd_soc_dapm_nc_pin(codec, "RINPUT1");	snd_soc_dapm_nc_pin(codec, "OUT3");	snd_soc_dapm_nc_pin(codec, "ROUT1");	/* set endpoints to default off mode */	snd_soc_dapm_enable_pin(codec, "Internal Speaker");	snd_soc_dapm_enable_pin(codec, "Internal Mic");	snd_soc_dapm_disable_pin(codec, "Headphone Jack");	err = snd_soc_dapm_sync(codec);	if (err)		return err;	/* Headphone jack detection */	err = snd_soc_jack_new(&snd_soc_smartq, "Headphone Jack",			       SND_JACK_HEADPHONE, &smartq_jack);	if (err)		return err;	err = snd_soc_jack_add_pins(&smartq_jack, ARRAY_SIZE(smartq_jack_pins),				    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;}
开发者ID:AdiPat,项目名称:i9003_Kernel,代码行数:50,



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


C++ snd_soc_dapm_new_controls函数代码示例
C++ snd_soc_dapm_disable_pin函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。