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

C++ snd_soc_codec_set_cache_io函数代码示例

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

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



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

示例1: cs4271_probe

static int cs4271_probe(struct snd_soc_codec *codec)
{
	struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);
	struct cs4271_platform_data *cs4271plat = codec->dev->platform_data;
	int ret;
	int gpio_nreset = -EINVAL;

	codec->control_data = cs4271->control_data;

	if (cs4271plat && gpio_is_valid(cs4271plat->gpio_nreset))
		gpio_nreset = cs4271plat->gpio_nreset;

	if (gpio_nreset >= 0)
		if (gpio_request(gpio_nreset, "CS4271 Reset"))
			gpio_nreset = -EINVAL;
	if (gpio_nreset >= 0) {
		/* Reset codec */
		gpio_direction_output(gpio_nreset, 0);
		udelay(1);
		gpio_set_value(gpio_nreset, 1);
		/* Give the codec time to wake up */
		udelay(1);
	}

	cs4271->gpio_nreset = gpio_nreset;

	/*
	 * In case of I2C, chip address specified in board data.
	 * So cache IO operations use 8 bit codec register address.
	 * In case of SPI, chip address and register address
	 * passed together as 16 bit value.
	 * Anyway, register address is masked with 0xFF inside
	 * soc-cache code.
	 */
	if (cs4271->bus_type == SND_SOC_SPI)
		ret = snd_soc_codec_set_cache_io(codec, 16, 8,
			cs4271->bus_type);
	else
		ret = snd_soc_codec_set_cache_io(codec, 8, 8,
			cs4271->bus_type);
	if (ret) {
		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
		return ret;
	}

	ret = snd_soc_update_bits(codec, CS4271_MODE2, 0,
		CS4271_MODE2_PDN | CS4271_MODE2_CPEN);
	if (ret < 0)
		return ret;
	ret = snd_soc_update_bits(codec, CS4271_MODE2, CS4271_MODE2_PDN, 0);
	if (ret < 0)
		return ret;
	/* Power-up sequence requires 85 uS */
	udelay(85);

	return snd_soc_add_controls(codec, cs4271_snd_controls,
		ARRAY_SIZE(cs4271_snd_controls));
}
开发者ID:1yankeedt,项目名称:D710BST_FL24_Kernel,代码行数:58,代码来源:cs4271.c


示例2: cs4271_probe

static int cs4271_probe(struct snd_soc_codec *codec)
{
	struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);
	struct cs4271_platform_data *cs4271plat = codec->dev->platform_data;
	int ret;
	int gpio_nreset = -EINVAL;

	if (cs4271plat && gpio_is_valid(cs4271plat->gpio_nreset))
		gpio_nreset = cs4271plat->gpio_nreset;

	if (gpio_nreset >= 0)
		if (gpio_request(gpio_nreset, "CS4271 Reset"))
			gpio_nreset = -EINVAL;
	if (gpio_nreset >= 0) {
		
		gpio_direction_output(gpio_nreset, 0);
		udelay(1);
		gpio_set_value(gpio_nreset, 1);
		
		udelay(1);
	}

	cs4271->gpio_nreset = gpio_nreset;

	if (cs4271->bus_type == SND_SOC_SPI)
		ret = snd_soc_codec_set_cache_io(codec, 16, 8,
			cs4271->bus_type);
	else
		ret = snd_soc_codec_set_cache_io(codec, 8, 8,
			cs4271->bus_type);
	if (ret) {
		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
		return ret;
	}

	ret = snd_soc_update_bits(codec, CS4271_MODE2,
				  CS4271_MODE2_PDN | CS4271_MODE2_CPEN,
				  CS4271_MODE2_PDN | CS4271_MODE2_CPEN);
	if (ret < 0)
		return ret;
	ret = snd_soc_update_bits(codec, CS4271_MODE2, CS4271_MODE2_PDN, 0);
	if (ret < 0)
		return ret;
	
	udelay(85);

	return snd_soc_add_codec_controls(codec, cs4271_snd_controls,
		ARRAY_SIZE(cs4271_snd_controls));
}
开发者ID:MiniBlu,项目名称:cm11_kernel_htc_msm8974a3ul,代码行数:49,代码来源:cs4271.c


