All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alexander Koch" <mail@alexanderkoch.net>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v2 1/2] ASoC: codecs: ak4619: Add optional powerdown GPIO
Date: Tue, 29 Sep 2026 09:15:58 +0000	[thread overview]
Message-ID: <20260929091558.B62D71F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260929090821.1476257-2-mail@alexanderkoch.net>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] ASoC: ak4619: missing power-down GPIO assertion on unbind
- [Low] ASoC: ak4619: missing inclusion of <linux/delay.h> for msleep()
--

commit 1a6c5d3bb52b0196ff6b96586fdeceef456751a9
Author: Alexander Koch <mail@alexanderkoch.net>

ASoC: codecs: ak4619: Add optional powerdown GPIO

This commit adds an optional 'powerdown-gpios' device tree binding. If
defined, the PDN pin is configured during probe with a delay prior to
register access.

> diff --git a/sound/soc/codecs/ak4619.c b/sound/soc/codecs/ak4619.c
> index d9c9f6b200284..c4f0db1e51c8d 100644
> --- a/sound/soc/codecs/ak4619.c
> +++ b/sound/soc/codecs/ak4619.c
[ ... ]
> @@ -875,10 +876,20 @@ static int ak4619_i2c_probe(struct i2c_client *i2c)
>  
>  	i2c_set_clientdata(i2c, ak4619);
>  
> +	ak4619->pdn_gpio = devm_gpiod_get_optional(dev, "powerdown",
> +		GPIOD_OUT_LOW);
> +	if (IS_ERR(ak4619->pdn_gpio))
> +		return dev_err_probe(dev, PTR_ERR(ak4619->pdn_gpio),
> +			"powerdown GPIO request failed\n");
> +	if (ak4619->pdn_gpio)
> +		msleep(10);

[Severity: Low]
Does this code rely on transitive header inclusions for msleep()? It appears
that <linux/delay.h> is not explicitly included in this file, which might
cause build failures if core headers are refactored.

[ ... ]
> @@ -887,6 +898,8 @@ static int ak4619_i2c_probe(struct i2c_client *i2c)
>  	if (ret < 0) {
>  		dev_err(dev, "Failed to register ak4619 component: %d\n",
>  			ret);
> +		if (ak4619->pdn_gpio)
> +			gpiod_set_value_cansleep(ak4619->pdn_gpio, 1);
>  		return ret;
>  	}
>  

[Severity: Medium]
Will the device remain permanently powered on if the module is unloaded or
unbound? The probe error paths correctly revert the GPIO state to 1 to power
down the device, but ak4619_i2c_driver lacks a .remove callback to handle
the unbind path.

Could this state leak be addressed by using devm_add_action_or_reset() during
ak4619_i2c_probe() to ensure teardown symmetry when the device is unbound?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260929090821.1476257-1-mail@alexanderkoch.net?part=1

  reply	other threads:[~2026-09-29  9:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29  9:08 [PATCH v2 0/2] ASoC: codecs: ak4619: Add PDN pin handling Alexander Koch
2026-09-29  9:08 ` [PATCH v2 1/2] ASoC: codecs: ak4619: Add optional powerdown GPIO Alexander Koch
2026-09-29  9:15   ` sashiko-bot [this message]
2026-09-29  9:08 ` [PATCH v2 2/2] ASoC: dt-bindings: asahi-kasei,ak4619: Add " Alexander Koch
2026-09-29 11:46 ` [PATCH v2 0/2] ASoC: codecs: ak4619: Add PDN pin handling Mark Brown

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=20260929091558.B62D71F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=mail@alexanderkoch.net \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.