From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Wolfram Sang <w.sang@pengutronix.de>
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 17:53:05 +0000 [thread overview]
Message-ID: <20120118175305.GR8732@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1326901108-3435-1-git-send-email-w.sang@pengutronix.de>
On Wed, Jan 18, 2012 at 04:38:28PM +0100, Wolfram Sang wrote:
> +static int max9768_write(struct snd_soc_codec *codec, unsigned int reg,
> + unsigned int value)
Use regmap for register I/O please.
> + data = (reg << 6) | value;
> + ret = i2c_smbus_write_byte(codec->control_data, data);
You may need to add a new register format, but that shouldn't be too
much work.
> + 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?
> + 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
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.
> + 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...
next prev parent reply other threads:[~2012-01-18 17:53 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 [this message]
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=20120118175305.GR8732@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=lars@metafoo.de \
--cc=lrg@ti.com \
--cc=w.sang@pengutronix.de \
/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).