[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171110212150.fyxqtoh5nusirslp@sirena.co.uk>
Date: Fri, 10 Nov 2017 21:21:50 +0000
From: Mark Brown <broonie@...nel.org>
To: "Andrew F. Davis" <afd@...com>
Cc: Liam Girdwood <lgirdwood@...il.com>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
alsa-devel@...a-project.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [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.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists