• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ snd_soc_dapm_disable_pin函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: s6105_aic3x_init

/* Logic for a aic3x as connected on the s6105 ip camera ref design */
static int s6105_aic3x_init(struct snd_soc_codec *codec)
{
	/* Add s6105 specific widgets */
	snd_soc_dapm_new_controls(codec, aic3x_dapm_widgets,
				  ARRAY_SIZE(aic3x_dapm_widgets));

	/* Set up s6105 specific audio path audio_map */
	snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));

	/* not present */
	snd_soc_dapm_nc_pin(codec, "MONO_LOUT");
	snd_soc_dapm_nc_pin(codec, "LINE2L");
	snd_soc_dapm_nc_pin(codec, "LINE2R");

	/* not connected */
	snd_soc_dapm_nc_pin(codec, "MIC3L"); /* LINE2L on this chip */
	snd_soc_dapm_nc_pin(codec, "MIC3R"); /* LINE2R on this chip */
	snd_soc_dapm_nc_pin(codec, "LLOUT");
	snd_soc_dapm_nc_pin(codec, "RLOUT");
	snd_soc_dapm_nc_pin(codec, "HPRCOM");

	/* always connected */
	snd_soc_dapm_enable_pin(codec, "Audio In");

	/* must correspond to audio_out_mux.private_value initializer */
	snd_soc_dapm_disable_pin(codec, "Audio Out Differential");
	snd_soc_dapm_sync(codec);
	snd_soc_dapm_enable_pin(codec, "Audio Out Stereo");

	snd_soc_dapm_sync(codec);

	snd_ctl_add(codec->card, snd_ctl_new1(&audio_out_mux, codec));

	return 0;
}
开发者ID:AppEngine,项目名称:linux-2.6,代码行数:36,代码来源:s6105-ipcam.c


示例2: cs42l52_beep_work

static void cs42l52_beep_work(struct work_struct *work)
{
	struct cs42l52_private *cs42l52 =
		container_of(work, struct cs42l52_private, beep_work);
	struct snd_soc_codec *codec = cs42l52->codec;
	struct snd_soc_dapm_context *dapm = &codec->dapm;
	int i;
	int val = 0;
	int best = 0;

	if (cs42l52->beep_rate) {
		for (i = 0; i < ARRAY_SIZE(beep_rates); i++) {
			if (abs(cs42l52->beep_rate - beep_rates[i]) <
			    abs(cs42l52->beep_rate - beep_rates[best]))
				best = i;
		}

		dev_dbg(codec->dev, "Set beep rate %dHz for requested %dHz\n",
			beep_rates[best], cs42l52->beep_rate);

		val = (best << CS42L52_BEEP_RATE_SHIFT);

		snd_soc_dapm_enable_pin(dapm, "Beep");
	} else {
		dev_dbg(codec->dev, "Disabling beep\n");
		snd_soc_dapm_disable_pin(dapm, "Beep");
	}

	snd_soc_update_bits(codec, CS42L52_BEEP_FREQ,
			    CS42L52_BEEP_RATE_MASK, val);

	snd_soc_dapm_sync(dapm);
}
开发者ID:383530895,项目名称:linux,代码行数:33,代码来源:cs42l52.c


示例3: smartq_wm8987_init

