From: Alexander Koch <mail@alexanderkoch.net>
To: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Khanh Le <khanh.le.xr@renesas.com>
Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
Alexander Koch <mail@alexanderkoch.net>
Subject: [PATCH v2 1/2] ASoC: codecs: ak4619: Add optional powerdown GPIO
Date: Tue, 29 Sep 2026 11:08:20 +0200 [thread overview]
Message-ID: <20260929090821.1476257-2-mail@alexanderkoch.net> (raw)
In-Reply-To: <20260929090821.1476257-1-mail@alexanderkoch.net>
Add optional device tree binding that enables operation of the 'PDN' pin
during initialization:
codec@10 {
compatible = "asahi-kasei,ak4619";
reg = <0x10>;
powerdown-gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; // <--
#sound-dai-cells = <0>;
};
If defined, PDN is set high during driver probe, followed by a 10 ms
delay as required before first register access [1].
If no 'powerdown-gpios' is defined, the behaviour is unchanged.
[1] AK4619 datasheet, sec. 2 'Power-up/down Sequence', page 39
Signed-off-by: Alexander Koch <mail@alexanderkoch.net>
---
sound/soc/codecs/ak4619.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/sound/soc/codecs/ak4619.c b/sound/soc/codecs/ak4619.c
index d9c9f6b20028..c4f0db1e51c8 100644
--- a/sound/soc/codecs/ak4619.c
+++ b/sound/soc/codecs/ak4619.c
@@ -152,6 +152,7 @@
struct ak4619_priv {
struct regmap *regmap;
struct snd_pcm_hw_constraint_list constraint;
+ struct gpio_desc *pdn_gpio;
int deemph_en;
unsigned int playback_rate;
unsigned int sysclk;
@@ -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);
+
ak4619->regmap = devm_regmap_init_i2c(i2c, &ak4619_regmap_cfg);
if (IS_ERR(ak4619->regmap)) {
ret = PTR_ERR(ak4619->regmap);
dev_err(dev, "regmap_init() failed: %d\n", ret);
+ if (ak4619->pdn_gpio)
+ gpiod_set_value_cansleep(ak4619->pdn_gpio, 1);
return ret;
}
@@ -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;
}
--
2.55.0
next prev parent reply other threads:[~2026-09-29 9:08 UTC|newest]
Thread overview: 4+ 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 ` Alexander Koch [this message]
2026-09-29 9:08 ` [PATCH v2 2/2] ASoC: dt-bindings: asahi-kasei,ak4619: Add powerdown GPIO 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=20260929090821.1476257-2-mail@alexanderkoch.net \
--to=mail@alexanderkoch.net \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=khanh.le.xr@renesas.com \
--cc=krzk+dt@kernel.org \
--cc=kuninori.morimoto.gx@renesas.com \
--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
all inboxes | Powered by JetHome®