* [PATCH] ASoC: rt766: trigger JD when system reboots
@ 2026-10-07 9:25 shumingf
2026-10-07 10:47 ` Mark Brown
2026-10-07 15:26 ` Mark Brown
0 siblings, 2 replies; 4+ messages in thread
From: shumingf @ 2026-10-07 9:25 UTC (permalink / raw)
To: broonie, lgirdwood
Cc: linux-sound, lars, flove, oder_chiou, jack.yu, derek.fang,
Shuming Fan
From: Shuming Fan <shumingf@realtek.com>
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.
Signed-off-by: Shuming Fan <shumingf@realtek.com>
---
sound/soc/codecs/rt766-sdca.c | 8 +++++++-
sound/soc/codecs/rt766-sdca.h | 1 +
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/rt766-sdca.c b/sound/soc/codecs/rt766-sdca.c
index 28b4118e05c9..2e891b99dc27 100644
--- a/sound/soc/codecs/rt766-sdca.c
+++ b/sound/soc/codecs/rt766-sdca.c
@@ -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);
diff --git a/sound/soc/codecs/rt766-sdca.h b/sound/soc/codecs/rt766-sdca.h
index de4064007eb9..61af5e9c077a 100644
--- a/sound/soc/codecs/rt766-sdca.h
+++ b/sound/soc/codecs/rt766-sdca.h
@@ -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
--
2.55.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] ASoC: rt766: trigger JD when system reboots
2026-10-07 9:25 [PATCH] ASoC: rt766: trigger JD when system reboots shumingf
@ 2026-10-07 10:47 ` Mark Brown
2026-10-07 11:03 ` Shuming [范書銘]
2026-10-07 15:26 ` Mark Brown
1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2026-10-07 10:47 UTC (permalink / raw)
To: shumingf
Cc: lgirdwood, linux-sound, lars, flove, oder_chiou, jack.yu,
derek.fang
[-- Attachment #1: Type: text/plain, Size: 400 bytes --]
On Wed, Oct 07, 2026 at 05:25:24PM +0800, shumingf@realtek.com wrote:
> From: Shuming Fan <shumingf@realtek.com>
>
> 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?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] ASoC: rt766: trigger JD when system reboots
2026-10-07 10:47 ` Mark Brown
@ 2026-10-07 11:03 ` Shuming [范書銘]
0 siblings, 0 replies; 4+ messages in thread
From: Shuming [范書銘] @ 2026-10-07 11:03 UTC (permalink / raw)
To: Mark Brown
Cc: lgirdwood@gmail.com, linux-sound@vger.kernel.org, lars@metafoo.de,
Flove(HsinFu), Oder Chiou, Jack Yu,
Derek [方德義]
> On Wed, Oct 07, 2026 at 05:25:24PM +0800, shumingf@realtek.com wrote:
> > From: Shuming Fan <shumingf@realtek.com>
> >
> > 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: rt766: trigger JD when system reboots
2026-10-07 9:25 [PATCH] ASoC: rt766: trigger JD when system reboots shumingf
2026-10-07 10:47 ` Mark Brown
@ 2026-10-07 15:26 ` Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2026-10-07 15:26 UTC (permalink / raw)
To: lgirdwood, shumingf
Cc: linux-sound, lars, flove, oder_chiou, jack.yu, derek.fang
On Wed, 07 Oct 2026 17:25:24 +0800, shumingf@realtek.com 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-10-08 7:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-07 9:25 [PATCH] ASoC: rt766: trigger JD when system reboots shumingf
2026-10-07 10:47 ` Mark Brown
2026-10-07 11:03 ` Shuming [范書銘]
2026-10-07 15:26 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox