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

Chancel Liu (OSS) chancel.liu at oss.nxp.com
Tue May 26 20:05:55 PDT 2026


> > 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.
> 

Yes. I will update the Kconfig to ensure this dependency.

> > +	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.

Agreed. Deferred probe was not considered here. I will move jack setup to
late_probe().

Regards, 
Chancel Liu



More information about the linux-arm-kernel mailing list