ASoC: rt5645: Perform the initial jack detect at probe
authorRudi Heitbaum <rudi@heitbaum.com>
Wed, 5 Aug 2026 15:21:02 +0000 (15:21 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 10 Aug 2026 13:07:22 +0000 (14:07 +0100)
commit54b279699279411c77c8afbc73b83c70740a7303
tree970147add33bd91675274b90820f1ec79a0cb775
parentf7e118fce3878201cb521f67a0df19fdea0bc3a9
ASoC: rt5645: Perform the initial jack detect at probe

The only initial jack detect is the rt5645_irq(0, rt5645) at the end of
rt5645_set_jack_detect(). A card described with simple-audio-card has no
machine driver to call that, so jack state is only ever sampled from an
edge on hp-detect-gpios.

A headphone already in the socket at boot is therefore never noticed, and
the card is silent with every mixer control set correctly.
rt5645_jack_detect() is what force enables the "LDO2" and "Mic Det Power"
supplies that the "HP amp" widget depends on, and what programs
RT5645_CHARGE_PUMP away from its reset value, so without it "HP amp"
cannot power up. Unplugging and replugging the jack is the only way to
recover.

Do the detect at the end of the component probe when the driver owns a
hp-detect GPIO and the codec's own jack detect is unused, which is the
case that has no other trigger. A machine driver calling
rt5645_set_jack_detect() later just repeats it.

Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
Link: https://patch.msgid.link/anNU3tOUR7rOReSB@5e001e58230e
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5645.c