diff options
| -rw-r--r-- | sound/soc/codecs/rt5670.c | 18 | ||||
| -rw-r--r-- | sound/soc/codecs/rt5670.h | 3 |
2 files changed, 21 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) | |||
| 461 | return rt5670->jack_type; | 461 | return rt5670->jack_type; |
| 462 | } | 462 | } |
| 463 | 463 | ||
| 464 | void rt5670_jack_suspend(struct snd_soc_codec *codec) | ||
| 465 | { | ||
| 466 | struct rt5670_priv *rt5670 = snd_soc_codec_get_drvdata(codec); | ||
| 467 | |||
| 468 | rt5670->jack_type_saved = rt5670->jack_type; | ||
| 469 | rt5670_headset_detect(codec, 0); | ||
| 470 | } | ||
| 471 | EXPORT_SYMBOL_GPL(rt5670_jack_suspend); | ||
| 472 | |||
| 473 | void rt5670_jack_resume(struct snd_soc_codec *codec) | ||
| 474 | { | ||
| 475 | struct rt5670_priv *rt5670 = snd_soc_codec_get_drvdata(codec); | ||
| 476 | |||
| 477 | if (rt5670->jack_type_saved) | ||
| 478 | rt5670_headset_detect(codec, 1); | ||
| 479 | } | ||
| 480 | EXPORT_SYMBOL_GPL(rt5670_jack_resume); | ||
| 481 | |||
| 464 | static int rt5670_button_detect(struct snd_soc_codec *codec) | 482 | static int rt5670_button_detect(struct snd_soc_codec *codec) |
| 465 | { | 483 | { |
| 466 | int btn_type, val; | 484 | int btn_type, val; |
diff --git a/sound/soc/codecs/rt5670.h b/sound/soc/codecs/rt5670.h index 0f3255aeeb9b..dc2b46236c5c 100644 --- a/sound/soc/codecs/rt5670.h +++ b/sound/soc/codecs/rt5670.h | |||
| @@ -2004,8 +2004,11 @@ struct rt5670_priv { | |||
| 2004 | int dsp_sw; /* expected parameter setting */ | 2004 | int dsp_sw; /* expected parameter setting */ |
| 2005 | int dsp_rate; | 2005 | int dsp_rate; |
| 2006 | int jack_type; | 2006 | int jack_type; |
| 2007 | int jack_type_saved; | ||
| 2007 | }; | 2008 | }; |
| 2008 | 2009 | ||
| 2010 | void rt5670_jack_suspend(struct snd_soc_codec *codec); | ||
| 2011 | void rt5670_jack_resume(struct snd_soc_codec *codec); | ||
| 2009 | int rt5670_set_jack_detect(struct snd_soc_codec *codec, | 2012 | int rt5670_set_jack_detect(struct snd_soc_codec *codec, |
| 2010 | struct snd_soc_jack *jack); | 2013 | struct snd_soc_jack *jack); |
| 2011 | #endif /* __RT5670_H__ */ | 2014 | #endif /* __RT5670_H__ */ |
