[PATCH] ASoC: Fix vaud18 power leakage of mt6359
Mark Brown
broonie at kernel.org
Fri Nov 6 07:26:33 EST 2020
On Fri, Nov 06, 2020 at 02:18:37PM +0800, Shane Chien wrote:
> +static int mt_vaud18_event(struct snd_soc_dapm_widget *w,
> + struct snd_kcontrol *kcontrol,
> + int event)
> +{
> + struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
> + struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt);
> + int ret = 0;
> +
> + switch (event) {
> + case SND_SOC_DAPM_PRE_PMU:
> + ret = regulator_enable(priv->avdd_reg);
> + if (ret)
> + dev_err(priv->dev, "regulator_enable err: %d\n", ret);
> + break;
> + case SND_SOC_DAPM_POST_PMD:
> + ret = regulator_disable(priv->avdd_reg);
> + if (ret)
> + dev_err(priv->dev, "regulator_disable err: %d\n", ret);
> + break;
This is just a SND_SOC_DAPM_REGULATOR_SUPPLY widget as far as I can see
- why not use one of those rather than open coding?
-------------- 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-mediatek/attachments/20201106/b04a9ee1/attachment.sig>
More information about the Linux-mediatek
mailing list