static int smartq_wm8987_init(struct snd_soc_pcm_runtime *rtd)
{
	struct snd_soc_codec *codec = rtd->codec;
	struct snd_soc_dapm_context *dapm = &codec->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");

	/* set endpoints to default off mode */
	snd_soc_dapm_disable_pin(dapm, "Headphone Jack");

	/* Headphone jack detection */
	err = snd_soc_jack_new(codec, "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:383530895,项目名称:linux,代码行数:32,代码来源:smartq_wm8987.c


示例4: arizona_micsupp_check_cp

static void arizona_micsupp_check_cp(struct work_struct *work)
{
	struct arizona_micsupp *micsupp =
		container_of(work, struct arizona_micsupp, check_cp_work);
	struct snd_soc_dapm_context *dapm = micsupp->arizona->dapm;
	struct arizona *arizona = micsupp->arizona;
	struct regmap *regmap = arizona->regmap;
	unsigned int reg;
	int ret;

	ret = regmap_read(regmap, ARIZONA_MIC_CHARGE_PUMP_1, &reg);
	if (ret != 0) {
		dev_err(arizona->dev, "Failed to read CP state: %d\n", ret);
		return;
	}

	if (dapm) {
		if ((reg & (ARIZONA_CPMIC_ENA | ARIZONA_CPMIC_BYPASS)) ==
		    ARIZONA_CPMIC_ENA)
			snd_soc_dapm_force_enable_pin(dapm, "MICSUPP");
		else
			snd_soc_dapm_disable_pin(dapm, "MICSUPP");

		snd_soc_dapm_sync(dapm);
	}
}
开发者ID:BozkurTR,项目名称:kernel,代码行数:26,代码来源:arizona-micsupp.c


示例5: rt3261_codec_init

static int rt3261_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;

    dprintk(KERN_DEBUG "enter %s rt3261_snd_pdata: %p\n", __func__, rt3261_snd_pdata);

    /* Add specific widgets */
    snd_soc_dapm_new_controls(dapm, rt3261_dapm_widgets,
                  ARRAY_SIZE(rt3261_dapm_widgets));
    /* Set up specific audio path interconnects */
    snd_soc_dapm_add_routes(dapm, rt3261_dapm_intercon, ARRAY_SIZE(rt3261_dapm_intercon));
#if 0 //we have 3g, so do not set endpoint,add jf.s
    /* Setup spk/hp/mono output */
    rt3261_set_output(codec);

    /* Setuo mic input */
    rt3261_set_input(codec);
#endif
    /* 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");

    /* 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, &rt3261_snd_priv->jack);
    if (ret) {
        printk(KERN_WARNING "Failed to alloc resource for hp switch\n");
    } else {
        ret = snd_soc_jack_add_pins(&rt3261_snd_priv->jack, ARRAY_SIZE(jack_pins), jack_pins);
        if (ret) {
            dprintk(KERN_WARNING "Failed to setup hp pins\n");
        }
    }
    rt3261_snd_priv->data= (void*)codec;

    init_timer(&rt3261_snd_priv->timer);
    rt3261_snd_priv->timer.function = rt3261_timer_func;
    rt3261_snd_priv->timer.data = (unsigned long)rt3261_snd_priv;

    INIT_WORK(&rt3261_snd_priv->work, rt3261_work_func);
    mutex_init(&rt3261_snd_priv->lock);
#endif

    return 0;
}
开发者ID:abazad,项目名称:7300-kern,代码行数:59,代码来源:aml_m6_rt3261.c


示例6: byt_alc5645_init

static int byt_alc5645_init(struct snd_soc_pcm_runtime *runtime)
{
	struct snd_soc_codec *codec = runtime->codec;
	struct snd_soc_dapm_context *dapm = &codec->dapm;
	struct snd_soc_card *card = runtime->card;

	alc5645.codec = codec;
	mutex_init(&alc5645.mutex);
	alc5645.jack_status = false;
	pr_info("Enter:%s", __func__);
	/* Set codec bias level */
	card->dapm.idle_bias_off = true;

/* codec init registers */
/* TODO */
	/* Keep the voice call paths active during
	suspend. Mark the end points ignore_suspend */
	/*TODO: CHECK this */
	snd_soc_dapm_ignore_suspend(dapm, "HPOL");
	snd_soc_dapm_ignore_suspend(dapm, "HPOR");

	snd_soc_dapm_ignore_suspend(dapm, "SPOL");
	snd_soc_dapm_ignore_suspend(dapm, "SPOR");

	snd_soc_dapm_ignore_suspend(dapm, "IN2P");
	snd_soc_dapm_ignore_suspend(dapm, "IN2N");

	snd_soc_dapm_ignore_suspend(dapm, "IN1P");
	snd_soc_dapm_ignore_suspend(dapm, "IN1N");

	snd_soc_dapm_enable_pin(dapm, "Headphone");
	snd_soc_dapm_enable_pin(dapm, "Ext Spk");
	snd_soc_dapm_enable_pin(dapm, "Headset AMIC");
	snd_soc_dapm_enable_pin(dapm, "AMIC");
	snd_soc_dapm_enable_pin(dapm, "IN2P");
	snd_soc_dapm_enable_pin(dapm, "IN2N");

	snd_soc_dapm_disable_pin(dapm, "DMIC");
	snd_soc_dapm_disable_pin(dapm, "DMIC L2");
	snd_soc_dapm_disable_pin(dapm, "DMIC R2");
	snd_soc_dapm_disable_pin(dapm, "DMIC L1");
	snd_soc_dapm_disable_pin(dapm, "DMIC R1");
	snd_soc_dapm_disable_pin(dapm, "PDM1R");
	snd_soc_dapm_disable_pin(dapm, "PDM1L");
	snd_soc_dapm_disable_pin(dapm, "LOUTL");
	snd_soc_dapm_disable_pin(dapm, "LOUTR");
	mutex_lock(&codec->mutex);
	snd_soc_dapm_sync(dapm);
	mutex_unlock(&codec->mutex);
	return 0;
}
开发者ID:yutokt,项目名称:android_kernel_intel_anzhen4,代码行数:51,代码来源:byt_bl_rt5645.c


示例7: spitz_wm8750_init

/*
 * Logic for a wm8750 as connected on a Sharp SL-Cxx00 Device
 */
static int spitz_wm8750_init(struct snd_soc_codec *codec)
{
	int i, err;

	/* NC codec pins */
	snd_soc_dapm_disable_pin(codec, "RINPUT1");
	snd_soc_dapm_disable_pin(codec, "LINPUT2");
	snd_soc_dapm_disable_pin(codec, "RINPUT2");
	snd_soc_dapm_disable_pin(codec, "LINPUT3");
	snd_soc_dapm_disable_pin(codec, "RINPUT3");
	snd_soc_dapm_disable_pin(codec, "OUT3");
	snd_soc_dapm_disable_pin(codec, "MONO");

	/* Add spitz specific controls */
	for (i = 0; i < ARRAY_SIZE(wm8750_spitz_controls); i++) {
		err = snd_ctl_add(codec->card,
			snd_soc_cnew(&wm8750_spitz_controls[i], codec, NULL));
		if (err < 0)
			return err;
	}

	/* Add spitz specific widgets */
	snd_soc_dapm_new_controls(codec, wm8750_dapm_widgets,
				  ARRAY_SIZE(wm8750_dapm_widgets));

	/* Set up spitz specific audio paths */
	snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));

	snd_soc_dapm_sync(codec);
	return 0;
}
开发者ID:maraz,项目名称:linux-2.6,代码行数:34,代码来源:spitz.c


示例8: tosa_ext_control

static void tosa_ext_control(struct snd_soc_codec *codec)
{
	/* set up jack connection */
	switch (tosa_jack_func) {
	case TOSA_HP:
		snd_soc_dapm_disable_pin(codec, "Mic (Internal)");
		snd_soc_dapm_enable_pin(codec, "Headphone Jack");
		snd_soc_dapm_disable_pin(codec, "Headset Jack");
		break;
	case TOSA_MIC_INT:
		snd_soc_dapm_enable_pin(codec, "Mic (Internal)");
		snd_soc_dapm_disable_pin(codec, "Headphone Jack");
		snd_soc_dapm_disable_pin(codec, "Headset Jack");
		break;
	case TOSA_HEADSET:
		snd_soc_dapm_disable_pin(codec, "Mic (Internal)");
		snd_soc_dapm_disable_pin(codec, "Headphone Jack");
		snd_soc_dapm_enable_pin(codec, "Headset Jack");
		break;
	}

	if (tosa_spk_func == TOSA_SPK_ON)
		snd_soc_dapm_enable_pin(codec, "Speaker");
	else
		snd_soc_dapm_disable_pin(codec, "Speaker");

	snd_soc_dapm_sync(codec);
}
开发者ID:LouZiffer,项目名称:m900_kernel_cupcake-SDX,代码行数:28,代码来源:tosa.c


