[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130626143001.GP27646@sirena.org.uk>
Date: Wed, 26 Jun 2013 15:30:01 +0100
From: Mark Brown <broonie@...nel.org>
To: Marek Belisko <marek.belisko@...il.com>
Cc: perex@...ex.cz, tiwai@...e.de, grant.likely@...aro.org,
rob.herring@...xeda.com, rob@...dley.net, lgirdwood@...il.com,
devicetree-discuss@...ts.ozlabs.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, alsa-devel@...a-project.org,
zonque@...il.com, Marek Belisko <marek.belisko@...eamunlimited.com>
Subject: Re: [PATCH] ASoC: Add PCM1681 codec driver.
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.
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists