mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 v6] ASoC: tas2552: Support TI TAS2552 Amplifier
Date: Mon, 14 Jul 2014 19:43:21 +0100	[thread overview]
Message-ID: <20140714184321.GW6800@sirena.org.uk> (raw)
In-Reply-To: <1405093489-11897-1-git-send-email-dmurphy@ti.com>

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

On Fri, Jul 11, 2014 at 10:44:49AM -0500, Dan Murphy wrote:

> @@ -754,4 +755,8 @@ config SND_SOC_TPA6130A2
>  	tristate "Texas Instruments TPA6130A2 headphone amplifier"
>  	depends on I2C
>  
> +config SND_SOC_TAS2552
> +	tristate "Texas Instruments TAS2552 Mono Audio amplifier"
> +	depends on I2C
> +
>  endmenu

Keep this and Makefile sorted - since this is a proper CODEC driver it
should be in with the CODECs and also sorted in alphabetical order.

> +static int tas2552_startup(struct snd_pcm_substream *substream,
> +			   struct snd_soc_dai *dai)
> +{
> +	struct snd_soc_codec *codec = dai->codec;
> +
> +	pm_runtime_get_sync(codec->dev);
> +
> +	return 0;
> +}
> +
> +static void tas2552_shutdown(struct snd_pcm_substream *substream,
> +			   struct snd_soc_dai *dai)
> +{
> +	struct snd_soc_codec *codec = dai->codec;
> +
> +	pm_runtime_put(codec->dev);
> +}

These runtime calls should be redundant, the framework should hold a
runtime PM reference on devices while they are active.  Does this not
work for you?

> +	pm_runtime_get_sync(codec->dev);

Check the return value here.

> +	snd_soc_write(codec, TAS2552_CFG_2, TAS2552_CLASSD_EN |
> +				  TAS2552_BOOST_EN | TAS2552_APT_EN |
> +				  TAS2552_PLL_ENABLE | TAS2552_LIM_EN);

The PLL is enabled all the time not via DAPM or similar (it's never
disabled)?

> +static int tas2552_resume(struct snd_soc_codec *codec)
> +{
> +	struct tas2552_data *tas2552 = snd_soc_codec_get_drvdata(codec);
> +	int ret;
> +
> +	ret = regulator_bulk_enable(ARRAY_SIZE(tas2552->supplies),
> +				    tas2552->supplies);
> +
> +	if (ret != 0) {
> +		dev_err(codec->dev, "Failed to enable supplies: %d\n",
> +			ret);
> +	}
> +
> +	pm_runtime_get_sync(codec->dev);

Remove these runtime PM calls from suspend and resume, they're not doing
what you think (and will prevent runtime PM from doing anything).  Let
the frameworks worry about it for now, or explicitly call the runtime
suspend and resume operators if and only if the device is runtime
active.

> +	for (i = 0; i < ARRAY_SIZE(data->supplies); i++)
> +		data->supplies[i].supply = tas2552_supply_names[i];
> +
> +	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(data->supplies),
> +				      data->supplies);
> +	if (ret != 0)
> +		dev_err(dev, "Failed to request supplies: %d\n", ret);

These supplies are mandatory (as they should be) but weren't mentioned
in the DT binding - please add them there.

> +static const struct i2c_device_id tas2552_id[] = {
> +	{ "tas2552-codec", 0 },
> +	{ }
> +};

No -codec.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-07-14 18:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11 15:44 Dan Murphy
2014-07-14 18:43 ` Mark Brown [this message]
2014-07-14 19:07   ` Murphy, Dan
2014-07-14 19:17     ` Mark Brown
2014-07-14 19:33       ` 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=20140714184321.GW6800@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

all inboxes | Powered by JetHome®