From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Brian Austin <brian.austin@cirrus.com>
Cc: alsa-devel@alsa-project.org, vinod.koul@linux.intel.com,
lrg@ti.com, ramesh.babu@intel.com, joe@nucleusys.com
Subject: Re: [PATCH v2] ASoC: Add support for cs42l73 codec
Date: Sun, 2 Oct 2011 19:40:34 +0100 [thread overview]
Message-ID: <20111002184033.GD2857@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1317400912-5789-1-git-send-email-brian.austin@cirrus.com>
On Fri, Sep 30, 2011 at 11:41:52AM -0500, Brian Austin wrote:
> This patch adds support for the Cirrus Logic CS42L73
> low power stereo codec.
A few comments here beyond those others made (though I may be
replicating some of what they said) but overall this is shaping up
well - hopefully next version we can get this merged.
Folks: when replying to patches (or mails in general) you should delete
unneeded context. This makes it much easier to find the text you wrote,
all the stuff about cutting text improving bandwidth usage applies just
as much to the humans reading your mail as to the computers moving it.
> This patch has cleared checkpatch.pl with no warnings or errors.
> Code changes requested were implemented.
> ASoC API changes requested were implemented.
Stuff like this should go after the ---.
> + * cs42l73.c -- CS42L73 ALSA Soc Audio driver
> + *
> + * Copyright 2011 Cirrus Logic, Inc.
> + *
> + * Authors: Georgi Vlaev, Nucleus Systems Ltd, <office@nucleusys.com>
Who's not CCed on the patch, and who hasn't signed it off?
> + SOC_DOUBLE("Input Path Digital Switch", CS42L73_ADCIPC, 0, 4, 1, 1),
s/Input Path/Capture/
> + SOC_DOUBLE("Invert ADC Signal Polarity Switch", CS42L73_ADCIPC, 1, 5, 1,
> + 0),
ADC Signal Polarity Switch.
> + SOC_DOUBLE("ADC Boost Switch", CS42L73_ADCIPC, 2, 6, 1, 0),
This should be a Volume control with TLV information assuming it does
what it sounds like and makes the signal louder.
> + SOC_SINGLE("Charge Pump Frequency Volume", CS42L73_CPFCHC, 4, 15, 0),
No Volume (clearly this isn't a volume control), this should probably be
an enum listing the rates.
> + SOC_SINGLE("HL Limiter Attack Rate Volume", CS42L73_LIMARATEHL, 0, 0x3F,
> + 0),
> + SOC_SINGLE("HL Limiter Release Rate Volume", CS42L73_LIMRRATEHL, 0,
> + 0x3F, 0),
Similarly here, you probably want an enumaration showing the rates.
> + SOC_DOUBLE_R_TLV("XSP-IP Attenuation Volume",
> + CS42L73_XSPAIPAA, CS42L73_XSPBIPBA, 0, 0x3F, 1,
> + attn_tlv),
Attenuation Volume makes no sense - they're approximate synonyms. Just
Volume.
> + if (clk_id != CS42L73_CLKID_MCLK1 && clk_id != CS42L73_CLKID_MCLK2) {
> + dev_err(codec->dev, "Invalid clk_id %u\n", clk_id);
> + return -EINVAL;
> + }
A switch statement would be more idomatic.
> + if (spc & xSPDIF_PCM) {
> + spc &= (31 << 3); /* Clear PCM mode, set MSB->LSB */
> + if (format == SND_SOC_DAIFMT_DSP_B
> + && inv == SND_SOC_DAIFMT_IB_IF)
> + spc |= (xPCM_MODE0 << 4);
> + else
> +
> + if (format == SND_SOC_DAIFMT_DSP_B
> + && inv == SND_SOC_DAIFMT_IB_NF)
> + spc |= (xPCM_MODE1 << 4);
> + else
> +
> + if (format == SND_SOC_DAIFMT_DSP_A
> + && inv == SND_SOC_DAIFMT_IB_IF)
> + spc |= (xPCM_MODE1 << 4);
> + else
> + return -EINVAL;
I can't help but feel this would be clearer with a switch statement.
> +static int cs42l73_set_tristate(struct snd_soc_dai *dai, int tristate)
> +{
> + struct snd_soc_codec *codec = dai->codec;
> + int id = dai->id;
> +
> + return snd_soc_update_bits(codec, CS42L73_SPC(id), 0x7F, tristate << 7);
This is going to fail if someone passes a non-boolean value in - better
make sure that tristate is actually 1 or 0.
> +
> + .ops = &cs42l73_ops,
> + .symmetric_rates = 1,
> + },
> + {
Please use the kernel coding style for indentation.
> +
> +/* CS42L73_PWRCTL1 */
> +#define PDN_ADCB (1 << 7)
> +#define PDN_DMICB (1 << 6)
> +#define PDN_ADCA (1 << 5)
> +#define PDN_DMICA (1 << 4)
> +#define PDN_LDO (1 << 2)
> +#define DISCHG_FILT (1 << 1)
> +#define PDN (1 << 0)
All the identifiers in the header need to be namespaced.
next prev parent reply other threads:[~2011-10-02 18:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-30 16:41 [PATCH v2] ASoC: Add support for cs42l73 codec Brian Austin
2011-09-30 17:34 ` Vinod Koul
2011-09-30 18:32 ` Austin, Brian
2011-10-01 17:22 ` Vinod Koul
2011-09-30 18:50 ` Lars-Peter Clausen
2011-09-30 19:19 ` Austin, Brian
2011-10-01 5:04 ` Babu, Ramesh
2011-10-05 21:55 ` Austin, Brian
2011-10-02 18:40 ` Mark Brown [this message]
2011-10-04 17:53 ` Austin, Brian
2011-10-04 19:17 ` Austin, Brian
2011-10-05 10:40 ` Mark Brown
2011-10-04 21:38 ` 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=20111002184033.GD2857@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=brian.austin@cirrus.com \
--cc=joe@nucleusys.com \
--cc=lrg@ti.com \
--cc=ramesh.babu@intel.com \
--cc=vinod.koul@linux.intel.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).