* [PATCH] ALSA: i2c: ak4xxx-adda: implement AK4529 reset handling
@ 2026-04-07 21:13 Cássio Gabriel
2026-04-08 8:51 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Cássio Gabriel @ 2026-04-07 21:13 UTC (permalink / raw)
To: Takashi Iwai, Jaroslav Kysela
Cc: linux-sound, linux-kernel, Cássio Gabriel
Delta 410 uses snd_akm4xxx_reset() both around DFS changes and from
its PM callbacks, but the AK4529 case in this helper is still left
unimplemented and never drives the codec reset path.
The AK4529 datasheet documents register 09h.RSTN as an internal
timing reset. Clearing RSTN powers down the ADC and DAC blocks, but
does not reinitialize the register map. That matches the existing
ak4xxx helper model, which already keeps the desired codec state in
the software register cache.
Implement AK4529 reset handling by clearing 09h.RSTN on state == 1,
then replaying the cached register image and setting RSTN back to 1
on state == 0.
This restores cached Delta 410 mixer state after resume and gives
the AK4529 DFS-change path a real codec reset sequence.
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
---
sound/i2c/other/ak4xxx-adda.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/sound/i2c/other/ak4xxx-adda.c b/sound/i2c/other/ak4xxx-adda.c
index b24c80410d45..bdeb3cef3640 100644
--- a/sound/i2c/other/ak4xxx-adda.c
+++ b/sound/i2c/other/ak4xxx-adda.c
@@ -53,6 +53,31 @@ static void ak4524_reset(struct snd_akm4xxx *ak, int state)
}
}
+/* reset procedure for AK4529 */
+static void ak4529_reset(struct snd_akm4xxx *ak, int state)
+{
+ static const unsigned char regs[] = {
+ 0x0a, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
+ 0x06, 0x07, 0x0b, 0x0c, 0x08,
+ };
+ unsigned int i;
+ unsigned char reg;
+
+ if (state) {
+ snd_akm4xxx_write(ak, 0, 0x09,
+ snd_akm4xxx_get(ak, 0, 0x09) & ~0x01);
+ return;
+ }
+
+ for (i = 0; i < ARRAY_SIZE(regs); i++) {
+ reg = regs[i];
+ snd_akm4xxx_write(ak, 0, reg,
+ snd_akm4xxx_get(ak, 0, reg));
+ }
+ snd_akm4xxx_write(ak, 0, 0x09,
+ snd_akm4xxx_get(ak, 0, 0x09) | 0x01);
+}
+
/* reset procedure for AK4355 and AK4358 */
static void ak435X_reset(struct snd_akm4xxx *ak, int state)
{
@@ -99,7 +124,7 @@ void snd_akm4xxx_reset(struct snd_akm4xxx *ak, int state)
ak4524_reset(ak, state);
break;
case SND_AK4529:
- /* FIXME: needed for ak4529? */
+ ak4529_reset(ak, state);
break;
case SND_AK4355:
ak435X_reset(ak, state);
---
base-commit: e051f09ba003f8b93dda4a8d55a1bff797235c0b
change-id: 20260403-ak4529-reset-handling-9214370193ef
Best regards,
--
Cássio Gabriel <cassiogabrielcontato@gmail.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: i2c: ak4xxx-adda: implement AK4529 reset handling
2026-04-07 21:13 [PATCH] ALSA: i2c: ak4xxx-adda: implement AK4529 reset handling Cássio Gabriel
@ 2026-04-08 8:51 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2026-04-08 8:51 UTC (permalink / raw)
To: Cássio Gabriel
Cc: Takashi Iwai, Jaroslav Kysela, linux-sound, linux-kernel
On Tue, 07 Apr 2026 23:13:06 +0200,
Cássio Gabriel wrote:
>
> Delta 410 uses snd_akm4xxx_reset() both around DFS changes and from
> its PM callbacks, but the AK4529 case in this helper is still left
> unimplemented and never drives the codec reset path.
>
> The AK4529 datasheet documents register 09h.RSTN as an internal
> timing reset. Clearing RSTN powers down the ADC and DAC blocks, but
> does not reinitialize the register map. That matches the existing
> ak4xxx helper model, which already keeps the desired codec state in
> the software register cache.
>
> Implement AK4529 reset handling by clearing 09h.RSTN on state == 1,
> then replaying the cached register image and setting RSTN back to 1
> on state == 0.
>
> This restores cached Delta 410 mixer state after resume and gives
> the AK4529 DFS-change path a real codec reset sequence.
>
> Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Applied to for-next branch. Thanks.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-08 8:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 21:13 [PATCH] ALSA: i2c: ak4xxx-adda: implement AK4529 reset handling Cássio Gabriel
2026-04-08 8:51 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox