Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Qianhui Xu" <xiaqinghuan@mail.ustc.edu.cn>
Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 2/2] ASoC: codecs: aw88461: add the Awinic AW88461 speaker amplifier driver
Date: Mon, 30 Nov 2026 23:57:22 +0000	[thread overview]
Message-ID: <sashiko-outbox-242259@kernel.org> (raw)
In-Reply-To: <20261130234745.1063224-3-xiaqinghuan@mail.ustc.edu.cn>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] ASoC: aw88461: incomplete TXEN and volume reset in
  aw88461_down()
--

commit 914e755a0639c9d9a327147970c1f3e4b660cca3
Author: Qianhui Xu <xiaqinghuan@mail.ustc.edu.cn>

ASoC: codecs: aw88461: add the Awinic AW88461 speaker amplifier driver

This commit adds an ASoC codec driver for the Awinic AW88461 (PID 0x2308)
I2S speaker amplifier, reusing the AW88395 library for ACF firmware parsing
and profile loading.

> diff --git a/sound/soc/codecs/aw88461.c b/sound/soc/codecs/aw88461.c
> new file mode 100644
> index 0000000000000..e5fb31f318caf
> --- /dev/null
> +++ b/sound/soc/codecs/aw88461.c
> @@ -0,0 +1,645 @@

[ ... ]

> +/*
> + * Park the chip in a silent, powered-down state.  The driver deliberately does
> + * not latch an error (and does not touch the profile loaded into the chip), so
> + * that the DAPM power-up event of the next playback can retry.
> + */
> +static int aw88461_down(struct aw88461 *amp, int error)
> +{
> +	struct regmap *map = amp->aw_dev.regmap;
> +
> +	amp->powered = false;
> +	if (regmap_update_bits(map, AW88461_SYSCTRL,
> +			       AW88461_HMUTE | AW88461_ULS_HMUTE,
> +			       AW88461_HMUTE | AW88461_ULS_HMUTE))
> +		dev_err(amp->aw_dev.dev, "failed to mute the amplifier\n");
> +	if (regmap_update_bits(map, AW88461_SYSCTRL,
> +			       AW88461_AMPPD | AW88461_PWDN,
> +			       AW88461_AMPPD | AW88461_PWDN))
> +		dev_err(amp->aw_dev.dev, "failed to power down the amplifier\n");
> +	return error;
> +}

[Severity: Medium]
Should aw88461_down() also clear AW88461_TXEN in AW88461_SYSCTRL and
restore AW88461_VOLUME to 1023 in AW88461_SYSCTRL2?

If a regmap write fails after the amplifier is running (for example, in
aw88461_volume_put() or aw88461_stop()), aw88461_down() leaves
AW88461_TXEN enabled and AW88461_VOLUME at the active attenuation level.
On the next playback retry, aw88461_start() then brings the chip out of
AW88461_PWDN and AW88461_AMPPD with AW88461_TXEN already asserted instead
of following PWDN -> PLL lock -> AMPPD -> TXEN, and clears AW88461_HMUTE |
AW88461_ULS_HMUTE before aw88461_fade() resets the volume to 1023.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261130234745.1063224-1-xiaqinghuan@mail.ustc.edu.cn?part=2

      reply	other threads:[~2026-11-30 23:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 23:47 [PATCH v2 0/2] ASoC: aw88461: add the Awinic AW88461 speaker amplifier Qianhui Xu
2026-11-30 23:47 ` [PATCH v2 1/2] ASoC: dt-bindings: awinic,aw88395: add the AW88461 variant Qianhui Xu
2026-11-30 23:47 ` [PATCH v2 2/2] ASoC: codecs: aw88461: add the Awinic AW88461 speaker amplifier driver Qianhui Xu
2026-11-30 23:57   ` sashiko-bot [this message]

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=sashiko-outbox-242259@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=xiaqinghuan@mail.ustc.edu.cn \
    /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