aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJie Yang <yang.jie@intel.com>2015-02-10 04:01:56 -0500
committerMark Brown <broonie@kernel.org>2015-02-24 10:06:12 -0500
commite2cef68d5903cc2052e9f6e46b323b7ead695e73 (patch)
treed8594e2216e605f7dc0f8f79e7b1cdd4f31257c1
parentc517d838eb7d07bbe9507871fab3931deccff539 (diff)
ASoC: rt286: add jack detection disable with NULL jack passed
Some platforms, e.g. WSB, don't need jack detection when system is in Suspend, for power save reason. Here add headphone/mic jack detection disable feature with NULL jack passed in, when disabled, it will disable interrupt, and disable LDO1, which is used for jack detection when headphone is plugged in. Signed-off-by: Jie Yang <yang.jie@intel.com> Reviewed-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/rt286.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c
index f374840a5a7c..16723b167fbf 100644
--- a/sound/soc/codecs/rt286.c
+++ b/sound/soc/codecs/rt286.c
@@ -395,9 +395,20 @@ int rt286_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack)
395 395
396 rt286->jack = jack; 396 rt286->jack = jack;
397 397
398 /* Send an initial empty report */ 398 if (jack) {
399 snd_soc_jack_report(rt286->jack, 0, 399 /* enable IRQ */
400 SND_JACK_MICROPHONE | SND_JACK_HEADPHONE); 400 if (rt286->jack->status | SND_JACK_HEADPHONE)
401 snd_soc_dapm_force_enable_pin(&codec->dapm, "LDO1");
402 regmap_update_bits(rt286->regmap, RT286_IRQ_CTRL, 0x2, 0x2);
403 /* Send an initial empty report */
404 snd_soc_jack_report(rt286->jack, rt286->jack->status,
405 SND_JACK_MICROPHONE | SND_JACK_HEADPHONE);
406 } else {
407 /* disable IRQ */
408 regmap_update_bits(rt286->regmap, RT286_IRQ_CTRL, 0x2, 0x0);
409 snd_soc_dapm_disable_pin(&codec->dapm, "LDO1");
410 }
411 snd_soc_dapm_sync(&codec->dapm);
401 412
402 return 0; 413 return 0;
403} 414}