Ejemplo n.º 1
0
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;
}
Ejemplo n.º 2
0
/* power down chip */
static int wm8776_remove(struct snd_soc_codec *codec)
{
	wm8776_set_bias_level(codec, SND_SOC_BIAS_OFF);
	return 0;
}
Ejemplo n.º 3
0
static int wm8776_resume(struct snd_soc_codec *codec)
{
	wm8776_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
	return 0;
}
Ejemplo n.º 4
0
static int wm8776_suspend(struct snd_soc_codec *codec, pm_message_t state)
{
	wm8776_set_bias_level(codec, SND_SOC_BIAS_OFF);

	return 0;
}