All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Anatol Pomozov <anatol.pomozov@gmail.com>
Cc: alsa-devel@alsa-project.org, lars@metafoo.de,
	lgirdwood@gmail.com, mfelton1@nuvoton.com, kcso@nuvoton.com,
	ccchang12@nuvoton.com, dgreid@google.com, mhkuo@nuvoton.com
Subject: Re: [PATCH] ASoC: nau8825: Add driver for headset chip Nuvoton 8825
Date: Fri, 31 Jul 2015 19:27:16 +0100	[thread overview]
Message-ID: <20150731182716.GO20873@sirena.org.uk> (raw)
In-Reply-To: <1438038837-339-1-git-send-email-anatol.pomozov@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2393 bytes --]

On Mon, Jul 27, 2015 at 04:13:57PM -0700, Anatol Pomozov wrote:

Looks mostly good, a few things below though:

> +		break;
> +	case 1:
> +		dev_info(nau8825->dev, "OMTP (micgnd1) mic connected\n");

This is far too noisy - these should be dev_dbg() at most.

> +		} else {
> +			dev_warn(nau8825->dev, "Headset completion IRQ fired but no headset connected\n");
> +			nau8825_eject_jack(nau8825);
> +		}

Things like this that aren't supposed to happen are fine but normal
operation shouild be quiet.

> +	/* VMID Enable and Tieoff */
> +	regmap_write(regmap, NAU8825_REG_BIAS_ADJ, 0x0060);

You're leavinng VMID enabled all the timme?

> +	/* Jack Detect pull up (High=eject, Low=insert) */
> +	regmap_write(regmap, NAU8825_REG_GPIO12_CTRL, 0x0800);

This seems like it should be a board setting?

> +	/* Setup SAR ADC */
> +	regmap_write(regmap, NAU8825_REG_SAR_CTRL, 0x0280);

Lots of magic numbers in these things...  some of them I can guess
what's going on but this one is a bit obscure, perhaps it should be user
controllable?

> +	/* Setup ADC x128 OSR */
> +	regmap_write(regmap, NAU8825_REG_ADC_RATE, 0x0002);
> +	/* Setup DAC x128 OSR */
> +	regmap_write(regmap, NAU8825_REG_DAC_CTRL1, 0x0082);

I'd expect this to be user controllable.

> +static int nau8825_i2c_probe(struct i2c_client *i2c,
> +	const struct i2c_device_id *id)
> +{
> +	struct device *dev = &i2c->dev;
> +	struct nau8825 *nau8825;
> +	int ret, value;
> +
> +	nau8825 = devm_kzalloc(dev, sizeof(*nau8825), GFP_KERNEL);
> +	if (!nau8825)
> +		return -ENOMEM;
> +
> +	i2c_set_clientdata(i2c, nau8825);
> +
> +	nau8825->regmap = devm_regmap_init_i2c(i2c, &nau8825_regmap_config);
> +	if (IS_ERR(nau8825->regmap))
> +		return PTR_ERR(nau8825->regmap);
> +	nau8825->irq = i2c->irq;
> +	nau8825->dev = dev;
> +
> +	nau8825_reset_chip(nau8825->regmap);
> +	ret = regmap_read(nau8825->regmap, NAU8825_REG_I2C_DEVICE_ID, &value);
> +	if (ret < 0) {
> +		dev_err(dev, "Failed to read device id from the NAU8825: %d\n",
> +			ret);
> +		return ret;
> +	}
> +	if ((value & NAU8825_SOFTWARE_ID_MASK) !=
> +			NAU8825_SOFTWARE_ID_NAU8825) {
> +		dev_err(dev, "Not a NAU8825 chip\n");
> +		return -ENODEV;
> +	}
> +
> +	return snd_soc_register_codec(&i2c->dev, &nau8825_codec_driver,
> +			&nau8825_dai, 1);
> +}

I'd expect any initial register initialistion to happen here (if only so
we save power until the card registers).

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2015-07-31 21:22 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 23:13 [PATCH] ASoC: nau8825: Add driver for headset chip Nuvoton 8825 Anatol Pomozov
2015-07-31 18:27 ` Mark Brown [this message]
2015-08-04  3:13   ` Anatol Pomozov
2015-08-04  9:47     ` Mark Brown
2015-08-11  0:32       ` Anatol Pomozov
2015-08-11 16:39         ` Mark Brown
2015-08-12 23:08           ` Anatol Pomozov
2015-08-13 11:26             ` Mark Brown
2015-08-13 19:44               ` Anatol Pomozov
2015-08-13 22:33                 ` Mark Brown
2015-08-16  7:38                   ` Anatol Pomozov
2015-08-17 18:20                     ` Mark Brown
2015-08-28 23:23                       ` Anatol Pomozov
2015-08-04  3:41 Anatol Pomozov
2015-08-04 17:37 ` Mark Brown
2015-08-11  3:44 Anatol Pomozov
2015-08-28 23:37 Anatol Pomozov
2015-08-30 14:47 ` Mark Brown
2015-09-03 17:10   ` Anatol Pomozov
2015-09-14 17:54     ` Mark Brown
2015-10-02 16:49 Anatol Pomozov
2015-10-02 16:55 ` Anatol Pomozov
2015-10-02 19:37 ` kbuild test robot

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=20150731182716.GO20873@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=anatol.pomozov@gmail.com \
    --cc=ccchang12@nuvoton.com \
    --cc=dgreid@google.com \
    --cc=kcso@nuvoton.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=mfelton1@nuvoton.com \
    --cc=mhkuo@nuvoton.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.