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

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

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

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

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

示例1: max98925_dac_event

static int max98925_dac_event(struct snd_soc_dapm_widget *w,		struct snd_kcontrol *kcontrol, int event){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct max98925_priv *max98925 = snd_soc_codec_get_drvdata(codec);	switch (event) {	case SND_SOC_DAPM_PRE_PMU:		regmap_update_bits(max98925->regmap,			MAX98925_BLOCK_ENABLE,			M98925_BST_EN_MASK |			M98925_ADC_IMON_EN_MASK | M98925_ADC_VMON_EN_MASK,			M98925_BST_EN_MASK |			M98925_ADC_IMON_EN_MASK | M98925_ADC_VMON_EN_MASK);		break;	case SND_SOC_DAPM_POST_PMD:		regmap_update_bits(max98925->regmap,			MAX98925_BLOCK_ENABLE, M98925_BST_EN_MASK |			M98925_ADC_IMON_EN_MASK | M98925_ADC_VMON_EN_MASK, 0);		break;	default:		return 0;	}	return 0;}
开发者ID:ReneNyffenegger,项目名称:linux,代码行数:25,


示例2: sta32x_coefficient_get

static int sta32x_coefficient_get(struct snd_kcontrol *kcontrol,				  struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	int numcoef = kcontrol->private_value >> 16;	int index = kcontrol->private_value & 0xffff;	unsigned int cfud;	int i;	/* preserve reserved bits in STA32X_CFUD */	cfud = snd_soc_read(codec, STA32X_CFUD) & 0xf0;	/* chip documentation does not say if the bits are self clearing,	 * so do it explicitly */	snd_soc_write(codec, STA32X_CFUD, cfud);	snd_soc_write(codec, STA32X_CFADDR2, index);	if (numcoef == 1)		snd_soc_write(codec, STA32X_CFUD, cfud | 0x04);	else if (numcoef == 5)		snd_soc_write(codec, STA32X_CFUD, cfud | 0x08);	else		return -EINVAL;	for (i = 0; i < 3 * numcoef; i++)		ucontrol->value.bytes.data[i] =			snd_soc_read(codec, STA32X_B1CF1 + i);	return 0;}
开发者ID:383530895,项目名称:linux,代码行数:28,


示例3: speaker_mode_put

/* * Stop any attempts to change speaker mode while the speaker is enabled. * * We also have some special anti-pop controls dependent on speaker * mode which must be changed along with the mode. */static int speaker_mode_put(struct snd_kcontrol *kcontrol,			    struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	unsigned int reg_pwr = snd_soc_read(codec, WM9081_POWER_MANAGEMENT);	unsigned int reg2 = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_2);	/* Are we changing anything? */	if (ucontrol->value.integer.value[0] ==	    ((reg2 & WM9081_SPK_MODE) != 0))		return 0;	/* Don't try to change modes while enabled */	if (reg_pwr & WM9081_SPK_ENA)		return -EINVAL;	if (ucontrol->value.integer.value[0]) {		/* Class AB */		reg2 &= ~(WM9081_SPK_INV_MUTE | WM9081_OUT_SPK_CTRL);		reg2 |= WM9081_SPK_MODE;	} else {		/* Class D */		reg2 |= WM9081_SPK_INV_MUTE | WM9081_OUT_SPK_CTRL;		reg2 &= ~WM9081_SPK_MODE;	}	snd_soc_write(codec, WM9081_ANALOGUE_SPEAKER_2, reg2);	return 0;}
开发者ID:Seagate,项目名称:SMR_FS-EXT4,代码行数:36,


示例4: sta32x_coefficient_put