示例9: cht_ti_jack_event

static int cht_ti_jack_event(struct notifier_block *nb,
		unsigned long event, void *data)
{
	struct snd_soc_jack *jack = (struct snd_soc_jack *)data;
	struct snd_soc_dapm_context *dapm = &jack->card->dapm;

	if (event & SND_JACK_MICROPHONE) {
		snd_soc_dapm_force_enable_pin(dapm, "SHDN");
		snd_soc_dapm_force_enable_pin(dapm, "MICBIAS");
		snd_soc_dapm_sync(dapm);
	} else {
		snd_soc_dapm_disable_pin(dapm, "MICBIAS");
		snd_soc_dapm_disable_pin(dapm, "SHDN");
		snd_soc_dapm_sync(dapm);
	}

	return 0;
}
开发者ID:avagin,项目名称:linux,代码行数:18,代码来源:cht_bsw_max98090_ti.c


示例10: msm8960_ext_control

static void msm8960_ext_control(struct snd_soc_codec *codec)
{
	struct snd_soc_dapm_context *dapm = &codec->dapm;

	pr_debug("%s: msm8960_spk_control = %d", __func__, msm8960_spk_control);
	if (msm8960_spk_control == MSM8960_SPK_ON) {
		snd_soc_dapm_enable_pin(dapm, "Ext Spk Bottom Pos");
		snd_soc_dapm_enable_pin(dapm, "Ext Spk Bottom Neg");
		snd_soc_dapm_enable_pin(dapm, "Ext USB AMP Pos");
		snd_soc_dapm_enable_pin(dapm, "Ext USB AMP Neg");
	} else {
		snd_soc_dapm_disable_pin(dapm, "Ext Spk Bottom Pos");
		snd_soc_dapm_disable_pin(dapm, "Ext Spk Bottom Neg");
		snd_soc_dapm_disable_pin(dapm, "Ext USB AMP Pos");
		snd_soc_dapm_disable_pin(dapm, "Ext USB AMP Neg");
	}

	snd_soc_dapm_sync(dapm);
}
开发者ID:KIMMINWOO,项目名称:FusionUlt-AOSP-MR1,代码行数:19,代码来源:board-fighter-audio.c


示例11: tegra_ext_control

void tegra_ext_control(struct snd_soc_codec *codec, int new_con)
{
	struct tegra_audio_data* audio_data = codec->socdev->codec_data;
	ASOC_FUNCTION("");

	ASOC_DBG("+%s, newcon: %x\n", __func__, new_con);

	/* Disconnect old codec routes and connect new routes*/
	if (new_con & TEGRA_HEADPHONE)
		snd_soc_dapm_enable_pin(codec, "Headphone");
	else
		snd_soc_dapm_disable_pin(codec, "Headphone");

	if (new_con & (TEGRA_LINEOUT | TEGRA_EAR_SPK))
		snd_soc_dapm_enable_pin(codec, "Lineout");
	else
		snd_soc_dapm_disable_pin(codec, "Lineout");

	if (new_con & TEGRA_SPK)
		snd_soc_dapm_enable_pin(codec, "Int Spk");
	else
		snd_soc_dapm_disable_pin(codec, "Int Spk");

	if (new_con & TEGRA_INT_MIC)
		snd_soc_dapm_enable_pin(codec, "Int Mic");
	else
		snd_soc_dapm_disable_pin(codec, "Int Mic");

	if (new_con & TEGRA_EXT_MIC)
		snd_soc_dapm_enable_pin(codec, "Ext Mic");
	else
		snd_soc_dapm_disable_pin(codec, "Ext Mic");

	if (new_con & TEGRA_LINEIN)
		snd_soc_dapm_enable_pin(codec, "Linein");
	else
		snd_soc_dapm_disable_pin(codec, "Linein");

	if (new_con & TEGRA_HEADSET)
	{
		snd_soc_dapm_enable_pin(codec, "Ext Mic");
		snd_soc_dapm_enable_pin(codec, "Headset");
	}
	else
	{
		snd_soc_dapm_disable_pin(codec, "Ext Mic");
		snd_soc_dapm_disable_pin(codec, "Headset");
	}

	/* signal a DAPM event */
	snd_soc_dapm_sync(codec);
	audio_data->codec_con = new_con;
}
开发者ID:Stepanowegor,项目名称:kernel_dell_streak7,代码行数:53,代码来源:tegra_soc_wm8903.c


