Devicetree
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Grant Likely <grant.likely@linaro.org>,
	alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
	Rob Herring <rob.herring@calxeda.com>,
	devicetree-discuss@lists.ozlabs.org
Subject: Re: [PATCH] ASoC: Add ssm2518 support
Date: Wed, 22 May 2013 12:57:05 -0500	[thread overview]
Message-ID: <20130522175705.GU1627@sirena.org.uk> (raw)
In-Reply-To: <1369242013-27672-1-git-send-email-lars@metafoo.de>


[-- Attachment #1.1: Type: text/plain, Size: 1721 bytes --]

On Wed, May 22, 2013 at 07:00:13PM +0200, Lars-Peter Clausen wrote:
> This patch adds a ASoC CODEC driver for the SSM2516. The SSM2516 is a stereo
> Class-D audio amplifier with an I2S interface for audio in and a built-in
> dynamic range control processor.

I'll apply this but 

> +	if (slots == 0) {
> +		return regmap_update_bits(ssm2518->regmap,
> +			SSM2518_REG_SAI_CTRL1, SSM2518_SAI_CTRL1_SAI_MASK,
> +			SSM2518_SAI_CTRL1_SAI_I2S);
> +	}

You've got quite a few single statement if () blocks with { } which
shouldn't be there.

> +	codec->control_data = ssm2518->regmap;
> +	ret = snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
> +	if (ret < 0) {
> +		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
> +		return ret;
> +	}
> +
> +	ret = regmap_update_bits(ssm2518->regmap, SSM2518_REG_POWER2,
> +				SSM2518_POWER2_APWDN, 0x00);
> +	if (ret)
> +		return ret;
> +
> +	return ssm2518_set_bias_level(codec, SND_SOC_BIAS_OFF);

The power down stuff shouild probably be done in the I2C probe so that
the device is in a low power state if unused.

> +	switch (freq) {
> +	case 2048000:

Looks like the user can't select 0 for the SYSCLK, I'd expect that to be
possible for systems that can reprogram the clock so that they can avoid
having constraints set when they don't need them.

> +static bool ssm2518_register_volatile(struct device *dev, unsigned int reg)
> +{
> +	return false;
> +}

Hrm, this should be the default...

> +	} else if (i2c->dev.of_node) {
> +		ssm2518->enable_gpio = of_get_gpio(i2c->dev.of_node, 0);
> +		if (ssm2518->enable_gpio == -EPROBE_DEFER)
> +			return -EPROBE_DEFER;

Why are other errors being ignored here?

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

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2013-05-22 17:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 17:00 [PATCH] ASoC: Add ssm2518 support Lars-Peter Clausen
2013-05-22 17:57 ` Mark Brown [this message]
2013-05-22 18:16   ` Lars-Peter Clausen
2013-05-22 22:07     ` Mark Brown

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=20130522175705.GU1627@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=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=rob.herring@calxeda.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