static int sta32x_coefficient_put(struct snd_kcontrol *kcontrol,				  struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec);	int numcoef = kcontrol->private_value >> 16;	int index = kcontrol->private_value & 0xffff;	unsigned int cfud;	int i;	/* preserve reserved bits in STA32X_CFUD */	cfud = snd_soc_read(codec, STA32X_CFUD) & 0xf0;	/* chip documentation does not say if the bits are self clearing,	 * so do it explicitly */	snd_soc_write(codec, STA32X_CFUD, cfud);	snd_soc_write(codec, STA32X_CFADDR2, index);	for (i = 0; i < numcoef && (index + i < STA32X_COEF_COUNT); i++)		sta32x->coef_shadow[index + i] =			  (ucontrol->value.bytes.data[3 * i] << 16)			| (ucontrol->value.bytes.data[3 * i + 1] << 8)			| (ucontrol->value.bytes.data[3 * i + 2]);	for (i = 0; i < 3 * numcoef; i++)		snd_soc_write(codec, STA32X_B1CF1 + i,			      ucontrol->value.bytes.data[i]);	if (numcoef == 1)		snd_soc_write(codec, STA32X_CFUD, cfud | 0x01);	else if (numcoef == 5)		snd_soc_write(codec, STA32X_CFUD, cfud | 0x02);	else		return -EINVAL;	return 0;}
开发者ID:383530895,项目名称:linux,代码行数:34,


示例5: cs4271_get_deemph

static int cs4271_get_deemph(struct snd_kcontrol *kcontrol,			     struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);	ucontrol->value.enumerated.item[0] = cs4271->deemph;	return 0;}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:9,


示例6: pcm512x_overclock_dac_get

static int pcm512x_overclock_dac_get(struct snd_kcontrol *kcontrol,				     struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct pcm512x_priv *pcm512x = snd_soc_codec_get_drvdata(codec);	ucontrol->value.integer.value[0] = pcm512x->overclock_dac;	return 0;}
开发者ID:020gzh,项目名称:linux,代码行数:9,


示例7: es8328_get_deemph

static int es8328_get_deemph(struct snd_kcontrol *kcontrol,			     struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct es8328_priv *es8328 = snd_soc_codec_get_drvdata(codec);	ucontrol->value.integer.value[0] = es8328->deemph;	return 0;}
开发者ID:EvanHa,项目名称:rbp,代码行数:9,


示例8: cs4271_put_deemph

static int cs4271_put_deemph(struct snd_kcontrol *kcontrol,			     struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);	cs4271->deemph = ucontrol->value.integer.value[0];	return cs4271_set_deemph(codec);}
开发者ID:020gzh,项目名称:linux,代码行数:9,


示例9: adav80x_get_deemph

static int adav80x_get_deemph(struct snd_kcontrol *kcontrol,				struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);	ucontrol->value.enumerated.item[0] = adav80x->deemph;	return 0;};
开发者ID:3null,项目名称:linux,代码行数:9,


示例10: ak4641_get_deemph

static int ak4641_get_deemph(struct snd_kcontrol *kcontrol,				struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct ak4641_priv *ak4641 = snd_soc_codec_get_drvdata(codec);	ucontrol->value.integer.value[0] = ak4641->deemph;	return 0;};
开发者ID:vishnupatekar,项目名称:linux,代码行数:9,


示例11: wm8904_get_deemph

static int wm8904_get_deemph(struct snd_kcontrol *kcontrol,			     struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);	ucontrol->value.integer.value[0] = wm8904->deemph;	return 0;}
开发者ID:rajat1994,项目名称:linux,代码行数:9,


示例12: lm4857_get_mode

static int lm4857_get_mode(struct snd_kcontrol *kcontrol,	struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct lm4857 *lm4857 = snd_soc_codec_get_drvdata(codec);	ucontrol->value.integer.value[0] = lm4857->mode;	return 0;}
开发者ID:19Dan01,项目名称:linux,代码行数:10,


示例13: snd_wl1273_get_audio_route

static int snd_wl1273_get_audio_route(struct snd_kcontrol *kcontrol,				      struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec);	ucontrol->value.enumerated.item[0] = wl1273->mode;	return 0;}
开发者ID:020gzh,项目名称:linux,代码行数:10,


示例14: wm2000_speaker_get

static int wm2000_speaker_get(struct snd_kcontrol *kcontrol,                              struct snd_ctl_elem_value *ucontrol){    struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);    struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);    ucontrol->value.integer.value[0] = wm2000->spk_ena;    return 0;}
开发者ID:superna9999,项目名称:linux,代码行数:10,


示例15: tas5086_put_deemph

