mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: ts3a227e: Check and report jack status at probe
@ 2015-01-05 11:26 Cheng-Yi Chiang
  2015-01-05 15:29 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Cheng-Yi Chiang @ 2015-01-05 11:26 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Dylan Reid, Cheng-Yi Chiang, alsa-devel, linux-kernel

ts3a227e does not trigger interrupt to report jack status when system
boots from warm reset because ts3a227e's power remains on during warm reset.
Read jack status at probe to get current jack status.
Note that if system boots from EC reset, then this issue will not
happen.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
---
 sound/soc/codecs/ts3a227e.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/soc/codecs/ts3a227e.c b/sound/soc/codecs/ts3a227e.c
index 1d12057..9f2dced 100644
--- a/sound/soc/codecs/ts3a227e.c
+++ b/sound/soc/codecs/ts3a227e.c
@@ -254,6 +254,7 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c,
 	struct ts3a227e *ts3a227e;
 	struct device *dev = &i2c->dev;
 	int ret;
+	unsigned int acc_reg;
 
 	ts3a227e = devm_kzalloc(&i2c->dev, sizeof(*ts3a227e), GFP_KERNEL);
 	if (ts3a227e == NULL)
@@ -283,6 +284,11 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c,
 			   INTB_DISABLE | ADC_COMPLETE_INT_DISABLE,
 			   ADC_COMPLETE_INT_DISABLE);
 
+	/* Read jack status because chip might not trigger interrupt at boot. */
+	regmap_read(ts3a227e->regmap, TS3A227E_REG_ACCESSORY_STATUS, &acc_reg);
+	ts3a227e_new_jack_state(ts3a227e, acc_reg);
+	ts3a227e_jack_report(ts3a227e);
+
 	return 0;
 }
 
-- 
2.1.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: ts3a227e: Check and report jack status at probe
  2015-01-05 11:26 [PATCH] ASoC: ts3a227e: Check and report jack status at probe Cheng-Yi Chiang
@ 2015-01-05 15:29 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2015-01-05 15:29 UTC (permalink / raw)
  To: Cheng-Yi Chiang
  Cc: linux-arm-kernel, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Dylan Reid, alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 368 bytes --]

On Mon, Jan 05, 2015 at 07:26:59PM +0800, Cheng-Yi Chiang wrote:
> ts3a227e does not trigger interrupt to report jack status when system
> boots from warm reset because ts3a227e's power remains on during warm reset.
> Read jack status at probe to get current jack status.
> Note that if system boots from EC reset, then this issue will not
> happen.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-05 15:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-05 11:26 [PATCH] ASoC: ts3a227e: Check and report jack status at probe Cheng-Yi Chiang
2015-01-05 15:29 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®