[alsa-devel] [PATCH] ASoC: rt298: Add jack suspend and resume functions.

Mark Brown broonie at kernel.org
Mon Jun 13 16:09:23 CEST 2016


On Mon, Jun 13, 2016 at 08:28:39PM +0800, Bard Liao wrote:

> +void rt298_jack_suspend(struct snd_soc_codec *codec)
> +{
> +	struct rt298_priv *rt298 = snd_soc_codec_get_drvdata(codec);
> +	struct snd_soc_dapm_context *dapm;
> +
> +	dapm = snd_soc_codec_get_dapm(rt298->codec);
> +	snd_soc_dapm_disable_pin(dapm, "LDO1");
> +	snd_soc_dapm_sync(dapm);
> +}
> +EXPORT_SYMBOL_GPL(rt298_jack_suspend);
> +
> +void rt298_jack_resume(struct snd_soc_codec *codec)
> +{
> +	struct rt298_priv *rt298 = snd_soc_codec_get_drvdata(codec);
> +	bool hp = false;
> +	bool mic = false;
> +
> +	rt298_jack_detect(rt298, &hp, &mic);
> +}
> +EXPORT_SYMBOL_GPL(rt298_jack_resume);

This is usually done by having the _jack_detect() function take NULL as
the jack to disable the detection.  Keeping in line with the existing
pattern would be good, and would make it easier if we do start to get
this more standardized.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20160613/23733d60/attachment.sig>


More information about the Alsa-devel mailing list