static int tas5086_put_deemph(struct snd_kcontrol *kcontrol,			      struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct tas5086_private *priv = snd_soc_codec_get_drvdata(codec);	priv->deemph = ucontrol->value.integer.value[0];	return tas5086_set_deemph(codec);}
开发者ID:19Dan01,项目名称:linux,代码行数:10,


示例16: pcm1681_get_deemph

static int pcm1681_get_deemph(struct snd_kcontrol *kcontrol,			      struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct pcm1681_private *priv = snd_soc_codec_get_drvdata(codec);	ucontrol->value.integer.value[0] = priv->deemph;	return 0;}
开发者ID:19Dan01,项目名称:linux,代码行数:10,


示例17: wm8904_get_retune_mobile_enum

static int wm8904_get_retune_mobile_enum(struct snd_kcontrol *kcontrol,					 struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);	ucontrol->value.enumerated.item[0] = wm8904->retune_mobile_cfg;	return 0;}
开发者ID:rajat1994,项目名称:linux,代码行数:10,


示例18: max9768_set_gpio

static int max9768_set_gpio(struct snd_kcontrol *kcontrol,	struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct max9768 *max9768 = snd_soc_codec_get_drvdata(codec);	gpio_set_value_cansleep(max9768->mute_gpio, !ucontrol->value.integer.value[0]);	return 0;}
开发者ID:19Dan01,项目名称:linux,代码行数:10,


示例19: wm2000_anc_mode_get

static int wm2000_anc_mode_get(struct snd_kcontrol *kcontrol,			       struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);	ucontrol->value.enumerated.item[0] = wm2000->anc_active;	return 0;}
开发者ID:Abioy,项目名称:kasan,代码行数:10,


示例20: snd_wl1273_fm_volume_get

static int snd_wl1273_fm_volume_get(struct snd_kcontrol *kcontrol,				    struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec);	dev_dbg(codec->dev, "%s: enter./n", __func__);	ucontrol->value.integer.value[0] = wl1273->core->volume;	return 0;}
开发者ID:020gzh,项目名称:linux,代码行数:12,


示例21: cs4270_soc_put_mute

/** * cs4270_soc_put_mute - put callback for the 'Master Playback switch' * 			 alsa control. * @kcontrol: mixer control * @ucontrol: control element information * * This function basically passes the arguments on to the generic * snd_soc_put_volsw() function and saves the mute information in * our private data structure. This is because we want to prevent * cs4270_dai_mute() neglecting the user's decision to manually * mute the codec's output. * * Returns 0 for success. */static int cs4270_soc_put_mute(struct snd_kcontrol *kcontrol,				struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);	int left = !ucontrol->value.integer.value[0];	int right = !ucontrol->value.integer.value[1];	cs4270->manual_mute = (left ? CS4270_MUTE_DAC_A : 0) |			      (right ? CS4270_MUTE_DAC_B : 0);	return snd_soc_put_volsw(kcontrol, ucontrol);}
开发者ID:MaxChina,项目名称:linux,代码行数:27,


示例22: lm4857_set_mode

static int lm4857_set_mode(struct snd_kcontrol *kcontrol,	struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct lm4857 *lm4857 = snd_soc_codec_get_drvdata(codec);	uint8_t value = ucontrol->value.integer.value[0];	lm4857->mode = value;	if (codec->dapm.bias_level == SND_SOC_BIAS_ON)		regmap_update_bits(lm4857->regmap, LM4857_CTRL, 0x0F, value + 6);	return 1;}
开发者ID:19Dan01,项目名称:linux,代码行数:14,


示例23: speaker_mode_get

static int speaker_mode_get(struct snd_kcontrol *kcontrol,			    struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	unsigned int reg;	reg = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_2);	if (reg & WM9081_SPK_MODE)		ucontrol->value.integer.value[0] = 1;	else		ucontrol->value.integer.value[0] = 0;	return 0;}
开发者ID:Seagate,项目名称:SMR_FS-EXT4,代码行数:14,


示例24: eqmode_get

