linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: rt5645: Fixed buddy jack support.
@ 2019-11-11 18:59 Jacob Rasmussen
  2019-11-11 19:37 ` Ross Zwisler
  2019-11-11 19:44 ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Jacob Rasmussen @ 2019-11-11 18:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jacob Rasmussen, Bard Liao, Jaroslav Kysela, Liam Girdwood,
	Mark Brown, Oder Chiou, Takashi Iwai, alsa-devel, Ross Zwisler

The headphone jack on buddy was broken with the following commit:
commit 6b5da66322c5 ("ASoC: rt5645: read jd1_1 status for jd
detection").
This changes the jd_mode for buddy to 4 so buddy can read from the same
register that was used in the working version of this driver without
affecting any other devices that might use this, since no other device uses
jd_mode = 4. To test this I plugged and uplugged the headphone jack, verifying
audio works.

Signed-off-by: Jacob Rasmussen <jacobraz@google.com>
---
 sound/soc/codecs/rt5645.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index a15e4ecd2a24..046f339a9f00 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3270,6 +3270,9 @@ static void rt5645_jack_detect_work(struct work_struct *work)
 		snd_soc_jack_report(rt5645->mic_jack,
 				    report, SND_JACK_MICROPHONE);
 		return;
+	case 4:
+		val = snd_soc_component_read32(rt5645->component, RT5645_A_JD_CTRL1) & 0x002;
+		break;
 	default: /* read rt5645 jd1_1 status */
 		val = snd_soc_component_read32(rt5645->component, RT5645_INT_IRQ_ST) & 0x1000;
 		break;
@@ -3603,7 +3606,7 @@ static const struct rt5645_platform_data intel_braswell_platform_data = {
 static const struct rt5645_platform_data buddy_platform_data = {
 	.dmic1_data_pin = RT5645_DMIC_DATA_GPIO5,
 	.dmic2_data_pin = RT5645_DMIC_DATA_IN2P,
-	.jd_mode = 3,
+	.jd_mode = 4,
 	.level_trigger_irq = true,
 };
 
@@ -4012,6 +4015,7 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
 					   RT5645_JD1_MODE_1);
 			break;
 		case 3:
+		case 4:
 			regmap_update_bits(rt5645->regmap, RT5645_A_JD_CTRL1,
 					   RT5645_JD1_MODE_MASK,
 					   RT5645_JD1_MODE_2);
-- 
2.24.0.432.g9d3f5f5b63-goog


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

* Re: [PATCH] ASoC: rt5645: Fixed buddy jack support.
  2019-11-11 18:59 [PATCH] ASoC: rt5645: Fixed buddy jack support Jacob Rasmussen
@ 2019-11-11 19:37 ` Ross Zwisler
  2019-11-11 19:44 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Ross Zwisler @ 2019-11-11 19:37 UTC (permalink / raw)
  To: Jacob Rasmussen
  Cc: linux-kernel, Jacob Rasmussen, Bard Liao, Jaroslav Kysela,
	Liam Girdwood, Mark Brown, Oder Chiou, Takashi Iwai, alsa-devel

On Mon, Nov 11, 2019 at 11:59:57AM -0700, Jacob Rasmussen wrote:
> The headphone jack on buddy was broken with the following commit:
> commit 6b5da66322c5 ("ASoC: rt5645: read jd1_1 status for jd
> detection").
> This changes the jd_mode for buddy to 4 so buddy can read from the same
> register that was used in the working version of this driver without
> affecting any other devices that might use this, since no other device uses
> jd_mode = 4. To test this I plugged and uplugged the headphone jack, verifying
> audio works.
> 
> Signed-off-by: Jacob Rasmussen <jacobraz@google.com>

Reviewed-by: Ross Zwisler <zwisler@google.com>

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

* Re: [PATCH] ASoC: rt5645: Fixed buddy jack support.
  2019-11-11 18:59 [PATCH] ASoC: rt5645: Fixed buddy jack support Jacob Rasmussen
  2019-11-11 19:37 ` Ross Zwisler
@ 2019-11-11 19:44 ` Mark Brown
  2019-11-11 19:49   ` Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2019-11-11 19:44 UTC (permalink / raw)
  To: Jacob Rasmussen
  Cc: linux-kernel, Jacob Rasmussen, Bard Liao, Jaroslav Kysela,
	Liam Girdwood, Oder Chiou, Takashi Iwai, alsa-devel,
	Ross Zwisler

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

On Mon, Nov 11, 2019 at 11:59:57AM -0700, Jacob Rasmussen wrote:
> The headphone jack on buddy was broken with the following commit:
> commit 6b5da66322c5 ("ASoC: rt5645: read jd1_1 status for jd
> detection").

This commit has been in mainline for a while but this doesn't apply
against my fixes branch, I'll apply against -next but it'll need some
work backporting to make it back as a fix.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] ASoC: rt5645: Fixed buddy jack support.
  2019-11-11 19:44 ` Mark Brown
@ 2019-11-11 19:49   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2019-11-11 19:49 UTC (permalink / raw)
  To: Jacob Rasmussen
  Cc: linux-kernel, Jacob Rasmussen, Bard Liao, Jaroslav Kysela,
	Liam Girdwood, Oder Chiou, Takashi Iwai, alsa-devel,
	Ross Zwisler

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

On Mon, Nov 11, 2019 at 07:44:27PM +0000, Mark Brown wrote:
> On Mon, Nov 11, 2019 at 11:59:57AM -0700, Jacob Rasmussen wrote:
> > The headphone jack on buddy was broken with the following commit:
> > commit 6b5da66322c5 ("ASoC: rt5645: read jd1_1 status for jd
> > detection").

> This commit has been in mainline for a while but this doesn't apply
> against my fixes branch, I'll apply against -next but it'll need some
> work backporting to make it back as a fix.

Sorry, the issue with applying wasn't due to conflicts - I've applied as
a fix now.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2019-11-11 19:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-11 18:59 [PATCH] ASoC: rt5645: Fixed buddy jack support Jacob Rasmussen
2019-11-11 19:37 ` Ross Zwisler
2019-11-11 19:44 ` Mark Brown
2019-11-11 19:49   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).