From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [patch 4/6] cs42l51: add asoc driver
Date: Sun, 16 May 2010 18:27:34 +0100 [thread overview]
Message-ID: <20100516172730.GB9830@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20100515153130.666637769@mandriva.com>
On Sat, May 15, 2010 at 05:30:02PM +0200, apatard at mandriva.com wrote:
> This patch is adding a ASoC driver for the cs42l51 from Cirrus Logic.
> Master mode and spi mode are not supported.
>
> Signed-off-by: Arnaud Patard <apatard@mandriva.com>
This seems basically OK but there are a few things of varying severity
to fix below. The main one is the namespacing of the constants in the
header file.
> + /* route microphone */
> + ret = snd_soc_write(codec, ADC_INPUT, 0xF0);
> + if (ret < 0)
> + goto error_alloc;
This really should be either chip default or user visible, but hopefully
when explicit control gets added users will be able to work out which
non-default value they were using so it'll be OK.
> +static const char *mic_boost[] = { "+16dB", "+32dB"};
> + SOC_ENUM("Mic Boost", cs42l51_mic_boost),
This really should be a SOC_SINGLE_TLV() - that will mean that userspace
software like Pulse that tries to automate gain control over the full
path can include the gain from the boost amplifier.
> +static const char *cs42l51_dac_names[] = {"PCM->DAC",
> + "PCM->SPE->DAC", "ADC->DAC"};
Conventionally these would have different names - something like "Direct
PCM", "DSP PCM" and "ADC" - since it looks a little nicer in the UI of
apps but it doesn't really matter since these are only ever likely to be
seen by people configuring systems and not end users.
> +#define DAPM_EVENT_PRE_POST_PMD (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD)
This really ought to get pushed into the main DAPM header file if it's
going to stick, though I'd be surprised to see other users so it's not
terribly urgent.
> + if (!rates) {
> + printk(KERN_ERR "cs42l51: could not find a valid sample rate\n");
> + return -EINVAL;
> + }
You could use dev_() printks based on codec->dev or dai->dev.
> + dev_info(&pdev->dev, "CS42L51 ALSA SoC Codec\n");
Not a big fan of chatty boots but it's no big deal.
> +#define CHIP_ID 0x1B
> +#define CHIP_REV_A 0x00
> +#define CHIP_REV_B 0x01
The macros in the header file should all be namespaced - they're likely
to collide with other things when the header is included in machine
drivers (eg, the registers for the CODEC). Some of them are moderately
safe but things like these ones seem likely to run into trouble and it'd
be better to be consistent.
next prev parent reply other threads:[~2010-05-16 17:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-15 15:29 [patch 0/6] kirkwood openrd client audio support - v2 apatard at mandriva.com
2010-05-15 15:29 ` [patch 1/6] orion/kirkwood: add audio functions apatard at mandriva.com
2010-05-16 17:35 ` Mark Brown
2010-05-15 15:30 ` [patch 2/6] openrd-client: initialise audio apatard at mandriva.com
2010-05-16 17:36 ` Mark Brown
2010-05-15 15:30 ` [patch 3/6] ASoC: Add SOC_DOUBLE_R_SX_TLV control apatard at mandriva.com
2010-05-16 17:09 ` Mark Brown
2010-05-15 15:30 ` [patch 4/6] cs42l51: add asoc driver apatard at mandriva.com
2010-05-16 17:27 ` Mark Brown [this message]
2010-05-15 15:30 ` [patch 5/6] orion/kirkwood: Add i2s support apatard at mandriva.com
2010-05-16 17:31 ` Mark Brown
2010-05-17 5:23 ` [alsa-devel] " saeed bishara
2010-05-15 15:30 ` [patch 6/6] kirkwood: Add audio support to openrd client platforms apatard at mandriva.com
2010-05-15 16:52 ` [patch 6/6] kirkwood: Add audio support to openrd?client platforms Alexander Clouter
2010-05-16 17:32 ` [patch 6/6] kirkwood: Add audio support to openrd client platforms Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2010-05-27 12:57 [patch 0/6] kirkwood openrd client audio support - v4 apatard at mandriva.com
2010-05-27 12:57 ` [patch 4/6] cs42l51: add asoc driver apatard at mandriva.com
2010-05-31 11:20 ` 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=20100516172730.GB9830@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).