Devicetree
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Karl Asseily <karl@asseily.com>
Cc: lgirdwood@gmail.com, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, perex@perex.cz, tiwai@suse.com,
	linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/4] ASoC: es9039q2m: add ESS Technology ES9039Q2M codec driver
Date: Fri, 18 Sep 2026 11:46:25 +0100	[thread overview]
Message-ID: <321e417b-55cf-4667-9c52-cbf3548561e6@sirena.org.uk> (raw)
In-Reply-To: <20260918031326.68542-4-karl@asseily.com>

[-- Attachment #1: Type: text/plain, Size: 1889 bytes --]

On Fri, Sep 18, 2026 at 06:13:25AM +0300, Karl Asseily wrote:
> The ES9039Q2M is a 32-bit two-channel audio DAC with an asynchronous
> sample rate converter. It selects between two control personalities with
> its MODE pin: hardware mode, strapped by HW0/HW1/HW2 with no control bus
> at all, and software mode over I2C or SPI. This driver implements
> software mode over I2C, which MODE = GND selects.

> +static int es9039_fir_put(struct snd_kcontrol *kcontrol,
> +			  const unsigned int __user *bytes, unsigned int size)
> +{
> +	struct snd_soc_component *c = snd_kcontrol_chip(kcontrol);
> +	struct es9039q2m_priv *priv = snd_soc_component_get_drvdata(c);
> +	struct soc_bytes_ext *be = (void *)kcontrol->private_value;
> +	struct es9039_fir_ctl *p = container_of(be, struct es9039_fir_ctl, be);
> +	u8 *buf;
> +	int ret, i;
> +
> +	if (size != p->taps * ES9039_COEFF_BYTES)
> +		return -EINVAL;
> +
> +	buf = memdup_user(bytes, size);
> +	if (IS_ERR(buf))
> +		return PTR_ERR(buf);
> +
> +	/*
> +	 * PROG_COEFF_WE is a per-coefficient strobe, not a gate held open
> +	 * across the upload. The datasheet's sequence is address, data, raise
> +	 * WE, lower WE, once per coefficient. Holding it high for the whole
> +	 * loop also appears to work on ES9039Q2M silicon, but "appears to
> +	 * work" is not a specification.
> +	 */
> +	for (i = 0; i < p->taps; i++) {
> +		ret = regmap_write(priv->regmap, ES9039_PROG_RAM_ADDR,
> +				   (p->stage_4x ? ES9039_PROG_STAGE_4X : 0) |
> +				   FIELD_PREP(ES9039_PROG_ADDR_MASK, i));
> +		if (ret)
> +			goto out;

...

> +out:
> +	regmap_update_bits(priv->regmap, ES9039_PROG_RAM_CTRL,
> +			   ES9039_PROG_COEFF_WE, 0);
> +	kfree(buf);
> +	if (ret)
> +		return ret;

How does this work with suspend and resume if the device is powered down
in suspend?  It looks like this is doing some windowing stuff and needs
a specific write sequence.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2026-09-18 10:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18  3:13 [PATCH v3 0/4] ASoC: add ESS Technology ES9039Q2M codec driver Karl Asseily
2026-09-18  3:13 ` [PATCH v3 1/4] dt-bindings: vendor-prefixes: add ESS Technology Karl Asseily
2026-09-18 17:27   ` Rob Herring
2026-09-18  3:13 ` [PATCH v3 2/4] ASoC: dt-bindings: add ESS Technology ES9039Q2M Karl Asseily
2026-09-18  3:20   ` sashiko-bot
2026-09-18 17:29   ` Rob Herring
2026-09-18  3:13 ` [PATCH v3 3/4] ASoC: es9039q2m: add ESS Technology ES9039Q2M codec driver Karl Asseily
2026-09-18  3:24   ` sashiko-bot
2026-09-18 18:27     ` Karl Asseily
2026-09-18 10:46   ` Mark Brown [this message]
2026-09-18 10:59     ` Karl Asseily
2026-09-18 11:23       ` Mark Brown
2026-09-18  3:13 ` [PATCH v3 4/4] MAINTAINERS: add entry for the " Karl Asseily

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=321e417b-55cf-4667-9c52-cbf3548561e6@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=karl@asseily.com \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=tiwai@suse.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