示例3: aml_pmu4_audio_probe

static int aml_pmu4_audio_probe(struct snd_soc_codec *codec)
{
    struct aml_pmu4_audio_priv *pmu4_audio = NULL;

    printk("enter %s\n",__func__);
	pmu4_audio = kzalloc(sizeof(struct aml_pmu4_audio_priv), GFP_KERNEL);
    if (NULL == pmu4_audio)
        return -ENOMEM;
	snd_soc_codec_set_drvdata(codec,pmu4_audio);
#if 0
    ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_I2C);
    if (ret != 0) {
        dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
        return ret;
    }
#endif
	
	//enable LDO1V8 for audio
	aml_pmu4_audio_power_init();  

	//reset audio codec register
    aml_pmu4_audio_reset(codec);
	aml_pmu4_audio_start_up(codec);

    aml_pmu4_audio_reg_init(codec);

    codec->dapm.bias_level = SND_SOC_BIAS_STANDBY;

    pmu4_audio->codec = codec;



    return 0;
}
开发者ID:akuster,项目名称:linux-meson,代码行数:34,代码来源:aml_pmu4_codec.c


示例4: cs42l51_probe

static int cs42l51_probe(struct snd_soc_codec *codec)
{
	struct cs42l51_private *cs42l51 = snd_soc_codec_get_drvdata(codec);
	int ret, reg;

	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;
	}

	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;

	return 0;
}
开发者ID:MiniBlu,项目名称:cm11_kernel_htc_msm8974a3ul,代码行数:25,代码来源:cs42l51.c


示例5: cs42l51_probe

static int cs42l51_probe(struct snd_soc_codec *codec)
{
	struct cs42l51_private *cs42l51 = snd_soc_codec_get_drvdata(codec);
	int ret, reg;

	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;

	return 0;
}
开发者ID:LuweiLight,项目名称:linux-3.14.35-vbal,代码行数:32,代码来源:cs42l51.c


示例6: wm8988_probe

static int wm8988_probe(struct snd_soc_codec *codec)
{
	struct wm8988_priv *wm8988 = snd_soc_codec_get_drvdata(codec);
	struct snd_soc_dapm_context *dapm = &codec->dapm;
	int ret = 0;

	ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8988->control_type);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
		return ret;
	}

	ret = wm8988_reset(codec);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to issue reset\n");
		return ret;
	}

	/* set the update bits (we always update left then right) */
	snd_soc_update_bits(codec, WM8988_RADC, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8988_RDAC, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8988_ROUT1V, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8988_ROUT2V, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8988_RINVOL, 0x0100, 0x0100);

	wm8988_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

	snd_soc_add_controls(codec, wm8988_snd_controls,
				ARRAY_SIZE(wm8988_snd_controls));
	snd_soc_dapm_new_controls(dapm, wm8988_dapm_widgets,
				  ARRAY_SIZE(wm8988_dapm_widgets));
	snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));

	return 0;
}
开发者ID:454053205,项目名称:linux,代码行数:35,代码来源:wm8988.c


示例7: wm8776_probe

static int wm8776_probe(struct snd_soc_codec *codec)
{
	struct wm8776_priv *wm8776 = snd_soc_codec_get_drvdata(codec);
	int ret = 0;

	ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8776->control_type);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
		return ret;
	}

	ret = wm8776_reset(codec);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to issue reset: %d\n", ret);
		return ret;
	}

	wm8776_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

	/* Latch the update bits; right channel only since we always
	 * update both. */
	snd_soc_update_bits(codec, WM8776_HPRVOL, 0x100, 0x100);
	snd_soc_update_bits(codec, WM8776_DACRVOL, 0x100, 0x100);

	return ret;
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:26,代码来源:wm8776.c


示例8: wm5110_codec_probe

static int wm5110_codec_probe(struct snd_soc_codec *codec)
{
	struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec);

	codec->control_data = priv->core.arizona->regmap;
	return snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP);
}
开发者ID:AmesianX,项目名称:netlink-mmap,代码行数:7,代码来源:wm5110.c


示例9: cs42l73_probe

static int cs42l73_probe(struct snd_soc_codec *codec)
{
	int ret;
	struct cs42l73_private *cs42l73 = snd_soc_codec_get_drvdata(codec);

	codec->control_data = cs42l73->regmap;

	ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
		return ret;
	}

	cs42l73_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

	/* Set Charge Pump Frequency */
	if (cs42l73->pdata.chgfreq)
		snd_soc_update_bits(codec, CS42L73_CPFCHC,
				    CS42L73_CHARGEPUMP_MASK,
					cs42l73->pdata.chgfreq << 4);

	/* MCLK1 as master clk */
	cs42l73->mclksel = CS42L73_CLKID_MCLK1;
	cs42l73->mclk = 0;

	return ret;
}
开发者ID:LuweiLight,项目名称:linux-3.14.35-vbal,代码行数:27,代码来源:cs42l73.c


示例10: tas5707_probe

static int tas5707_probe(struct snd_soc_codec *codec)
{
	int ret = 0;
	struct tas5707_priv *tas5707 = snd_soc_codec_get_drvdata(codec);
	struct tas57xx_platform_data *pdata = dev_get_platdata(codec->dev);

#ifdef CONFIG_HAS_EARLYSUSPEND
        early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN;
        early_suspend.suspend = tas5707_early_suspend;
        early_suspend.resume = tas5707_late_resume;
        early_suspend.param = codec;
        register_early_suspend(&early_suspend);
#endif

	tas5707->pdata = pdata;
	//codec->control_data = tas5707->control_data;
	codec->control_type = tas5707->control_type;
    ret = snd_soc_codec_set_cache_io(codec, 8, 8, tas5707->control_type);
    if (ret != 0) {
        dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
        return ret;
    }

	//TODO: set the DAP
	tas5707_init(codec);

	return 0;
}
开发者ID:enmaca,项目名称:linux-amlogic,代码行数:28,代码来源:tas5707.c


示例11: ak4104_probe

