Skip to contentSkip to conversation

ASoC: rt766: trigger JD when system reboots

PATCH In review [email protected] 2 participants 4 messages Oct 7 – Oct 8

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: rt766: trigger JD when system reboots

From: Shuming Fan <[email protected]>

The initial jack detection at boot time may be missed after a warm reboot if the blind writes are not reloaded.

This patch triggers jack detection from the .set_jack callback to ensure that the jack status is updated after a system reboot.

---
 sound/soc/codecs/rt766-sdca.c | 8 +++++++-
 sound/soc/codecs/rt766-sdca.h | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)
sound/soc/codecs/rt766-sdca.c +7 -1
index 28b4118e05c9..2e891b99dc27 100644
@@ -176,8 +176,11 @@ static irqreturn_t rt766_sdca_irq_jd_handler(int irq, void *data)
 	if (!rt766->hs_jack)
 		return IRQ_HANDLED;
 
-	if (!rt766->component->card || !rt766->component->card->instantiated)
+	if (!rt766->component->card || !rt766->component->card->instantiated) {
+		/* trigger again if card is not instantiated */
+		regmap_write(rt766->regmap, RT766_GE_DET_IRQ_MNL, 0x01);
 		return IRQ_HANDLED;
+	}
 
 	mutex_lock(&rt766->disable_irq_lock);
 	if (!rt766->disable_irq)
@@ -304,6 +307,9 @@ static int rt766_sdca_set_jack_detect(struct snd_soc_component *component,
 		if (rt766->hid_func_data)
 			rt766_sdca_irq_ctl(rt766, rt766->hid_func_data,
 				rt766->component, rt766->irq_info, false);
+	} else {
+		/* trigger GE interrupt */
+		regmap_write(rt766->regmap, RT766_GE_DET_IRQ_MNL, 0x01);
 	}
 
 	pm_runtime_put_autosuspend(component->dev);
sound/soc/codecs/rt766-sdca.h +1 -0
index de4064007eb9..61af5e9c077a 100644
@@ -50,6 +50,7 @@ struct  rt766_sdca_priv {
 #define RT766_DEV_ID1		0xc405
 #define RT766_DEV_ID0		0xc406
 #define RT766_BOND_LATCH_ID	0xc407
+#define RT766_GE_DET_IRQ_MNL	0xd203
 
 #define RT766_HP_POWER_STATE		0x1000004
 #define RT766_HP_FSM_CTL2_1		0x100000d
Signature · 1 line
2.55.0
maintainer
#1 lore raw
Quoted 4 lines · On Wed, Oct 07, 2026 at 05:25:24PM +0800, [email protected] wrote:

From: Shuming Fan <[email protected]>

The initial jack detection at boot time may be missed after a warm reboot if the blind writes are not reloaded.

How does this happen - this feels like it's masking the failure to resume properly after a warm reboot and there's more that needs to be set up in that case?

#2 lore raw
Quoted 9 lines · On Wed, Oct 07, 2026 at 05:25:24PM +0800, [email protected] wrote:
Quoted 4 lines

From: Shuming Fan <[email protected]>

The initial jack detection at boot time may be missed after a warm reboot if the blind writes are not reloaded.

How does this happen - this feels like it's masking the failure to resume properly after a warm reboot and there's more that needs to be set up in that case?

The blind write also includes a trigger command to trigger JD.
Therefore, this issue does not occur before merging the "ASoC: rt766: avoid re-initialize the blind write" patch. The issue only occurs when the system does not detect that the jack is already plugged in during warm reboot. If the user plugs or unplugs the jack afterward, the JD interrupt still works normally.

maintainer
#3 lore raw
In reply to [email protected]
Quoted 1 line · On Wed, 07 Oct 2026 17:25:24 +0800, [email protected] wrote:

ASoC: rt766: trigger JD when system reboots

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4

Thanks!

[1/1] ASoC: rt766: trigger JD when system reboots

      https://git.kernel.org/broonie/sound/c/e8f30155e96a

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