All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Oder Chiou <oder_chiou@realtek.com>, Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org
Subject: Applied "ASoC: rt5645: Modify the jack detection function to prevent the pop sound while the jack plug in" to the asoc tree
Date: Tue, 25 Aug 2015 19:13:10 +0100	[thread overview]
Message-ID: <E1ZUIic-0006CI-R7@debutante> (raw)
In-Reply-To: <1440419579-9970-3-git-send-email-oder_chiou@realtek.com>

The patch

   ASoC: rt5645: Modify the jack detection function to prevent the pop sound while the jack plug in

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 8db7f56ddf2c4571e33756b70a1a8f492c050449 Mon Sep 17 00:00:00 2001
From: Oder Chiou <oder_chiou@realtek.com>
Date: Mon, 24 Aug 2015 20:32:57 +0800
Subject: [PATCH] ASoC: rt5645: Modify the jack detection function to prevent
 the pop sound while the jack plug in

The patch corrects the sequence of the jack detection. It will prevent the
pop sound while the jack plug in.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/rt5645.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index ac2f42f4e3a0..bcb44de002c9 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -2805,14 +2805,15 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert)
 		}
 
 		regmap_write(rt5645->regmap, RT5645_JD_CTRL3, 0x00f0);
-		regmap_write(rt5645->regmap, RT5645_IN1_CTRL1, 0x0006);
 		regmap_update_bits(rt5645->regmap,
 				   RT5645_IN1_CTRL2, 0x1000, 0x1000);
+		regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL1, 0x0004,
+			0x0004);
 		msleep(100);
 		regmap_update_bits(rt5645->regmap,
 				   RT5645_IN1_CTRL2, 0x1000, 0x0000);
 
-		msleep(450);
+		msleep(600);
 		regmap_read(rt5645->regmap, RT5645_IN1_CTRL3, &val);
 		val &= 0x7;
 		dev_dbg(codec->dev, "val = %d\n", val);
@@ -2828,9 +2829,17 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert)
 			rt5645->jack_type = SND_JACK_HEADPHONE;
 		}
 
+		snd_soc_update_bits(codec, RT5645_CHARGE_PUMP, 0x0300, 0x0200);
+		snd_soc_write(codec, RT5645_DEPOP_M1, 0x001d);
+		snd_soc_write(codec, RT5645_DEPOP_M1, 0x0001);
 	} else { /* jack out */
 		rt5645->jack_type = 0;
 
+		regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL2, 0x1000,
+			0x1000);
+		regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL1, 0x0004,
+			0x0000);
+
 		if (rt5645->en_button_func)
 			rt5645_enable_push_button_irq(codec, false);
 
-- 
2.5.0

  reply	other threads:[~2015-08-25 18:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24 12:32 [PATCH 1/5] ASoC: rt5645: Prevent the pop sound of the headphone while rebooting or shutdowning Oder Chiou
2015-08-24 12:32 ` [PATCH 2/5] ASoC: rt5645: Modify the headphone depop and calibration function to prevent the pop sound in the booting time Oder Chiou
2015-08-25 18:13   ` Applied "ASoC: rt5645: Modify the headphone depop and calibration function to prevent the pop sound in the booting time" to the asoc tree Mark Brown
2015-08-24 12:32 ` [PATCH 3/5] ASoC: rt5645: Modify the jack detection function to prevent the pop sound while the jack plug in Oder Chiou
2015-08-25 18:13   ` Mark Brown [this message]
2015-08-24 12:32 ` [PATCH 4/5] ASoC: rt5645: Remove the incorrect setting of the JD mode Oder Chiou
2015-08-25 18:13   ` Applied "ASoC: rt5645: Remove the incorrect setting of the JD mode" to the asoc tree Mark Brown
2015-08-24 12:32 ` [PATCH 5/5] ASoC: rt5645: Add the register RT5645_CHARGE_PUMP to readable check function Oder Chiou
2015-08-25 18:13   ` Applied "ASoC: rt5645: Add the register RT5645_CHARGE_PUMP to readable check function" to the asoc tree Mark Brown
2015-08-25 17:57 ` [PATCH 1/5] ASoC: rt5645: Prevent the pop sound of the headphone while rebooting or shutdowning Mark Brown
2015-08-26  2:17   ` Oder Chiou
2015-08-26 10:51     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1ZUIic-0006CI-R7@debutante \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=oder_chiou@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.