All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: James Ogletree <jogletre@opensource.cirrus.com>
Cc: <dmitry.torokhov@gmail.com>, <robh+dt@kernel.org>,
	<krzysztof.kozlowski+dt@linaro.org>, <conor+dt@kernel.org>,
	<lee@kernel.org>, <broonie@kernel.org>, <jeff@labundy.com>,
	<patches@opensource.cirrus.com>, <linux-sound@vger.kernel.org>,
	<linux-input@vger.kernel.org>, <devicetree@vger.kernel.org>
Subject: Re: [PATCH v7 1/5] firmware: cs_dsp: Add write sequencer interface
Date: Wed, 14 Feb 2024 10:24:43 +0000	[thread overview]
Message-ID: <ZcyU6xgpOvrhX57D@ediswmail9.ad.cirrus.com> (raw)
In-Reply-To: <20240212173111.771107-2-jogletre@opensource.cirrus.com>

On Mon, Feb 12, 2024 at 05:31:07PM +0000, James Ogletree wrote:
> A write sequencer is a sequence of register addresses
> and values executed by some Cirrus DSPs following
> power state transitions.
> 
> Add support for Cirrus drivers to update or add to a
> write sequencer present in firmware.
> 
> Signed-off-by: James Ogletree <jogletre@opensource.cirrus.com>
> ---
> +	if (!update) {
> +		if (wseq->ctl->len - op_end->offset < new_op_size) {
> +			cs_dsp_err(dsp, "Not enough memory in write sequence for entry\n");
> +			ret = -ENOMEM;
> +			goto op_new_free;
> +		}
> +
> +		op_end->offset += new_op_size;
> +
> +		ret = cs_dsp_coeff_write_ctrl(wseq->ctl, op_end->offset / sizeof(u32),
> +					      &op_end->data, sizeof(u32));
> +		if (ret)
> +			goto op_new_free;
> +
> +		list_add_tail(&op_new->list, &wseq->ops);

This means the new write will be after the terminator in the
list. Whilst I think the code will work this way it would be
much cleaner if we kept the list ordered to match the writes,
by inserting the new element just before op_end.

Thanks,
Charles

  reply	other threads:[~2024-02-14 10:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-12 17:31 [PATCH v7 0/5] Add support for CS40L50 James Ogletree
2024-02-12 17:31 ` [PATCH v7 1/5] firmware: cs_dsp: Add write sequencer interface James Ogletree
2024-02-14 10:24   ` Charles Keepax [this message]
2024-02-12 17:31 ` [PATCH v7 2/5] dt-bindings: input: cirrus,cs40l50: Add initial DT binding James Ogletree
2024-02-12 17:31 ` [PATCH v7 3/5] mfd: cs40l50: Add support for CS40L50 core driver James Ogletree
2024-02-12 17:31 ` [PATCH v7 4/5] Input: cs40l50 - Add support for the CS40L50 haptic driver James Ogletree
2024-02-12 17:31 ` [PATCH v7 5/5] ASoC: cs40l50: Support I2S streaming to CS40L50 James Ogletree
2024-02-13 19:55   ` Mark Brown
2024-02-16 23:41     ` James Ogletree

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=ZcyU6xgpOvrhX57D@ediswmail9.ad.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jeff@labundy.com \
    --cc=jogletre@opensource.cirrus.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=robh+dt@kernel.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 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.