alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: alsa-devel@alsa-project.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@ti.com>
Subject: Re: [PATCH] ASoC: add driver for max9768 amplifier
Date: Wed, 18 Jan 2012 20:26:25 +0100	[thread overview]
Message-ID: <20120118192625.GA13708@pengutronix.de> (raw)
In-Reply-To: <4F17005C.9000507@metafoo.de>


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

> > +struct max9768 {
> > +	struct i2c_client *client;
> > +	int mute_gpio;
> > +	int shdn_gpio;
> 
> The shutdown gpio is requested, but never used.

It is initialized to HIGH, otherwise the chip won't do a thing. The pin can be
later used for PM, but I don't need that now.

> > +	ret = snd_soc_cache_write(codec, reg, value);
> > +	if (ret < 0)
> > +		return ret;
> > +
> > +	data = (reg << 6) | value;
> 
> 
> Adding support for this register type to regmap and use regmap then is the
> way to go. regmap should also be used for the cache instead of the legacy
> ASoC cache.

Okay, are you already at it? Otherwise I'll try adding this tomorrow.

> > +	ret = snd_soc_add_controls(codec, max9768_volume,
> > +			ARRAY_SIZE(max9768_volume));
> > +	if (ret)
> > +		return ret;
> 
> Use the controls/num_controls fields of your codec_driver to register these
> controls.

OK.

> > +static struct snd_soc_codec_driver soc_codec_dev_max9768 = {
> 
> max9768_codec_driver would be a better name.

OK.

> > +	return snd_soc_register_codec(&client->dev, &soc_codec_dev_max9768, NULL, 0);
> 
> GPIOs are not freed in case of an error.
> 
> > +}
> > +
> > +static int __devexit max9768_i2c_remove(struct i2c_client *client)
> > +{
> > +	snd_soc_unregister_codec(&client->dev);
> 
> 
> GPIOs are never freed.

Eeeks, right, damn. Thanks!

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

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



  reply	other threads:[~2012-01-18 19:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18 15:38 [PATCH] ASoC: add driver for max9768 amplifier Wolfram Sang
2012-01-18 17:24 ` Lars-Peter Clausen
2012-01-18 19:26   ` Wolfram Sang [this message]
2012-01-18 19:40     ` Lars-Peter Clausen
2012-01-18 17:53 ` Mark Brown
2012-01-18 19:33   ` Wolfram Sang
2012-01-19 10:55     ` 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=20120118192625.GA13708@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lars@metafoo.de \
    --cc=lrg@ti.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;
as well as URLs for NNTP newsgroup(s).