static int eqmode_get(struct snd_kcontrol *kcontrol,		      struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	unsigned int reg;	reg = snd_soc_read(codec, WM8985_EQ1_LOW_SHELF);	if (reg & WM8985_EQ3DMODE)		ucontrol->value.integer.value[0] = 1;	else		ucontrol->value.integer.value[0] = 0;	return 0;}
开发者ID:DenisLug,项目名称:mptcp,代码行数:14,


示例25: adav80x_put_deemph

static int adav80x_put_deemph(struct snd_kcontrol *kcontrol,		struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);	unsigned int deemph = ucontrol->value.enumerated.item[0];	if (deemph > 1)		return -EINVAL;	adav80x->deemph = deemph;	return adav80x_set_deemph(codec);}
开发者ID:3null,项目名称:linux,代码行数:14,


示例26: ak4641_put_deemph

static int ak4641_put_deemph(struct snd_kcontrol *kcontrol,				struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct ak4641_priv *ak4641 = snd_soc_codec_get_drvdata(codec);	int deemph = ucontrol->value.integer.value[0];	if (deemph > 1)		return -EINVAL;	ak4641->deemph = deemph;	return ak4641_set_deemph(codec);}
开发者ID:vishnupatekar,项目名称:linux,代码行数:14,


示例27: txsrc_get

static int txsrc_get(struct snd_kcontrol *kcontrol,		     struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec;	unsigned int src;	codec = snd_soc_kcontrol_codec(kcontrol);	src = snd_soc_read(codec, WM8804_SPDTX4);	if (src & 0x40)		ucontrol->value.integer.value[0] = 1;	else		ucontrol->value.integer.value[0] = 0;	return 0;}
开发者ID:3null,项目名称:linux,代码行数:15,


示例28: txsrc_put

static int txsrc_put(struct snd_kcontrol *kcontrol,		     struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec;	unsigned int src, txpwr;	codec = snd_soc_kcontrol_codec(kcontrol);	if (ucontrol->value.integer.value[0] != 0			&& ucontrol->value.integer.value[0] != 1)		return -EINVAL;	src = snd_soc_read(codec, WM8804_SPDTX4);	switch ((src & 0x40) >> 6) {	case 0:		if (!ucontrol->value.integer.value[0])			return 0;		break;	case 1:		if (ucontrol->value.integer.value[1])			return 0;		break;	}	/* save the current power state of the transmitter */	txpwr = snd_soc_read(codec, WM8804_PWRDN) & 0x4;	/* power down the transmitter */	snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x4);	/* set the tx source */	snd_soc_update_bits(codec, WM8804_SPDTX4, 0x40,			    ucontrol->value.integer.value[0] << 6);	if (ucontrol->value.integer.value[0]) {		/* power down the receiver */		snd_soc_update_bits(codec, WM8804_PWRDN, 0x2, 0x2);		/* power up the AIF */		snd_soc_update_bits(codec, WM8804_PWRDN, 0x10, 0);	} else {		/* don't power down the AIF -- may be used as an output */		/* power up the receiver */		snd_soc_update_bits(codec, WM8804_PWRDN, 0x2, 0);	}	/* restore the transmitter's configuration */	snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, txpwr);	return 0;}
开发者ID:3null,项目名称:linux,代码行数:48,


示例29: snd_wl1273_fm_volume_put

static int snd_wl1273_fm_volume_put(struct snd_kcontrol *kcontrol,				    struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec);	int r;	dev_dbg(codec->dev, "%s: enter./n", __func__);	r = wl1273->core->set_volume(wl1273->core,				     ucontrol->value.integer.value[0]);	if (r)		return r;	return 1;}
开发者ID:020gzh,项目名称:linux,代码行数:16,


示例30: wm899x_outpga_put_volsw_vu

static int wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,				      struct snd_ctl_elem_value *ucontrol){	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);	int reg = kcontrol->private_value & 0xff;	int ret;	u16 val;	ret = snd_soc_put_volsw(kcontrol, ucontrol);	if (ret < 0)		return ret;	/* now hit the volume update bits (always bit 8) */	val = snd_soc_read(codec, reg);	return snd_soc_write(codec, reg, val | 0x0100);}
开发者ID:020gzh,项目名称:linux,代码行数:16,



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


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