diff options
author | Bard Liao <bardliao@realtek.com> | 2015-03-11 11:42:45 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-03-11 12:08:20 +0000 |
commit | cc3c340d28b9f730fdc6bc5caa77e3bbd1e2377c (patch) | |
tree | be20715854692094a08a2b1af955505117357571 /sound/soc/codecs/rt5670.c | |
parent | d3ef70543429b754dacc87fc68c30c2c34502337 (diff) |
ASoC: rt5670: export jack suspend/resume APIs
We force enable "Mic Det Power" when a jack is inserted. Also, we
set codec idle_bias_off = true. As a result, codec driver will not
suspend as we expect.
On Braswell, we don't need the jack detection when suspend but need
it after resume, so export the jack suspend/resume APIs which are
provided for machine driver to control during suspend/resume.
Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5670.c')
-rw-r--r-- | sound/soc/codecs/rt5670.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5670.c b/sound/soc/codecs/rt5670.c index a900db5fb1d9..91d2069a9313 100644 --- a/sound/soc/codecs/rt5670.c +++ b/sound/soc/codecs/rt5670.c @@ -461,6 +461,24 @@ static int rt5670_headset_detect(struct snd_soc_codec *codec, int jack_insert) return rt5670->jack_type; } +void rt5670_jack_suspend(struct snd_soc_codec *codec) +{ + struct rt5670_priv *rt5670 = snd_soc_codec_get_drvdata(codec); + + rt5670->jack_type_saved = rt5670->jack_type; + rt5670_headset_detect(codec, 0); +} +EXPORT_SYMBOL_GPL(rt5670_jack_suspend); + +void rt5670_jack_resume(struct snd_soc_codec *codec) +{ + struct rt5670_priv *rt5670 = snd_soc_codec_get_drvdata(codec); + + if (rt5670->jack_type_saved) + rt5670_headset_detect(codec, 1); +} +EXPORT_SYMBOL_GPL(rt5670_jack_resume); + static int rt5670_button_detect(struct snd_soc_codec *codec) { int btn_type, val; |