mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Shane Chien <shane.chien@mediatek.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	devicetree@vger.kernel.org, wsd_upstream@mediatek.com,
	jiaxin.yu@mediatek.com, chipeng.chang@mediatek.com
Subject: Re: [PATCH] ASoC: Fix vaud18 power leakage of mt6359
Date: Fri, 6 Nov 2020 12:26:33 +0000	[thread overview]
Message-ID: <20201106122633.GD49612@sirena.org.uk> (raw)
In-Reply-To: <1604643517-3527-1-git-send-email-shane.chien@mediatek.com>

[-- Attachment #1: Type: text/plain, Size: 827 bytes --]

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?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2020-11-06 12:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06  6:18 Shane Chien
2020-11-06 12:26 ` Mark Brown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201106122633.GD49612@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=chipeng.chang@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jiaxin.yu@mediatek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=shane.chien@mediatek.com \
    --cc=wsd_upstream@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®