static int ssm2602_resume(struct snd_soc_codec *codec)
{
	snd_soc_cache_sync(codec);

	ssm2602_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

	return 0;
}
Exemple #2
0
static int ssm260x_probe(struct snd_soc_codec *codec)
{
	struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec);
	int ret;

	pr_info("ssm2602 Audio Codec %s", SSM2602_VERSION);

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

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

	/* set the update bits */
	snd_soc_update_bits(codec, SSM2602_LINVOL,
			    LINVOL_LRIN_BOTH, LINVOL_LRIN_BOTH);
	snd_soc_update_bits(codec, SSM2602_RINVOL,
			    RINVOL_RLIN_BOTH, RINVOL_RLIN_BOTH);
	/*select Line in as default input*/
	snd_soc_write(codec, SSM2602_APANA, APANA_SELECT_DAC |
			APANA_ENABLE_MIC_BOOST);

	switch (ssm2602->type) {
	case SSM2602:
		ret = ssm2602_probe(codec);
		break;
	case SSM2604:
		ret = ssm2604_probe(codec);
		break;
	}

	if (ret)
		return ret;

	ssm2602_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

	return 0;
}
/* remove everything here */
static int ssm2602_remove(struct snd_soc_codec *codec)
{
	ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF);
	return 0;
}
Exemple #4
0
static int ssm2602_suspend(struct snd_soc_codec *codec, pm_message_t state)
{
	ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF);
	return 0;
}