summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-07-11ALSA: hda: Drop superfluous driver->ops NULL checksTakashi Iwai
After all conversions, driver->ops became a must in most places (except for the codec power setup which might be called before binding to the codec driver), hence we can get rid of the superfluous driver->ops NULL checks, too. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-26-tiwai@suse.de
2025-07-11ALSA: hda: Drop old codec binding methodTakashi Iwai
Now that all patch_ops usage have been converted to the new hda_codec_ops probe, we can drop patch_ops from the hda_codec, together with the calls of patch_ops callbacks. The hda_codec_ops.free callback is removed as all have been replaced with the new remove callback. Also, correct comments mentioning "patch"; it's replaced with "codec driver". Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-25-tiwai@suse.de
2025-07-11ALSA: hda/hdmi: Rewrite to new probe methodTakashi Iwai
Convert the HDMI codec drivers to use the new hda_codec_ops probe. The Intel and Nvidia-MCP HDMI drivers needed slightly more changes to deal with the unified callbacks among all models. Also another non-trivial change is Intel driver's set_power_state callback. An additional NULL check of codec->spec is needed there since the set_power_state() may be called before the probe gets called (e.g. in ASoC hda codec hda_codec_probe()). Other than that, no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-24-tiwai@suse.de
2025-07-11ALSA: hda/ca0132: Rewrite to new probe methodTakashi Iwai
Convert the CA0132 codec driver to use the new hda_codec_ops probe. No functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-23-tiwai@suse.de
2025-07-11ALSA: hda/sigmatel: Rewrite to new probe methodTakashi Iwai
Convert the Sigmatel/IDT codec driver to use the new hda_codec_ops probe. No functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-22-tiwai@suse.de
2025-07-11ALSA: hda/via: Rewrite to new probe methodTakashi Iwai
Convert the VIA codec driver to use the new hda_codec_ops probe. No functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-21-tiwai@suse.de
2025-07-11ALSA: hda/si3054: Rewrite to new probe methodTakashi Iwai
Convert the SI3054 codec driver to use the new hda_codec_ops probe. No functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-20-tiwai@suse.de
2025-07-11ALSA: hda/senary: Rewrite to new probe methodTakashi Iwai
Convert the Senary codec driver to use the new hda_codec_ops probe. No functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-19-tiwai@suse.de
2025-07-11ALSA: hda/conexant: Rewrite to new probe methodTakashi Iwai
Convert the Conexant codec driver to use the new hda_codec_ops probe. No functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-18-tiwai@suse.de
2025-07-11ALSA: hda/cs8409: Rewrite to new probe methodTakashi Iwai
Convert the CS8409 codec driver to use the new hda_codec_ops probe. The Dolphin support needs an override of unsol_event callback, and redirect via spec->unsol_event function pointer for now. Other than that, no functional changes. Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-17-tiwai@suse.de
2025-07-11ALSA: hda/cirrus: Split to cs420x and cs421x driversTakashi Iwai
Since the codec ops for CS420x and CS421x are fairly independent, split the cirrus codec driver into two drivers, snd-hda-codec-cs420x and snd-hda-code-cs421x. Together with the split, convert to the new hda_codec_ops probe. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-16-tiwai@suse.de
2025-07-11ALSA: hda/ca0110: Rewrite to new probe methodTakashi Iwai
Convert the CA0110 codec driver to use the new hda_codec_ops probe. No functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-15-tiwai@suse.de
2025-07-11ALSA: hda/analog: Rewrite to new probe methodTakashi Iwai
Convert the Analog Device codec driver to use the new hda_codec_ops probe. The probe function had to be unified and branched with the model type specified via driver_data instead. Other than that, no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-14-tiwai@suse.de
2025-07-11ALSA: hda/cmedia: Rewrite to new probe methodTakashi Iwai
Convert the C-Media codec driver to use the new hda_codec_ops probe. Since the CM9825 uses a completely different probe and codec ops, factor out to an individual codec driver, snd-hda-codec-cm9825. Other than that, no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-13-tiwai@suse.de
2025-07-11ALSA: hda/realtek: Rewrite to new probe methodTakashi Iwai
Convert the Realtek codec drivers to use the new hda_codec_ops probe. No functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-12-tiwai@suse.de
2025-07-11ALSA: hda/generic: Rewrite to new probe methodTakashi Iwai
Convert the generic HD-audio codec driver to use the new hda_codec_ops probe. No functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-11-tiwai@suse.de
2025-07-11ALSA: hda: Introduce hda_codec_driver opsTakashi Iwai
Until now, we use "patch_ops" embedded in hda_codec object for defining the callbacks that are used in various places to manage HD-audio codec. But from the device driver POV, this should have been rather the driver ops, instead of the callbacks in the codec object. This patch defines the driver ops for HD-audio codec driver as the replacement. We reuse the same struct hda_codec_ops, and this is put as hda_codec_driver.ops. When the driver->ops callbacks are defined, they are called primarily instead of codec->patch_ops callbacks. With converting to the driver ops, there is no need to pass the ugly patch_ops handling in hda_device_id tables. That is, driver_data field of hda_device_id becomes really optional and it can be used for passing the codec-specific data (e.g. specifying a model). The codec entries after the conversion should be with HDA_CODEC_ID() and co, instead of the former HDA_CODEC_ENTRY(). Once after converting all codec drivers to use driver ops, we can get rid of codec patch_ops. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-10-tiwai@suse.de
2025-07-11ALSA: hda/hdmi: Split vendor codec driversTakashi Iwai
In the past, we unified HD-audio HDMI codec driver once with a slight hope that more vendors will follow the standard, but in reality, the driver received more and more vendor-specific code. In order to make the messy code a bit more understandable, this patch splits the HDMI codec driver into multiple drivers again. Namely, the vendor-specific code for Intel, AMD and Nvidia are moved into the own drivers, while we split the common HDMI code to two drivers, the generic HDMI driver and the simple HDMI driver. So, now we have: - The generic HDMI driver (snd-hda-codec-hdmi): providing the common helpers, also supports Glenfly HDMI codecs and some other codecs that don't need vendor-specific stuff - The simple HDMI driver (snd-hda-codec-simplehdmi): devices with no dynamic PCM assignment and with fixed channels, mostly used by some other drivers, but this driver alone suffices for VIA HDMI codec support, too - Intel HDMI driver (snd-hda-codec-intelhdmi): bound with i915 / Xe DRM, based on the generic HDMI driver - AMD/ATI HDMI driver (snd-hda-codec-atihdmi): optionally bound with radeon / amdgpu DRM, based on the generic HDMI driver - Nvidia HDMI driver (snd-hda-codec-nvhdmi); optionally bound with nouveau DRM, based on the generic HDMI driver - Legacy Nvidia HDMI driver (snd-hda-codec-nvhdmi-mcp): for 2ch or 8ch outputs, based on the simple HDMI driver - Nvidia Tegra HDMI driver (snd-hda-codec-tegrahdmi): based on the generic HDMI driver Along with the driver split, the enable_silent_stream module option is moved to snd-hda-codec-intelhdmi, too, as it's an Intel-specific feature. Most of the changes here are just to split and move the code to different files, as well as to rename/expose the functions that are commonly used by drivers. The silent stream handling code is slightly modified for putting the stuff into Intel driver; now a new callback "silent_stream" is defined in hdmi_ops, and it's called in silent_stream_enable() and *_disable() functions. The runtime-PM handling in silent_stream_enable() was cleaned up, and rather taking the runtime PM refcount in the silent_stream() callback appropriately, instead. Other than that, there should be no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-9-tiwai@suse.de
2025-07-11ALSA: hda: Split Realtek HD-audio codec driverTakashi Iwai
The snd-hda-codec-realtek driver supports many different codec models and accumulated lots of quirks. Now let's split it to multiple modules per probe function, i.e. for ALC260, ALC262, ALC269, etc. The common code and quirks are provided by the common library module, snd-hda-codec-realtek-lib now. One drawback of this action is that many symbols have to be exported. But they are limited with SND_HDA_CODEC_REALTEK namespace, at least. This patch tries to be idiomatic and doesn't try to rewrite the existing code. We can move the codec model-specific code into each codec driver later. The HD-audio sub-codec component binding is currently specific to ALC269, hence the management is moved into alc269.c. After that, alc_free() became identical with snd_hda_gen_free(), and it's replaced as a macro just to call snd_hda_gen_free(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-8-tiwai@suse.de
2025-07-11ALSA: hda: Move codec drivers into sound/hda/codecs directoryTakashi Iwai
Now move the all remaining codec drivers from sound/pci/hda to sound/hda/codecs subdirectory. Some drivers are put under the further vendor subdirectory, and the vendor helper code (*_helper.c) are put under helpers subdirectory. Also the sub-codec drivers are moved under a different subdirectory, sound/hda/codecs/sub-codecs, for distinguishing from the main HD-audio codec drivers. The prefix patch_ and hda_ as well as the suffix _helper are dropped from file names as they are mostly superfluous. No functional changes but just file path shuffling. Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-7-tiwai@suse.de
2025-07-11ALSA: hda: Move controller drivers into sound/hda/controllers directoryTakashi Iwai
Now HD-audio controller drivers are moved into sound/hda/controllers directory as a part of HD-audio code reorganization. Most of drivers are independent from PCI bus, hence it makes more sense to put under sound/hda. The hda_ prefix is dropped from most of files at moving, as it's more or less superfluous. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-6-tiwai@suse.de
2025-07-11ALSA: hda: Move CONFIG_SND_HDA_PREALLOC_SIZE into sound/hda/commonTakashi Iwai
CONFIG_SND_HDA_PREALLOC_SIZE is used only by controller.c in sound/hda/common, hence it depends on CONFIG_SND_HDA. Move the definition to the right place inside SND_HDA if/endif block in sound/hda/common/Kconfig. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-5-tiwai@suse.de
2025-07-11ALSA: hda: Move common codec driver into sound/hda/common directoryTakashi Iwai
The snd-hda-codec module contains the most of common code used by both HD-audio controller and codec drivers, and it's basically independent from PCI. Let's move the code to sound/hda/common directory as a part of code reorganization. The hda_ prefix is dropped from the most of file names as it's rather superfluous. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-4-tiwai@suse.de
2025-07-11ALSA: hda: Move HD-audio core stuff into sound/hda/coreTakashi Iwai
This is a part of HD-audio code restructuring. Simply move the current code of sound/hda/* into the subdirectory sound/hda/core, so that more stuff can be moved into sound/hda cleanly later. Most of file names with hdac_ and hdac_ext_ prefix are renamed without the prefix, since they can be identified well in the directory name and superfluous. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-3-tiwai@suse.de
2025-07-11ALSA: hda: Move widget capability macros into hdaudio.hTakashi Iwai
The get_wcaps() and co are used not only by HD-audio core but also other driver code, hence it'd be better to put into the common header instead of local.h. OTOH, there are macros of the same name like get_wcaps() that are still used in sound/pci/hda/* locally, and those conflict with each other. So we need to rename get_wcaps() (to be moved from hda-core) with the proper snd_hdac prefix for avoiding name conflicts, and define in the common hdaudio.h. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250709160434.1859-2-tiwai@suse.de
2025-07-11ALSA: core: Copy string more safelyTakashi Iwai
Replace the remaining strcpy() and sprintf() usages in the ALSA core code with the safer versions. The first strcpy() points actually to card->id, hence just use strscpy() with card->id instead. The append of suffix string is slightly rewritten so that we can use scnprintf() and strscpy(). Only for safety, no actual behavior change. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-104-tiwai@suse.de
2025-07-11ALSA: usb-audio: Copy string more safelyTakashi Iwai
Replace strcpy() and sprintf() usages in the USB audio drivers with the safer versions (strscpy() and scnprintf()) with the proper max size evaluation. Only for safety, no actual behavior change. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-103-tiwai@suse.de
2025-07-11ALSA: cmipci: Copy string more safelyTakashi Iwai
The probe code uses sprintf() and strcat() without caring about the string buffer size. Replace with safer code. Only a cosmetic safety matter, no functional changes intended. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-102-tiwai@suse.de
2025-07-11ALSA: ac97: Copy string more safelyTakashi Iwai
snd_ac97_get_name() blindly assumes that the name buffer is large enough, but we should be more careful. Pass the max buffer length and allow trimming to the size. Only a cosmetic safety matter, no functional changes intended. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-101-tiwai@suse.de
2025-07-11ALSA: usb-audio: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-100-tiwai@suse.de
2025-07-11ALSA: ua101: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-99-tiwai@suse.de
2025-07-11ALSA: usx2y: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-98-tiwai@suse.de
2025-07-11ALSA: line6: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-97-tiwai@suse.de
2025-07-11ALSA: 6fire: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-96-tiwai@suse.de
2025-07-11ALSA: synth: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-95-tiwai@suse.de
2025-07-11ALSA: spi: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-94-tiwai@suse.de
2025-07-11ALSA: sparc: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-93-tiwai@suse.de
2025-07-11ALSA: sh: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-92-tiwai@suse.de
2025-07-11ALSA: ppc: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-91-tiwai@suse.de
2025-07-11ALSA: vxpocket: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-90-tiwai@suse.de
2025-07-11ALSA: pdaudiocf: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-89-tiwai@suse.de
2025-07-11ALSA: ymfpci: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-88-tiwai@suse.de
2025-07-11ALSA: via82xx: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-87-tiwai@suse.de
2025-07-11ALSA: trident: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-86-tiwai@suse.de
2025-07-11ALSA: sonicvibes: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-85-tiwai@suse.de
2025-07-11ALSA: sis7019: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-84-tiwai@suse.de
2025-07-11ALSA: rme9652: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-83-tiwai@suse.de
2025-07-11ALSA: hdspm: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-82-tiwai@suse.de
2025-07-11ALSA: hdsp: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-81-tiwai@suse.de
2025-07-11ALSA: rme96: Use safer strscpy() instead of strcpy()Takashi Iwai
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-80-tiwai@suse.de