示例12: n810_ext_control

static void n810_ext_control(struct snd_soc_codec *codec)
{
	if (n810_spk_func)
		snd_soc_dapm_enable_pin(codec, "Ext Spk");
	else
		snd_soc_dapm_disable_pin(codec, "Ext Spk");

	if (n810_jack_func)
		snd_soc_dapm_enable_pin(codec, "Headphone Jack");
	else
		snd_soc_dapm_disable_pin(codec, "Headphone Jack");

	if (n810_dmic_func)
		snd_soc_dapm_enable_pin(codec, "DMic");
	else
		snd_soc_dapm_disable_pin(codec, "DMic");

	snd_soc_dapm_sync(codec);
}
开发者ID:LouZiffer,项目名称:m900_kernel_cupcake-SDX,代码行数:19,代码来源:n810.c


示例13: sdp3430_twl4030_init

static int sdp3430_twl4030_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_enable_pin(dapm, "Ext Mic");
	snd_soc_dapm_enable_pin(dapm, "Ext Spk");
	snd_soc_dapm_disable_pin(dapm, "Headset Mic");
	snd_soc_dapm_disable_pin(dapm, "Headset Stereophone");

	/*                            */
	snd_soc_dapm_nc_pin(dapm, "AUXL");
	snd_soc_dapm_nc_pin(dapm, "AUXR");
	snd_soc_dapm_nc_pin(dapm, "CARKITMIC");
	snd_soc_dapm_nc_pin(dapm, "DIGIMIC0");
	snd_soc_dapm_nc_pin(dapm, "DIGIMIC1");

	snd_soc_dapm_nc_pin(dapm, "OUTL");
	snd_soc_dapm_nc_pin(dapm, "OUTR");
	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, "CARKITL");
	snd_soc_dapm_nc_pin(dapm, "CARKITR");

	/*                        */
	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 (ret)
		return ret;

	ret = snd_soc_jack_add_gpios(&hs_jack, ARRAY_SIZE(hs_jack_gpios),
				hs_jack_gpios);

	return ret;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:43,代码来源:sdp3430.c


示例14: tab3_card_suspend_pre

static int tab3_card_suspend_pre(struct snd_soc_card *card)
{
#ifdef CONFIG_SEC_DEV_JACK
	struct snd_soc_codec *codec = card->rtd->codec;

	snd_soc_dapm_disable_pin(&codec->dapm, "AIF1CLK");
#endif

	return 0;
}
开发者ID:tvall43,项目名称:Samsung_SM-V700_Kernel,代码行数:10,代码来源:tab3_wm1811.c


示例15: cx81801_close

/* Line discipline .close() */
static void cx81801_close(struct tty_struct *tty)
{
	struct snd_soc_codec *codec = tty->disc_data;

	del_timer_sync(&cx81801_timer);

	v253_ops.close(tty);

	/* Prevent the hook switch from further changing the DAPM pins */
	INIT_LIST_HEAD(&ams_delta_hook_switch.pins);

	/* Revert back to default audio input/output constellation */
	snd_soc_dapm_disable_pin(codec, "Mouthpiece");
	snd_soc_dapm_enable_pin(codec, "Earpiece");
	snd_soc_dapm_enable_pin(codec, "Microphone");
	snd_soc_dapm_disable_pin(codec, "Speaker");
	snd_soc_dapm_disable_pin(codec, "AGCIN");
	snd_soc_dapm_sync(codec);
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:20,代码来源:ams-delta.c


示例16: midas_card_suspend_pre

static int midas_card_suspend_pre(struct snd_soc_card *card)
{
	struct snd_soc_codec *codec = card->rtd->codec;
	struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);

#ifdef CONFIG_SEC_DEV_JACK
	snd_soc_dapm_disable_pin(&codec->dapm, "AIF1CLK");
#endif

	return 0;
}
开发者ID:adamoutler,项目名称:EK-GC100_Galaxy_Camera,代码行数:11,代码来源:midas_wm1811.c


