[PATCH 2/3] ASoC: imx-rpmsg: Support headphone jack detection

Mark Brown broonie at kernel.org
Tue May 26 08:34:39 PDT 2026


On Tue, May 26, 2026 at 02:38:14PM +0900, Chancel Liu wrote:
> Add headphone jack detection support for i.MX RPMSG audio cards.
> When the "hp-det-gpios" property is present in the device tree node,
> use simple_util_init_jack() from the ASoC simple card utilities to
> register a headphone jack with GPIO-based insertion detection.

> +#include <sound/simple_card_utils.h>

We need to ensure that SND_SIMPLE_CARD_UTILS is selected.

> +	if (of_property_present(np, "hp-det-gpios")) {
> +		ret = simple_util_init_jack(&data->card, &data->hp_jack,
> +					    1, NULL, "Headphone Jack");
> +		if (ret)
> +			goto fail;
> +	}
>  fail:

The interaction with deferred probe is a bit fun here, we're doing this
after registering the card which might defer via unbind_card_list now.
late_probe() might be safer, everything should be mostly up by then.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260526/c867a88f/attachment-0001.sig>


More information about the linux-arm-kernel mailing list