From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Ola Lilja <ola.o.lilja@stericsson.com>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lrg@ti.com>,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH] ASoC: codecs: Add AB8500 codec-driver
Date: Mon, 4 Jun 2012 15:17:53 +0100 [thread overview]
Message-ID: <20120604141752.GH7538@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1338547834-22714-1-git-send-email-ola.o.lilja@stericsson.com>
[-- Attachment #1.1: Type: text/plain, Size: 2284 bytes --]
On Fri, Jun 01, 2012 at 12:50:34PM +0200, Ola Lilja wrote:
> +/*
> + * Extended interface for codec-driver
> + */
So, a few issues below. Could you please submit a version with this
extended API removed or made driver internal as much as possible? The
rest of the driver looks good so it'd be good to split this stuff out
and review separately.
> +int ab8500_audio_init_audioblock(struct snd_soc_codec *codec)
> +{
> + int status;
> +
> + dev_dbg(codec->dev, "%s: Enter.\n", __func__);
> +
> + /* Reset audio-registers and disable 32kHz-clock output 2 */
> + status = ab8500_sysctrl_write(AB8500_STW4500CTRL3,
> + AB8500_STW4500CTRL3_CLK32KOUT2DIS |
> + AB8500_STW4500CTRL3_RESETAUDN,
> + AB8500_STW4500CTRL3_RESETAUDN);
> + if (status < 0)
> + return status;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(ab8500_audio_init_audioblock);
This is really odd (I'm sure I've queried this on previous versions of
the driver) - why is something else reinitialising the device?
Shouldn't the CODEC driver be doing this by itself - if nothing else I'd
expect it to cause confusion if the device is reinitialised underneath
the driver?
I didn't register this last time as I'd assumed that the issue was a
missing static rather than something else calling the function.
> +int ab8500_audio_setup_mics(struct snd_soc_codec *codec,
> + struct amic_settings *amics)
> +{
Similar thing here, I'd expect this to just be platform data.
> +int ab8500_audio_set_ear_cmv(struct snd_soc_codec *codec,
> + enum ear_cm_voltage ear_cmv)
> +{
> + char *cmv_str;
> +
> + switch (ear_cmv) {
> + case EAR_CMV_0_95V:
> + cmv_str = "0.95V";
> + break;
> + case EAR_CMV_1_10V:
> + cmv_str = "1.10V";
> + break;
> + case EAR_CMV_1_27V:
> + cmv_str = "1.27V";
> + break;
> + case EAR_CMV_1_58V:
> + cmv_str = "1.58V";
> + break;
> + default:
> + dev_err(codec->dev,
> + "%s: Unknown earpiece CM-voltage (%d)!\n",
> + __func__, (int)ear_cmv);
> + return -EINVAL;
> + }
> + dev_dbg(codec->dev, "%s: Earpiece CM-voltage: %s\n", __func__,
> + cmv_str);
> + snd_soc_update_bits(codec, AB8500_ANACONF1, AB8500_ANACONF1_EARSELCM,
> + ear_cmv);
> +
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(ab8500_audio_set_ear_cmv);
This is *possibly* OK, though again it does look platform dataish.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next parent reply other threads:[~2012-06-04 14:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1338547834-22714-1-git-send-email-ola.o.lilja@stericsson.com>
2012-06-04 14:17 ` Mark Brown [this message]
[not found] <1339412784-8910-1-git-send-email-ola.o.lilja@stericsson.com>
2012-06-11 11:09 ` [PATCH] ASoC: codecs: Add AB8500 codec-driver 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=20120604141752.GH7538@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=linus.walleij@linaro.org \
--cc=lrg@ti.com \
--cc=ola.o.lilja@stericsson.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.