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


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


> > +static int max9768_write(struct snd_soc_codec *codec, unsigned int reg,
> > +		unsigned int value)
> 
> Use regmap for register I/O please.

OK, currently negotiating this with Lars-Peter.

> > +	if (max9768->flags & MAX9768_FLAG_CLASSIC_PWM) {
> > +		ret = snd_soc_write(codec, MAX9768_CTRL, MAX9768_CTRL_PWM);
> > +		if (ret)
> > +			return ret;
> > +	}
> 
> Some documentation on what this does would be nice.  Is this something
> that might usefully be changed at runtime?

It only depends on the hardware design. Will a pointer to the section of the
datasheet be enough for documentation?

> > +	ret = snd_soc_add_controls(codec, max9768_volume,
> > +			ARRAY_SIZE(max9768_volume));
> > +	if (ret)
> > +		return ret;
> 
> Use the controls field in the driver.  I'd also expect to see some sort

Understood.

> of DAPM support, even if it's just mapping out the pins.  Since you're
> manually controlling the mute it'd be nice to make the unmute be (mute
> && power) to save on pops and clicks from the CODEC being amplified.

Sorry, not understood. Is there an example of what you mean here somewhere in
the tree?

> > +		err = gpio_request_one(pdata->mute_gpio, GPIOF_INIT_HIGH, "MAX9768 Mute");
> > +		max9768->mute_gpio = err ?: pdata->mute_gpio;
> 
> I really don't like the ternery operator at the best of times...

Can we agree to disagree? It is so convenient here and saves a few lines.

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:33 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
2012-01-18 19:40     ` Lars-Peter Clausen
2012-01-18 17:53 ` Mark Brown
2012-01-18 19:33   ` Wolfram Sang [this message]
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=20120118193320.GB13708@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).