static int ak4104_probe(struct snd_soc_codec *codec)
{
	struct ak4104_private *ak4104 = snd_soc_codec_get_drvdata(codec);
	int ret;

	codec->control_data = ak4104->regmap;
	ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
	if (ret != 0)
		return ret;

	/*                                 */
	ret = snd_soc_update_bits(codec, AK4104_REG_CONTROL1,
				  AK4104_CONTROL1_PW | AK4104_CONTROL1_RSTN,
				  AK4104_CONTROL1_PW | AK4104_CONTROL1_RSTN);
	if (ret < 0)
		return ret;

	/*                    */
	ret = snd_soc_update_bits(codec, AK4104_REG_TX,
				  AK4104_TX_TXE, AK4104_TX_TXE);
	if (ret < 0)
		return ret;

	return 0;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:25,代码来源:ak4104.c


示例12: max9768_probe

static int max9768_probe(struct snd_soc_codec *codec)
{
	struct max9768 *max9768 = snd_soc_codec_get_drvdata(codec);
	int ret;

	codec->control_data = max9768->regmap;
	ret = snd_soc_codec_set_cache_io(codec, 2, 6, SND_SOC_REGMAP);
	if (ret)
		return ret;

	if (max9768->flags & MAX9768_FLAG_CLASSIC_PWM) {
		ret = snd_soc_write(codec, MAX9768_CTRL, MAX9768_CTRL_PWM);
		if (ret)
			return ret;
	}

	if (gpio_is_valid(max9768->mute_gpio)) {
		ret = snd_soc_add_codec_controls(codec, max9768_mute,
				ARRAY_SIZE(max9768_mute));
		if (ret)
			return ret;
	}

	return 0;
}
开发者ID:MiniBlu,项目名称:cm11_kernel_htc_msm8974a3ul,代码行数:25,代码来源:max9768.c


示例13: wm8750_probe

static int wm8750_probe(struct snd_soc_codec *codec)
{
	int ret;

	ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
	if (ret < 0) {
		printk(KERN_ERR "wm8750: failed to set cache I/O: %d\n", ret);
		return ret;
	}

	ret = wm8750_reset(codec);
	if (ret < 0) {
		printk(KERN_ERR "wm8750: failed to reset: %d\n", ret);
		return ret;
	}

	/* charge output caps */
	wm8750_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

	/* set the update bits */
	snd_soc_update_bits(codec, WM8750_LDAC, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8750_RDAC, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8750_LOUT1V, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8750_ROUT1V, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8750_LOUT2V, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8750_ROUT2V, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8750_LINVOL, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8750_RINVOL, 0x0100, 0x0100);

	return ret;
}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:31,代码来源:wm8750.c


示例14: ad193x_probe

static int ad193x_probe(struct snd_soc_codec *codec)
{
	struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec);
	int ret;

	codec->control_data = ad193x->regmap;
	ret = snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
	if (ret < 0) {
		dev_err(codec->dev, "failed to set cache I/O: %d\n", ret);
		return ret;
	}

	/* default setting for ad193x */

	/* unmute dac channels */
	regmap_write(ad193x->regmap, AD193X_DAC_CHNL_MUTE, 0x0);
	/* de-emphasis: 48kHz, powedown dac */
	regmap_write(ad193x->regmap, AD193X_DAC_CTRL2, 0x1A);
	/* powerdown dac, dac in tdm mode */
	regmap_write(ad193x->regmap, AD193X_DAC_CTRL0, 0x41);
	/* high-pass filter enable */
	regmap_write(ad193x->regmap, AD193X_ADC_CTRL0, 0x3);
	/* sata delay=1, adc aux mode */
	regmap_write(ad193x->regmap, AD193X_ADC_CTRL1, 0x43);
	/* pll input: mclki/xi */
	regmap_write(ad193x->regmap, AD193X_PLL_CLK_CTRL0, 0x99); /* mclk=24.576Mhz: 0x9D; mclk=12.288Mhz: 0x99 */
	regmap_write(ad193x->regmap, AD193X_PLL_CLK_CTRL1, 0x04);

	return ret;
}
开发者ID:Packmaan7144,项目名称:kernel_nvidia_s8515,代码行数:30,代码来源:ad193x.c


示例15: wm8988_probe

static int wm8988_probe(struct snd_soc_codec *codec)
{
	struct wm8988_priv *wm8988 = snd_soc_codec_get_drvdata(codec);
	int ret = 0;

	codec->control_data = wm8988->regmap;
	ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
		return ret;
	}

	ret = wm8988_reset(codec);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to issue reset\n");
		return ret;
	}

	/* set the update bits (we always update left then right) */
	snd_soc_update_bits(codec, WM8988_RADC, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8988_RDAC, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8988_ROUT1V, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8988_ROUT2V, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8988_RINVOL, 0x0100, 0x0100);

	wm8988_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

	return 0;
}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:29,代码来源:wm8988.c


示例16: alc5632_probe

static int alc5632_probe(struct snd_soc_codec *codec)
{
	struct alc5632_priv *alc5632 = snd_soc_codec_get_drvdata(codec);
	int ret;

	codec->control_data = alc5632->regmap;

	ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
	if (ret != 0) {
		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
		return ret;
	}

	/*                  */
	alc5632_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

	switch (alc5632->id) {
	case 0x5c:
		snd_soc_add_codec_controls(codec, alc5632_vol_snd_controls,
			ARRAY_SIZE(alc5632_vol_snd_controls));
		break;
	default:
		return -EINVAL;
	}

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


示例17: wm8741_probe

static int wm8741_probe(struct snd_soc_codec *codec)
{
	struct wm8741_priv *wm8741 = snd_soc_codec_get_drvdata(codec);
	u16 *reg_cache = codec->reg_cache;
	int ret = 0;

	ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8741->control_type);
	if (ret != 0) {
		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
		return ret;
	}

	ret = wm8741_reset(codec);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to issue reset\n");
		return ret;
	}

	/* Change some default settings - latch VU */
	reg_cache[WM8741_DACLLSB_ATTENUATION] |= WM8741_UPDATELL;
	reg_cache[WM8741_DACLMSB_ATTENUATION] |= WM8741_UPDATELM;
	reg_cache[WM8741_DACRLSB_ATTENUATION] |= WM8741_UPDATERL;
	reg_cache[WM8741_DACRLSB_ATTENUATION] |= WM8741_UPDATERM;

	snd_soc_add_controls(codec, wm8741_snd_controls,
			     ARRAY_SIZE(wm8741_snd_controls));
	wm8741_add_widgets(codec);

	dev_dbg(codec->dev, "Successful registration\n");
	return ret;
}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:31,代码来源:wm8741.c


示例18: aic32x4_probe

static int aic32x4_probe(struct snd_soc_codec *codec)
{
	struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec);
	u32 tmp_reg;

	snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);

	if (aic32x4->rstn_gpio >= 0) {
		ndelay(10);
		gpio_set_value(aic32x4->rstn_gpio, 1);
	}

	snd_soc_write(codec, AIC32X4_RESET, 0x01);

	/* Power platform configuration */
	if (aic32x4->power_cfg & AIC32X4_PWR_MICBIAS_2075_LDOIN) {
		snd_soc_write(codec, AIC32X4_MICBIAS, AIC32X4_MICBIAS_LDOIN |
						      AIC32X4_MICBIAS_2075V);
	}
	if (aic32x4->power_cfg & AIC32X4_PWR_AVDD_DVDD_WEAK_DISABLE) {
		snd_soc_write(codec, AIC32X4_PWRCFG, AIC32X4_AVDDWEAKDISABLE);
	}

	tmp_reg = (aic32x4->power_cfg & AIC32X4_PWR_AIC32X4_LDO_ENABLE) ?
			AIC32X4_LDOCTLEN : 0;
	snd_soc_write(codec, AIC32X4_LDOCTL, tmp_reg);

	tmp_reg = snd_soc_read(codec, AIC32X4_CMMODE);
	if (aic32x4->power_cfg & AIC32X4_PWR_CMMODE_LDOIN_RANGE_18_36) {
		tmp_reg |= AIC32X4_LDOIN_18_36;
	}
	if (aic32x4->power_cfg & AIC32X4_PWR_CMMODE_HP_LDOIN_POWERED) {
		tmp_reg |= AIC32X4_LDOIN2HP;
	}
	snd_soc_write(codec, AIC32X4_CMMODE, tmp_reg);

	/* Mic PGA routing */
	if (aic32x4->micpga_routing & AIC32X4_MICPGA_ROUTE_LMIC_IN2R_10K)
		snd_soc_write(codec, AIC32X4_LMICPGANIN, AIC32X4_LMICPGANIN_IN2R_10K);
	else
		snd_soc_write(codec, AIC32X4_LMICPGANIN, AIC32X4_LMICPGANIN_CM1L_10K);
	if (aic32x4->micpga_routing & AIC32X4_MICPGA_ROUTE_RMIC_IN1L_10K)
		snd_soc_write(codec, AIC32X4_RMICPGANIN, AIC32X4_RMICPGANIN_IN1L_10K);
	else
		snd_soc_write(codec, AIC32X4_RMICPGANIN, AIC32X4_RMICPGANIN_CM1R_10K);

	aic32x4_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

	/*
	 * Workaround: for an unknown reason, the ADC needs to be powered up
	 * and down for the first capture to work properly. It seems related to
	 * a HW BUG or some kind of behavior not documented in the datasheet.
	 */
	tmp_reg = snd_soc_read(codec, AIC32X4_ADCSETUP);
	snd_soc_write(codec, AIC32X4_ADCSETUP, tmp_reg |
				AIC32X4_LADC_EN | AIC32X4_RADC_EN);
	snd_soc_write(codec, AIC32X4_ADCSETUP, tmp_reg);

	return 0;
}
开发者ID:LuweiLight,项目名称:linux-3.14.35-vbal,代码行数:60,代码来源:tlv320aic32x4.c