示例17: bdw_rt5677_suspend_pre

static int bdw_rt5677_suspend_pre(struct snd_soc_card *card)
{
	struct bdw_rt5677_priv *bdw_rt5677 = snd_soc_card_get_drvdata(card);
	struct snd_soc_dapm_context *dapm;

	if (bdw_rt5677->codec) {
		dapm = &bdw_rt5677->codec->dapm;
		snd_soc_dapm_disable_pin(dapm, "MICBIAS1");
	}
	return 0;
}
开发者ID:byxorna,项目名称:linux-samus,代码行数:11,代码来源:bdw-rt5677.c


示例18: snd_soc_component_disable_pin

int snd_soc_component_disable_pin(struct snd_soc_component *component,
				  const char *pin)
{
	struct snd_soc_dapm_context *dapm =
		snd_soc_component_get_dapm(component);
	char *full_name;
	int ret;

	if (!component->name_prefix)
		return snd_soc_dapm_disable_pin(dapm, pin);

	full_name = kasprintf(GFP_KERNEL, "%s %s", component->name_prefix, pin);
	if (!full_name)
		return -ENOMEM;

	ret = snd_soc_dapm_disable_pin(dapm, full_name);
	kfree(full_name);

	return ret;
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:20,代码来源:soc-utils.c


示例19: jack_notifier_event

static int jack_notifier_event(struct notifier_block *nb, unsigned long event, void *data)
{
	struct snd_soc_codec *codec;
	struct wm8994_priv *wm8994;
	struct snd_soc_jack *jack;

	// Force enable will keep the MICBISA on, even when we stop reording
	jack = data;

	if(jack)
	{
		codec = jack->card->codec;
		wm8994 = snd_soc_codec_get_drvdata(codec);

		if(1 == event){
			// Someone inserted a jack, we need to turn on mic bias2 for headset mic detection
			snd_soc_dapm_force_enable_pin( codec, "MICBIAS2");

			pr_crit("MIC DETECT: ENABLE. Jack inserted\n");
			// This will enable mic detection on 8958
			wm8958_mic_detect( codec, &hp_jack, NULL, NULL);

		}else if (0 == event){
			headphone_plugged = 0;
			if (headphone_switch) {
				switch_set_state(headphone_switch, headphone_plugged);
			}
			pr_crit("MIC DETECT: DISABLE. Jack removed\n");

			// This will disable mic detection on 8958
			wm8958_mic_detect( codec, NULL, NULL, NULL);

			if( wm8994->pdata->jack_is_mic) {
				dev_err(codec->dev, "  Reporting headset removed\n");
				wm8994->pdata->jack_is_mic = false;
				wm8994->micdet[0].jack->jack->type = SND_JACK_MICROPHONE;
				input_report_switch(wm8994->micdet[0].jack->jack->input_dev,
							    SW_MICROPHONE_INSERT,
						        0);
			} else { 
				dev_err(codec->dev, "  Reporting headphone removed\n");
                		input_report_switch(wm8994->micdet[0].jack->jack->input_dev,
							    SW_HEADPHONE_INSERT,
						        0);
			}
			
			input_sync(jack->jack->input_dev);
			snd_soc_dapm_disable_pin( codec, "MICBIAS2");
		}
	}

	return 0;
}
开发者ID:veirs,项目名称:UbuntuTouch,代码行数:53,代码来源:msm8x60.c


示例20: smdk_wm8580_init_paiftx

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

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

	return 0;
}
开发者ID:GerardGarcia,项目名称:linux,代码行数:12,代码来源:smdk_wm8580.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ snd_soc_dapm_nc_pin函数代码示例发布时间:2022-05-30
下一篇:
C++ snd_soc_dapm_add_routes函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap