Exemple #1
0
static int ak5702_resume(struct platform_device *pdev)
{
	struct snd_soc_device *socdev = platform_get_drvdata(pdev);
	struct snd_soc_codec *codec = socdev->card->codec;
	int i;

	/* Bring the codec back up to standby first to minimise pop/clicks */
	ak5702_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
	ak5702_set_bias_level(codec, codec->suspend_bias_level);

	/* Sync back everything else */
	for (i = 0; i < ARRAY_SIZE(ak5702_reg); i++)
		ak5702_write(codec, i, ak5702_reg[i]);

	return 0;
}
Exemple #2
0
static int ak5702_suspend(struct platform_device *pdev, pm_message_t state)
{
	struct snd_soc_device *socdev = platform_get_drvdata(pdev);
	struct snd_soc_codec *codec = socdev->card->codec;

	ak5702_set_bias_level(codec, SND_SOC_BIAS_OFF);
	return 0;
}
Exemple #3
0
static int ak5702_remove(struct platform_device *pdev)
{
	struct snd_soc_device *socdev = platform_get_drvdata(pdev);
	struct snd_soc_codec *codec = socdev->card->codec;

	if (codec->control_data)
		ak5702_set_bias_level(codec, SND_SOC_BIAS_OFF);

	snd_soc_free_pcms(socdev);
	snd_soc_dapm_free(socdev);
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
	i2c_del_driver(&ak5702_i2c_driver);
#endif
	return 0;
}