[PATCH 0/4] ASoC: codecs: pm4125: Enable MBHC jack detection

From: Mohammad Rafi Shaik

Date: Thu Oct 15 2026 - 10:15:14 EST


The pm4125 codec registers with the WCD MBHC framework, but it only
provides the electrical bias and button threshold callbacks and leaves the
rest of struct wcd_mbhc_cb empty. The framework can fall back to driving
some of the shared register fields itself, but it has no fallback for the
ones that control hardware it cannot describe generically, so ADC based
plug type detection runs without the MBHC RCO clock, without a micbias
ramp and without the headset ground detection comparator, and never gets a
usable ADC reading. On top of that, the one threshold path that does exist
programs the register wrongly, and a reference counting bug in the micbias
code turns a jack insertion during playback into silence.

This series fixes those issues and fills in the missing callbacks so a
3.5mm jack can be detected, together with the binding needed to describe
one.

Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@xxxxxxxxxxxxxxxx>

---
Mohammad Rafi Shaik (4):
ASoC: dt-bindings: qcom,pm4125-codec: Add the MBHC jack properties
ASoC: codecs: pm4125: Fix MBHC button threshold programming
ASoC: codecs: pm4125: Keep the micbias reference count balanced
ASoC: codecs: pm4125: Add the MBHC callbacks needed for jack detection

.../bindings/sound/qcom,pm4125-codec.yaml | 18 ++
sound/soc/codecs/pm4125.c | 206 ++++++++++++++++++++-
sound/soc/codecs/pm4125.h | 13 ++
3 files changed, 233 insertions(+), 4 deletions(-)
---
base-commit: 686b3eff603871bd500434e00ff15394a0c782bc
change-id: 20261015-pm4125_mbhc_support-42fbbccd2b51

Best regards,
--
Mohammad Rafi Shaik <mohammad.rafi.shaik@xxxxxxxxxxxxxxxx>