Skip to content
/ linux Public

Commit 717bff1

Browse files
cristiccSasha Levin
authored andcommitted
ASoC: nau8821: Fixup nau8821_enable_jack_detect()
[ Upstream commit 7023785 ] The nau8821_enable_jack_detect() function was supposed to allow enabling or disabling jack events reporting. However, once enabled, any subsequent invocation would fail and the following splat is shown: [ 3136.996771] Hardware name: Valve Jupiter/Jupiter, BIOS F7A0131 01/30/2024 [ 3136.996773] Workqueue: events_unbound deferred_probe_work_func [ 3136.996780] Call Trace: [ 3136.996782] <TASK> [ 3136.996787] dump_stack_lvl+0x6e/0xa0 [ 3136.996796] __setup_irq.cold+0x9c/0xce [ 3136.996803] ? __pfx_irq_default_primary_handler+0x10/0x10 [ 3136.996812] ? __pfx_nau8821_interrupt+0x10/0x10 [snd_soc_nau8821] [ 3136.996825] request_threaded_irq+0xd9/0x160 [ 3136.996853] devm_request_threaded_irq+0x71/0xd0 [ 3136.996859] ? __pfx_nau8821_interrupt+0x10/0x10 [snd_soc_nau8821] [ 3136.996882] nau8821_enable_jack_detect+0xa5/0xc0 [snd_soc_nau8821] [ 3136.996901] acp5x_8821_init+0x8d/0xa0 [snd_soc_acp5x_mach] [ 3136.996917] snd_soc_link_init+0x25/0x50 [snd_soc_core] [ 3136.996958] snd_soc_bind_card+0x615/0xd00 [snd_soc_core] [ 3136.997026] snd_soc_register_card+0x1b2/0x1c0 [snd_soc_core] [ 3136.997064] devm_snd_soc_register_card+0x47/0x90 [snd_soc_core] [ 3136.997108] acp5x_probe+0x72/0xb0 [snd_soc_acp5x_mach] [...] [ 3136.997508] nau8821 i2c-NVTN2020:00: Cannot request irq 58 (-16) Introduce jdet_active flag to driver data structure and use it to provide one-time initialization of the jack detection work queue and related interrupt line. Note this is also a prerequisite for additional fixes around module unloading and suspend handling. Fixes: aab1ad1 ("ASoC: nau8821: new driver") Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Link: https://patch.msgid.link/20251231-nau8821-cleanup-v1-1-6b0b76cbbb64@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ac6e7be commit 717bff1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

sound/soc/codecs/nau8821.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,8 +1539,13 @@ int nau8821_enable_jack_detect(struct snd_soc_component *component,
15391539
int ret;
15401540

15411541
nau8821->jack = jack;
1542+
1543+
if (nau8821->jdet_active)
1544+
return 0;
1545+
15421546
/* Initiate jack detection work queue */
15431547
INIT_DELAYED_WORK(&nau8821->jdet_work, nau8821_jdet_work);
1548+
nau8821->jdet_active = true;
15441549

15451550
ret = devm_request_threaded_irq(nau8821->dev, nau8821->irq, NULL,
15461551
nau8821_interrupt, IRQF_TRIGGER_LOW | IRQF_ONESHOT,

sound/soc/codecs/nau8821.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ struct nau8821 {
513513
struct snd_soc_dapm_context *dapm;
514514
struct snd_soc_jack *jack;
515515
struct delayed_work jdet_work;
516+
bool jdet_active;
516517
int irq;
517518
int clk_id;
518519
int micbias_voltage;

0 commit comments

Comments
 (0)