示例19: cs35l32_probe

static int cs35l32_probe(struct snd_soc_codec *codec) {
	int ret;
	struct cs35l32_private *cs35l32 = snd_soc_codec_get_drvdata(codec);

	codec->control_data = cs35l32->regmap;
	
	ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
		return ret;
	}

	regcache_cache_only(cs35l32->regmap, false);

	/* Power down the AMP */
	snd_soc_update_bits(codec, CS35L32_PWRCTL1, CS35L32_PDN_AMP, 1);
	
	/* Setup ADSP Format Config */
	snd_soc_update_bits(codec, CS35L32_ADSP_CTL, CS35L32_ADSP_SHARE_MASK,
			    cs35l32->pdata.sdout_share << 3); 
	/* Setup ADSP Data Configuration */
	snd_soc_update_bits(codec, CS35L32_ADSP_CTL, CS35L32_ADSP_DATACFG_MASK,
			    cs35l32->pdata.sdout_datacfg << 4);

	/* Setup VBoost Manager  */
	snd_soc_update_bits(codec, CS35L32_AUDIO_LED_MNGR, CS35L32_BOOST_MASK,
			    cs35l32->pdata.boost_mng);

	/* Clear MCLK Error Bit since we don't have the clock yet */
	snd_soc_read(codec, CS35L32_INT_STATUS_1);
	
	return ret;
}
开发者ID:bju2000,项目名称:kernel_lge_msm8994,代码行数:33,代码来源:cs35l32.c


示例20: wm8741_probe

static int wm8741_probe(struct snd_soc_codec *codec)
{
	struct wm8741_priv *wm8741 = snd_soc_codec_get_drvdata(codec);
	int ret = 0;
	int i;

	for (i = 0; i < ARRAY_SIZE(wm8741->supplies); i++)
		wm8741->supplies[i].supply = wm8741_supply_names[i];

	ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(wm8741->supplies),
				 wm8741->supplies);
	if (ret != 0) {
		dev_err(codec->dev, "Failed to request supplies: %d\n", ret);
		goto err;
	}

	ret = regulator_bulk_enable(ARRAY_SIZE(wm8741->supplies),
				    wm8741->supplies);
	if (ret != 0) {
		dev_err(codec->dev, "Failed to enable supplies: %d\n", ret);
		goto err_get;
	}

	ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8741->control_type);
	if (ret != 0) {
		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
		goto err_enable;
	}

	ret = wm8741_reset(codec);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to issue reset\n");
		goto err_enable;
	}

	/* Change some default settings - latch VU */
	snd_soc_update_bits(codec, WM8741_DACLLSB_ATTENUATION,
			    WM8741_UPDATELL, WM8741_UPDATELL);
	snd_soc_update_bits(codec, WM8741_DACLMSB_ATTENUATION,
			    WM8741_UPDATELM, WM8741_UPDATELM);
	snd_soc_update_bits(codec, WM8741_DACRLSB_ATTENUATION,
			    WM8741_UPDATERL, WM8741_UPDATERL);
	snd_soc_update_bits(codec, WM8741_DACRMSB_ATTENUATION,
			    WM8741_UPDATERM, WM8741_UPDATERM);

	snd_soc_add_controls(codec, wm8741_snd_controls,
			     ARRAY_SIZE(wm8741_snd_controls));
	wm8741_add_widgets(codec);

	dev_dbg(codec->dev, "Successful registration\n");
	return ret;

err_enable:
	regulator_bulk_disable(ARRAY_SIZE(wm8741->supplies), wm8741->supplies);
err_get:
	regulator_bulk_free(ARRAY_SIZE(wm8741->supplies), wm8741->supplies);
err:
	return ret;
}
开发者ID:454053205,项目名称:linux,代码行数:59,代码来源:wm8741.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ snd_soc_component_get_drvdata函数代码示例发布时间:2022-05-30
下一篇:
C++ snd_soc_codec_get_drvdata函数代码示例发布时间: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