From: Mark Brown <broonie@kernel.org>
To: Dan Murphy <dmurphy@ti.com>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
alsa-devel@alsa-project.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v7] ASoC: tas2552: Support TI TAS2552 Amplifier
Date: Thu, 17 Jul 2014 17:58:16 +0100 [thread overview]
Message-ID: <20140717165816.GA17528@sirena.org.uk> (raw)
In-Reply-To: <1405368645-4168-1-git-send-email-dmurphy@ti.com>
[-- Attachment #1: Type: text/plain, Size: 1572 bytes --]
On Mon, Jul 14, 2014 at 03:10:45PM -0500, Dan Murphy wrote:
There's a few smallish issues below but this is basically good so I've
applied it, please send incremental fixed for the things below.
> + /* Turn on Class D amplifier */
> + snd_soc_update_bits(codec, TAS2552_CFG_2, TAS2552_CLASSD_EN_MASK,
> + TAS2552_CLASSD_EN);
> +
Why is this being done in hw_params() and not using DAPM?
> +static int tas2552_runtime_suspend(struct device *dev)
> +{
> + struct tas2552_data *tas2552 = dev_get_drvdata(dev);
> +
> + tas2552_sw_shutdown(tas2552, 0);
> +
> + if (tas2552->enable_gpio)
> + gpiod_set_value(tas2552->enable_gpio, 0);
> +
> + regcache_cache_only(tas2552->regmap, true);
> + regcache_mark_dirty(tas2552->regmap);
It's better to do the GPIO set after making the device cache only in
order to be sure nothing can come in and try to use the register map
between the two.
> +static void tas2552_shutdown(struct snd_pcm_substream *substream,
> + struct snd_soc_dai *dai)
> +{
> + struct snd_soc_codec *codec = dai->codec;
> +
> + snd_soc_update_bits(codec, TAS2552_CFG_2, TAS2552_PLL_ENABLE, 0);
> +}
I'd also expect the PLL power to be managed via DAPM.
> + ret = pm_runtime_get_sync(codec->dev);
> + if (ret < 0) {
> + dev_err(codec->dev, "Enabling device failed: %d\n",
> + ret);
> + goto probe_fail;
> + }
There's no matching put for this in remove().
> + snd_soc_write(codec, TAS2552_CFG_2, TAS2552_CLASSD_EN |
> + TAS2552_BOOST_EN | TAS2552_APT_EN |
> + TAS2552_LIM_EN);
> + return 0;
The class D is still being enabled here.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-07-17 16:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-14 20:10 [PATCH v7] ASoC: tas2552: Support TI TAS2552 Amplifier Dan Murphy
2014-07-17 16:58 ` Mark Brown [this message]
2014-07-17 17:07 ` Murphy, Dan
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=20140717165816.GA17528@sirena.org.uk \
--to=broonie@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=devicetree@vger.kernel.org \
--cc=dmurphy@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).