mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Marek Belisko <marek.belisko@gmail.com>
Cc: perex@perex.cz, tiwai@suse.de, grant.likely@linaro.org,
	rob.herring@calxeda.com, rob@landley.net, lgirdwood@gmail.com,
	devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
	zonque@gmail.com,
	Marek Belisko <marek.belisko@streamunlimited.com>
Subject: Re: [PATCH] ASoC: Add PCM1681 codec driver.
Date: Wed, 26 Jun 2013 15:30:01 +0100	[thread overview]
Message-ID: <20130626143001.GP27646@sirena.org.uk> (raw)
In-Reply-To: <1372251928-15706-1-git-send-email-marek.belisko@streamunlimited.com>

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

On Wed, Jun 26, 2013 at 03:05:28PM +0200, Marek Belisko wrote:

> +#define PCM1681_ATT_CONTROL(X)	(X <= 6 ? X : X + 9) /* Attenuation level */

Write a function for this.

> +static bool pcm1681_writeable_reg(struct device *dev, unsigned register reg)
> +{
> +	return pcm1681_accessible_reg(dev, reg) &&
> +		(reg != PCM1681_ZERO_DETECT_STATUS);
> +}

> +static int pcm1681_digital_mute(struct snd_soc_dai *dai, int mute)
> +{
> +	struct snd_soc_codec *codec = dai->codec;
> +	struct pcm1681_private *priv = snd_soc_codec_get_drvdata(codec);
> +	int ret, val = 0;
> +
> +	if (mute)
> +		val = PCM1681_SOFT_MUTE_ALL;
> +

This would be clearer if written as an if .. else - otherwise it looks
like an uninitalised value might be used.

> +static int pcm1681_hw_params(struct snd_pcm_substream *substream,
> +			     struct snd_pcm_hw_params *params,
> +			     struct snd_soc_dai *dai)
> +{
> +	struct snd_soc_codec *codec = dai->codec;
> +	struct pcm1681_private *priv = snd_soc_codec_get_drvdata(codec);
> +	int val = 0;
> +	int pcm_format = params_format(params);
> +
> +	priv->rate = params_rate(params);
> +

Shouldn't there be a call to set the deemphasis here?

> +static int pcm1681_probe(struct snd_soc_codec *codec)
> +{
> +	return 0;
> +}
> +
> +static int pcm1681_remove(struct snd_soc_codec *codec)
> +{
> +	return 0;
> +}

Remove empty functions.

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

  parent reply	other threads:[~2013-06-26 14:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26 13:05 Marek Belisko
2013-06-26 13:16 ` Daniel Mack
2013-06-26 13:46   ` Marek Belisko
2013-06-26 13:55     ` Daniel Mack
2013-06-26 14:25   ` Mark Brown
2013-06-26 14:30 ` Mark Brown [this message]
2013-06-27  7:49   ` Marek Belisko
2013-07-01 12:37 ` [alsa-devel] " Lars-Peter Clausen

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=20130626143001.GP27646@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marek.belisko@gmail.com \
    --cc=marek.belisko@streamunlimited.com \
    --cc=perex@perex.cz \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=tiwai@suse.de \
    --cc=zonque@gmail.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®