[PATCH 02/12] ASoC: codecs: wm8962: Implement set_jack callback
From: Amadeusz Sławiński
Date: Mon Oct 26 2026 - 16:22:56 EST
Add set_jack callback to the component driver so machine drivers
can use the standard snd_soc_component_set_jack() API instead of
the driver-specific wm8962_mic_detect() helper.
Signed-off-by: Amadeusz Sławiński <amade@xxxxxxxxxx>
---
sound/soc/codecs/wm8962.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index db8b86d522ff..b36e73fabbdd 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3601,9 +3601,16 @@ static void wm8962_remove(struct snd_soc_component *component)
wm8962_free_beep(component);
}
+static int wm8962_set_jack(struct snd_soc_component *component,
+ struct snd_soc_jack *jack, void *data)
+{
+ return wm8962_mic_detect(component, jack);
+}
+
static const struct snd_soc_component_driver soc_component_dev_wm8962 = {
.probe = wm8962_probe,
.remove = wm8962_remove,
+ .set_jack = wm8962_set_jack,
.set_bias_level = wm8962_set_bias_level,
.set_pll = wm8962_set_fll,
.use_pmdown_time = 1,
--
2.56.0