lkml.org 
[lkml]   [2017]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] ASoC: codecs: Add initial PCM1862/63/64/65 universal ADC driver
On Fri, Nov 10, 2017 at 01:57:11PM -0600, Andrew F. Davis wrote:

This looks mostly good, a few small issues though:

> + dev_info(&i2c->dev, "%s() i2c->addr=%d\n", __func__, i2c->addr);

No need for this as standard, we already have I2C level logging
facilities if they're really needed. It's OK to do things like log chip
revisions read back from hardware but this is pure software.

> +static const struct snd_kcontrol_new pcm1863_snd_controls[] = {
> + SOC_DOUBLE_R_S_TLV("Analog Gain", PCM186X_PGA_VAL_CH1_L,

Volume controls should end in Volume to tell userspace how to handle
them, see ControlNames.txt.

> + ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(priv->supplies),
> + priv->supplies);
> + if (ret != 0) {
> + dev_err(dev, "failed to request supplies: %d\n", ret);
> + return ret;
> + }
> +
> + /* Reset device registers for a consistent power-on like state */
> + ret = regmap_write(regmap, PCM186X_PAGE, PCM186X_RESET);
> + if (ret != 0) {
> + dev_err(dev, "failed to write device: %d\n", ret);
> + return ret;
> + }

We didn't enable the supplies for the device before we reset it, if the
device was powered off then the write will hopefully not work and we'll
get a spurious error here. The driver should bounce the supplies on at
least long enough to do the reset, it's not ideal but it's robust.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2017-11-10 22:22    [W:0.041 / U:0.588 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site