]> git.ipfire.org Git - thirdparty/linux.git/commit
ALSA: ctxfi: Keep line/mic notification controls per mixer
authorCássio Gabriel <cassiogabrielcontato@gmail.com>
Mon, 18 May 2026 02:33:49 +0000 (23:33 -0300)
committerTakashi Iwai <tiwai@suse.de>
Mon, 18 May 2026 13:43:17 +0000 (15:43 +0200)
commit456ad3cdaf04229fe5052eaeb5deb48936d7a917
tree91eee21924216432a611cbd20b9c527398763ac8
parent83fbbcb7935ec6d2c8ba3bc133e8a0ead2ab0b2d
ALSA: ctxfi: Keep line/mic notification controls per mixer

ctxfi stores the Line Capture Switch and Mic Capture Switch controls in
a file-scope kctls[] array so do_line_mic_switch() can notify the
opposite control when the shared line/mic input selection changes.

That storage is shared by all ctxfi cards. If more than one X-Fi card is
present, a later card can overwrite the pointers saved by an earlier one.
A control update on one card can then use another card's kcontrol object
for snd_ctl_notify(). If that other card is removed, the saved pointer can
also become stale.

Store those notification targets in struct ct_mixer instead. The mixer is
per-card state and matches the lifetime of the controls created for that
card.

Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Link: https://patch.msgid.link/20260517-alsa-ctxfi-mixer-kctls-v1-1-6e4f81f6b658@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/ctxfi/ctmixer.c
sound/pci/ctxfi/ctmixer.h