linux/sound/pci/hda
Jaroslav Kysela d045bceff5 ALSA: hda: Fix the control element identification for multiple codecs
Some motherboards have multiple HDA codecs connected to the serial bus.
The current code may create multiple mixer controls with the almost
identical identification.

The current code use id.device field from the control element structure
to store the codec address to avoid such clashes for multiple codecs.
Unfortunately, the user space do not handle this correctly. For mixer
controls, only name and index are used for the identifiers.

This patch fixes this problem to compose the index using the codec
address as an offset in case, when the control already exists. It is
really unlikely that one codec will create 10 similar controls.

This patch adds new kernel module parameter 'ctl_dev_id' to allow
select the old behaviour, too. The CONFIG_SND_HDA_CTL_DEV_ID Kconfig
option sets the default value.

BugLink: https://github.com/alsa-project/alsa-lib/issues/294
BugLink: https://github.com/alsa-project/alsa-lib/issues/205
Fixes: 54d1740315 ("[ALSA] hda-codec - Fix connection list parsing")
Fixes: 1afe206ab6 ("ALSA: hda - Try to find an empty control index when it's occupied")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20230202092013.4066998-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-02-03 17:19:20 +01:00
..
ca0132_regs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
cs35l41_hda_i2c.c ALSA: hda: cs35l41: Convert to i2c's .probe_new() 2022-11-19 09:43:38 +01:00
cs35l41_hda_spi.c ALSA: hda: cs35l41: Support Hibernation during Suspend 2022-07-15 16:21:39 +02:00
cs35l41_hda.c ALSA: hda: cs35l41: Check runtime suspend capability at runtime_idle 2023-01-07 09:29:53 +01:00
cs35l41_hda.h ALSA: hda: cs35l41: Support Firmware switching and reloading 2022-07-15 16:23:29 +02:00
hda_auto_parser.c ALSA: hda/realtek: Apply fixup for Lenovo Yoga Duet 7 properly 2022-06-15 07:28:51 +02:00
hda_auto_parser.h ALSA: hda/cirrus: Increase AUTO_CFG_MAX_INS from 8 to 18 2021-03-07 09:17:30 +01:00
hda_beep.c ALSA: hda: beep: Simplify keep-power-at-enable behavior 2022-09-06 11:24:02 +02:00
hda_beep.h ALSA: hda: beep: Simplify keep-power-at-enable behavior 2022-09-06 11:24:02 +02:00
hda_bind.c ALSA: hda: Do not unset preset when cleaning up codec 2023-01-23 09:11:19 +01:00
hda_codec.c ALSA: hda: Fix the control element identification for multiple codecs 2023-02-03 17:19:20 +01:00
hda_component.h ALSA: hda: cs35l41: Remove suspend/resume hda hooks 2022-10-12 08:02:48 +02:00
hda_controller_trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hda_controller.c ALSA: hda: Fix the control element identification for multiple codecs 2023-02-03 17:19:20 +01:00
hda_controller.h ALSA: hda: Fix the control element identification for multiple codecs 2023-02-03 17:19:20 +01:00
hda_cs_dsp_ctl.c firmware: cs_dsp: Make the exports namespaced 2022-11-25 11:54:00 +00:00
hda_cs_dsp_ctl.h ALSA: hda/cs_dsp_ctl: Fix mutex inversion when creating controls 2022-10-12 08:02:47 +02:00
hda_eld.c ALSA: hda/hdmi: ELD procfs - print the codec NIDs 2022-09-21 12:12:29 +02:00
hda_generic.c ALSA: hda: Fix UAF of leds class devs at unbinding 2022-01-26 15:56:35 +01:00
hda_generic.h ALSA: hda: Fix UAF of leds class devs at unbinding 2022-01-26 15:56:35 +01:00
hda_hwdep.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
hda_intel_trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hda_intel.c ALSA: hda: Fix the control element identification for multiple codecs 2023-02-03 17:19:20 +01:00
hda_intel.h ALSA: hda: intel: Allow repeatedly probing on codec configuration errors 2021-10-07 09:15:22 +02:00
hda_jack.c ALSA: hda: Do disconnect jacks at codec unbind 2021-11-17 14:41:16 +01:00
hda_jack.h ALSA: hda: Do disconnect jacks at codec unbind 2021-11-17 14:41:16 +01:00
hda_local.h ALSA: hda/hdmi: ELD procfs - print the codec NIDs 2022-09-21 12:12:29 +02:00
hda_proc.c ALSA: hda/proc - print DP-MST connections 2020-12-08 20:04:33 +01:00
hda_sysfs.c ALSA: hda: Remove unused MAX_PIN_CONFIGS constant 2022-08-19 11:29:13 +02:00
hda_tegra.c ALSA: hda/tegra: Align BDL entry to 4KB boundary 2022-09-06 07:13:32 +02:00
hp_x360_helper.c ALSA: hda/realtek - Fixup for HP x360 laptops with B&O speakers 2018-05-29 22:33:37 +02:00
ideapad_s740_helper.c ALSA: hda/realtek: Add quirk for Lenovo Ideapad S740 2021-04-16 10:12:50 +02:00
Kconfig ALSA: hda: Fix the control element identification for multiple codecs 2023-02-03 17:19:20 +01:00
Makefile ALSA: hda: hda_cs_dsp_ctl: Add Library to support CS_DSP ALSA controls 2022-07-14 11:19:37 +02:00
patch_analog.c ALSA: hda/analog - Sink ad198x_shutup() and shuffle CONFIG_PM guards 2021-08-18 07:51:09 +02:00
patch_ca0110.c ALSA: hda: Unify get_response handling 2019-12-13 14:36:52 +01:00
patch_ca0132.c ALSA: hda/ca0132: minor fix for allocation size 2023-01-17 18:01:34 +01:00
patch_cirrus.c ALSA: hda/cirrus - support for iMac 12,1 model 2022-08-11 07:41:43 +02:00
patch_cmedia.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_conexant.c ALSA: hda/conexant: Add quirk for LENOVO 20149 Notebook model 2022-08-08 10:18:58 +02:00
patch_cs8409-tables.c ALSA: hda/cs8409: Support new Dolphin Variants 2022-08-17 11:34:25 +02:00
patch_cs8409.c ALSA: hda/cirrus: Add extra 10 ms delay to allow PLL settle and lock. 2022-12-05 17:42:36 +01:00
patch_cs8409.h ALSA: hda/cs8409: change cs8409_fixups v.pins initializers to static 2022-07-05 09:45:21 +02:00
patch_hdmi.c ALSA: hda/hdmi: Add a HP device 0x8715 to force connect list 2023-01-10 09:33:48 +01:00
patch_realtek.c ALSA: hda/realtek: fix mute/micmute LEDs, speaker don't work for a HP platform 2023-01-18 17:50:48 +01:00
patch_si3054.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32 2019-05-24 17:27:10 +02:00
patch_sigmatel.c ALSA: hda: beep: Simplify keep-power-at-enable behavior 2022-09-06 11:24:02 +02:00
patch_via.c ALSA: hda/via: Avoid potential array out-of-bound in add_secret_dac_path() 2023-01-19 11:29:16 +01:00
thinkpad_helper.c ALSA: HDA - remove the custom implementation for the audio LED trigger 2021-03-30 15:35:15 +02:00