aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Hsu <supercraig0719@gmail.com>2017-06-21 23:57:55 -0400
committerMark Brown <broonie@kernel.org>2017-06-23 08:02:17 -0400
commit2bda4288e771e51946e70329c9b79605e4612f10 (patch)
treef537464046f983c96731a1a2378fd6d4e4ad4e5a
parent8fe19795da1b9dea2353f016622842a2f163039e (diff)
ASoC: nau8825: make crosstalk function optional
Make crosstalk functoin optional. The jack detection can speed up without crosstalk detection. Let the decision of function usage to platform design. The patch helps the issue concern as follows: Google issue 35574278: Chell_headphone pop back from S3 There is a concern as follows: cras getting blocked for 2 seconds (worst-case 3 seconds) As I understand, ChromeOS expects resume finishes in 1 seconds. Video/Audio playing after 3 seconds of resume seems against the spec. If we really have to make the choice I would choose pop noise instead of waiting for 3 seconds. Signed-off-by: John Hsu <KCHSU0@nuvoton.com> Signed-off-by: John Hsu <supercraig0719@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/nau8825.c6
-rw-r--r--sound/soc/codecs/nau8825.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index 503a6d8130b7..a8c7a556a6a8 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -1686,7 +1686,7 @@ static irqreturn_t nau8825_interrupt(int irq, void *data)
1686 } else if (active_irq & NAU8825_HEADSET_COMPLETION_IRQ) { 1686 } else if (active_irq & NAU8825_HEADSET_COMPLETION_IRQ) {
1687 if (nau8825_is_jack_inserted(regmap)) { 1687 if (nau8825_is_jack_inserted(regmap)) {
1688 event |= nau8825_jack_insert(nau8825); 1688 event |= nau8825_jack_insert(nau8825);
1689 if (!nau8825->high_imped) { 1689 if (!nau8825->xtalk_bypass && !nau8825->high_imped) {
1690 /* Apply the cross talk suppression in the 1690 /* Apply the cross talk suppression in the
1691 * headset without high impedance. 1691 * headset without high impedance.
1692 */ 1692 */
@@ -2504,6 +2504,10 @@ static int nau8825_read_device_properties(struct device *dev,
2504 &nau8825->jack_eject_debounce); 2504 &nau8825->jack_eject_debounce);
2505 if (ret) 2505 if (ret)
2506 nau8825->jack_eject_debounce = 0; 2506 nau8825->jack_eject_debounce = 0;
2507 ret = device_property_read_u32(dev, "nuvoton,crosstalk-bypass",
2508 &nau8825->xtalk_bypass);
2509 if (ret)
2510 nau8825->xtalk_bypass = 1;
2507 2511
2508 nau8825->mclk = devm_clk_get(dev, "mclk"); 2512 nau8825->mclk = devm_clk_get(dev, "mclk");
2509 if (PTR_ERR(nau8825->mclk) == -EPROBE_DEFER) { 2513 if (PTR_ERR(nau8825->mclk) == -EPROBE_DEFER) {
diff --git a/sound/soc/codecs/nau8825.h b/sound/soc/codecs/nau8825.h
index 514fd13c2f46..8aee5c8647ae 100644
--- a/sound/soc/codecs/nau8825.h
+++ b/sound/soc/codecs/nau8825.h
@@ -476,6 +476,7 @@ struct nau8825 {
476 int xtalk_event_mask; 476 int xtalk_event_mask;
477 bool xtalk_protect; 477 bool xtalk_protect;
478 int imp_rms[NAU8825_XTALK_IMM]; 478 int imp_rms[NAU8825_XTALK_IMM];
479 int xtalk_bypass;
479}; 480};
480 481
481int nau8825_enable_jack_detect(struct snd_soc_codec *codec, 482int nau8825_enable_jack_detect(struct snd_soc_codec *codec,