[PATCH 4/4] ASoC: audio-graph-card2: Free jack GPIOs on card remove

From: Chancel Liu

Date: Sun Sep 13 2026 - 06:26:40 EST


From: Chancel Liu <chancel.liu@xxxxxxx>

audio-graph-card2 uses graph_util_card_probe() to set up the headphone
and microphone jacks, but never released them again, so the jack GPIO,
its IRQ, the PM notifier, the delayed work and the sysfs export stayed
claimed when the card was unbound. Re-binding the card alone - for
instance after a codec component is unbound and bound again - then made
graph_util_card_probe() fail with -EBUSY and the card was never
registered again.

Hook up the graph_util_card_remove() counterpart added for
audio-graph-card.

Signed-off-by: Chancel Liu <chancel.liu@xxxxxxx>
---
sound/soc/generic/audio-graph-card2.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index 9fb3d3df5cf6..e11bc8135cb0 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -1310,6 +1310,7 @@ int audio_graph2_parse_of(struct simple_util_priv *priv, struct device *dev,
goto end;

card->probe = graph_util_card_probe;
+ card->remove = graph_util_card_remove;
card->owner = THIS_MODULE;
card->dev = dev;

--
2.50.1