From: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Sean Cross <xobs-nXMMniAx+RbQT0dZR+AlfA@public.gmane.org>
Cc: lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
Liam Girdwood <lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Jaroslav Kysela <perex-/Fr2/VpizcU@public.gmane.org>,
Takashi Iwai <tiwai-l3A5Bk7waGM@public.gmane.org>,
Grant Likely
<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
Fabio Estevam
<fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
Nicolin Chen <b42378-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
bunnie-nXMMniAx+RbQT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH v4 2/3] ASoC: add es8328 codec driver
Date: Wed, 18 Jun 2014 10:45:05 +0100 [thread overview]
Message-ID: <20140618094505.GD5099@sirena.org.uk> (raw)
In-Reply-To: <1403063242-20840-3-git-send-email-xobs-nXMMniAx+RbQT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2185 bytes --]
On Wed, Jun 18, 2014 at 11:47:20AM +0800, Sean Cross wrote:
> +Required properties:
> +
> + - compatible : "es8328"
This needs the prefix, as does the example.
> +static int es8328_i2c_probe(struct i2c_client *i2c,
> + const struct i2c_device_id *id)
> +{
> + struct regmap_config config;
> +
> + config = es8328_regmap_config;
> + return es8328_probe(&i2c->dev, devm_regmap_init_i2c(i2c, &config));
> +}
config appears to serve no purpose here.
> +/* Run the codec at 22.5792 MHz to support these rates */
> +enum es8328_rate {
> + ES8328_RATE_8019,
> + ES8328_RATE_11025,
> + ES8328_RATE_22050,
> + ES8328_RATE_44100,
> +};
The driver should be enforcing constraints based on the clock it's got
then. Not everything does though so it's a bit optional.
> +static int es8328_put_deemph(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
> + struct es8328_priv *es8328 = snd_soc_codec_get_drvdata(codec);
> + int deemph = ucontrol->value.enumerated.item[0];
> +
> + if (deemph > 1)
> + return -EINVAL;
> +
> + es8328->deemph = deemph;
> +
> + return es8328_set_deemph(codec);
> +}
This will unconditionally store the new deemphasis setting even if we
failed to set it. That should never happen but still...
> + SOC_DOUBLE_TLV("Mic PGA Gain", ES8328_ADCCONTROL1, 4, 0, 8, 0, mic_tlv),
Mic PGA Volume.
> + SND_SOC_DAPM_MICBIAS("Mic Bias", ES8328_ADCPOWER,
> + ES8328_ADCPOWER_MIC_BIAS_OFF, 1),
Represent this as a suply, MICBIAS widgets are legacy.
> + case SND_SOC_BIAS_PREPARE:
> + /* VREF, VMID=2x50k, digital enabled */
> + snd_soc_write(codec, ES8328_CHIPPOWER, pwr_reg);
> + snd_soc_write(codec, ES8328_CONTROL1,
> + cc1_reg |
> + ES8328_CONTROL1_VMIDSEL_50k |
> + ES8328_CONTROL1_ENREF);
snd_soc_update_bits().
> +const struct regmap_config es8328_regmap_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> + .max_register = ES8328_REG_MAX,
> + .cache_type = REGCACHE_NONE,
> +};
> +EXPORT_SYMBOL_GPL(es8328_regmap_config);
No need to specify no cache, it's the default - though a cache is
better, it's faster and allows for suspend/resume.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-06-18 9:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-18 3:47 [PATCH v4 0/3] Add ES8328 audio codec Sean Cross
[not found] ` <1403063242-20840-1-git-send-email-xobs-nXMMniAx+RbQT0dZR+AlfA@public.gmane.org>
2014-06-18 3:47 ` [PATCH v4 1/3] devicetree: bindings: Add Everest Semicodunctor Sean Cross
2014-06-18 3:47 ` [PATCH v4 2/3] ASoC: add es8328 codec driver Sean Cross
[not found] ` <1403063242-20840-3-git-send-email-xobs-nXMMniAx+RbQT0dZR+AlfA@public.gmane.org>
2014-06-18 9:45 ` Mark Brown [this message]
2014-06-18 3:47 ` [PATCH v4 3/3] ASoC: fsl: add imx-es8328 machine driver Sean Cross
[not found] ` <1403063242-20840-4-git-send-email-xobs-nXMMniAx+RbQT0dZR+AlfA@public.gmane.org>
2014-06-18 10:02 ` Mark Brown
[not found] ` <20140618100233.GE5099-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-06-18 10:22 ` Sean Cross
2014-06-18 10:31 ` Mark Brown
[not found] ` <20140618103111.GH5099-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-06-19 1:34 ` [alsa-devel] " Sean Cross
[not found] ` <53A23E1B.3070008-nXMMniAx+RbQT0dZR+AlfA@public.gmane.org>
2014-06-19 10:39 ` Mark Brown
2014-06-19 14:27 ` Charles Keepax
[not found] ` <20140619142737.GD3412-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2014-06-19 15:13 ` 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=20140618094505.GD5099@sirena.org.uk \
--to=broonie-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
--cc=b42378-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=bunnie-nXMMniAx+RbQT0dZR+AlfA@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
--cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=perex-/Fr2/VpizcU@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=tiwai-l3A5Bk7waGM@public.gmane.org \
--cc=xobs-nXMMniAx+RbQT0dZR+AlfA@public.gmane.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).