Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: hda: Move common codec driver into sound/hda/common directory

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

+103 -89
+5
sound/hda/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 + menu "HD-Audio" 3 + 4 + source "sound/hda/common/Kconfig" 2 5 source "sound/hda/core/Kconfig" 6 + 7 + endmenu
+1
sound/hda/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 obj-y += core/ 3 + obj-$(CONFIG_SND_HDA) += common/
+80
sound/hda/common/Kconfig
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + 3 + config SND_HDA 4 + tristate 5 + select SND_PCM 6 + select SND_VMASTER 7 + select SND_JACK 8 + select SND_HDA_CORE 9 + 10 + if SND_HDA 11 + 12 + config SND_HDA_HWDEP 13 + bool "Build hwdep interface for HD-audio driver" 14 + select SND_HWDEP 15 + help 16 + Say Y here to build a hwdep interface for HD-audio driver. 17 + This interface can be used for out-of-band communication 18 + with codecs for debugging purposes. 19 + 20 + config SND_HDA_RECONFIG 21 + bool "Allow dynamic codec reconfiguration" 22 + help 23 + Say Y here to enable the HD-audio codec re-configuration feature. 24 + It allows user to clear the whole codec configuration, change the 25 + codec setup, add extra verbs, and re-configure the codec dynamically. 26 + 27 + Note that this item alone doesn't provide the sysfs interface, but 28 + enables the feature just for the patch loader below. 29 + If you need the traditional sysfs entries for the manual interaction, 30 + turn on CONFIG_SND_HDA_HWDEP as well. 31 + 32 + config SND_HDA_INPUT_BEEP 33 + bool "Support digital beep via input layer" 34 + depends on INPUT=y || INPUT=SND_HDA 35 + help 36 + Say Y here to build a digital beep interface for HD-audio 37 + driver. This interface is used to generate digital beeps. 38 + 39 + config SND_HDA_INPUT_BEEP_MODE 40 + int "Digital beep registration mode (0=off, 1=on)" 41 + depends on SND_HDA_INPUT_BEEP=y 42 + default "1" 43 + range 0 1 44 + help 45 + Set 0 to disable the digital beep interface for HD-audio by default. 46 + Set 1 to always enable the digital beep interface for HD-audio by 47 + default. 48 + 49 + config SND_HDA_PATCH_LOADER 50 + bool "Support initialization patch loading for HD-audio" 51 + select FW_LOADER 52 + select SND_HDA_RECONFIG 53 + help 54 + Say Y here to allow the HD-audio driver to load a pseudo 55 + firmware file ("patch") for overriding the BIOS setup at 56 + start up. The "patch" file can be specified via patch module 57 + option, such as patch=hda-init. 58 + 59 + config SND_HDA_POWER_SAVE_DEFAULT 60 + int "Default time-out for HD-audio power-save mode" 61 + depends on PM 62 + default 0 63 + help 64 + The default time-out value in seconds for HD-audio automatic 65 + power-save mode. 0 means to disable the power-save mode. 66 + 67 + config SND_HDA_CTL_DEV_ID 68 + bool "Use the device identifier field for controls" 69 + depends on SND_HDA_INTEL 70 + help 71 + Say Y to use the device identifier field for (mixer) 72 + controls (old behaviour until this option is available). 73 + 74 + When enabled, the multiple HDA codecs may set the device 75 + field in control (mixer) element identifiers. The use 76 + of this field is not recommended and defined for mixer controls. 77 + 78 + The old behaviour (Y) is obsolete and will be removed. Consider 79 + to not enable this option. 80 + endif
+13
sound/hda/common/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + snd-hda-codec-y := bind.o codec.o jack.o auto_parser.o sysfs.o 3 + snd-hda-codec-y += controller.o 4 + snd-hda-codec-$(CONFIG_SND_PROC_FS) += proc.o 5 + 6 + snd-hda-codec-$(CONFIG_SND_HDA_HWDEP) += hwdep.o 7 + snd-hda-codec-$(CONFIG_SND_HDA_INPUT_BEEP) += beep.o 8 + 9 + # for trace-points 10 + CFLAGS_controller.o := -I$(src) 11 + 12 + # common driver 13 + obj-$(CONFIG_SND_HDA) := snd-hda-codec.o
-76
sound/pci/hda/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 menu "HD-Audio" 3 3 4 - config SND_HDA 5 - tristate 6 - select SND_PCM 7 - select SND_VMASTER 8 - select SND_JACK 9 - select SND_HDA_CORE 10 - 11 4 config SND_HDA_GENERIC_LEDS 12 5 bool 13 6 ··· 47 54 will be called snd-hda-acpi. 48 55 49 56 if SND_HDA 50 - 51 - config SND_HDA_HWDEP 52 - bool "Build hwdep interface for HD-audio driver" 53 - select SND_HWDEP 54 - help 55 - Say Y here to build a hwdep interface for HD-audio driver. 56 - This interface can be used for out-of-band communication 57 - with codecs for debugging purposes. 58 - 59 - config SND_HDA_RECONFIG 60 - bool "Allow dynamic codec reconfiguration" 61 - help 62 - Say Y here to enable the HD-audio codec re-configuration feature. 63 - It allows user to clear the whole codec configuration, change the 64 - codec setup, add extra verbs, and re-configure the codec dynamically. 65 - 66 - Note that this item alone doesn't provide the sysfs interface, but 67 - enables the feature just for the patch loader below. 68 - If you need the traditional sysfs entries for the manual interaction, 69 - turn on CONFIG_SND_HDA_HWDEP as well. 70 - 71 - config SND_HDA_INPUT_BEEP 72 - bool "Support digital beep via input layer" 73 - depends on INPUT=y || INPUT=SND_HDA 74 - help 75 - Say Y here to build a digital beep interface for HD-audio 76 - driver. This interface is used to generate digital beeps. 77 - 78 - config SND_HDA_INPUT_BEEP_MODE 79 - int "Digital beep registration mode (0=off, 1=on)" 80 - depends on SND_HDA_INPUT_BEEP=y 81 - default "1" 82 - range 0 1 83 - help 84 - Set 0 to disable the digital beep interface for HD-audio by default. 85 - Set 1 to always enable the digital beep interface for HD-audio by 86 - default. 87 - 88 - config SND_HDA_PATCH_LOADER 89 - bool "Support initialization patch loading for HD-audio" 90 - select FW_LOADER 91 - select SND_HDA_RECONFIG 92 - help 93 - Say Y here to allow the HD-audio driver to load a pseudo 94 - firmware file ("patch") for overriding the BIOS setup at 95 - start up. The "patch" file can be specified via patch module 96 - option, such as patch=hda-init. 97 57 98 58 config SND_HDA_CIRRUS_SCODEC 99 59 tristate ··· 340 394 comment "Set to Y if you want auto-loading the codec driver" 341 395 depends on SND_HDA=y && SND_HDA_GENERIC=m 342 396 343 - config SND_HDA_POWER_SAVE_DEFAULT 344 - int "Default time-out for HD-audio power-save mode" 345 - depends on PM 346 - default 0 347 - help 348 - The default time-out value in seconds for HD-audio automatic 349 - power-save mode. 0 means to disable the power-save mode. 350 - 351 397 config SND_HDA_INTEL_HDMI_SILENT_STREAM 352 398 bool "Enable Silent Stream always for HDMI" 353 399 depends on SND_HDA_INTEL ··· 354 416 to start playing audio after the clock has been stopped. 355 417 This feature can impact power consumption as resources 356 418 are kept reserved both at transmitter and receiver. 357 - 358 - config SND_HDA_CTL_DEV_ID 359 - bool "Use the device identifier field for controls" 360 - depends on SND_HDA_INTEL 361 - help 362 - Say Y to use the device identifier field for (mixer) 363 - controls (old behaviour until this option is available). 364 - 365 - When enabled, the multiple HDA codecs may set the device 366 - field in control (mixer) element identifiers. The use 367 - of this field is not recommended and defined for mixer controls. 368 - 369 - The old behaviour (Y) is obsolete and will be removed. Consider 370 - to not enable this option. 371 419 372 420 endif 373 421
+2 -11
sound/pci/hda/Makefile
··· 3 3 snd-hda-tegra-y := hda_tegra.o 4 4 snd-hda-acpi-y := hda_acpi.o 5 5 6 - snd-hda-codec-y := hda_bind.o hda_codec.o hda_jack.o hda_auto_parser.o hda_sysfs.o 7 - snd-hda-codec-y += hda_controller.o 8 - snd-hda-codec-$(CONFIG_SND_PROC_FS) += hda_proc.o 9 - 10 - snd-hda-codec-$(CONFIG_SND_HDA_HWDEP) += hda_hwdep.o 11 - snd-hda-codec-$(CONFIG_SND_HDA_INPUT_BEEP) += hda_beep.o 12 - 13 6 # for trace-points 14 - CFLAGS_hda_controller.o := -I$(src) 15 7 CFLAGS_hda_intel.o := -I$(src) 8 + 9 + subdir-ccflags-y += -I$(src)/../../hda/common 16 10 17 11 snd-hda-codec-generic-y := hda_generic.o 18 12 snd-hda-codec-realtek-y := patch_realtek.o ··· 36 42 snd-hda-scodec-tas2781-y := tas2781_hda.o 37 43 snd-hda-scodec-tas2781-i2c-y := tas2781_hda_i2c.o 38 44 snd-hda-scodec-tas2781-spi-y := tas2781_hda_spi.o 39 - 40 - # common driver 41 - obj-$(CONFIG_SND_HDA) := snd-hda-codec.o 42 45 43 46 # codec drivers 44 47 obj-$(CONFIG_SND_HDA_GENERIC) += snd-hda-codec-generic.o
sound/pci/hda/hda_auto_parser.c sound/hda/common/auto_parser.c
sound/pci/hda/hda_auto_parser.h sound/hda/common/hda_auto_parser.h
sound/pci/hda/hda_beep.c sound/hda/common/beep.c
sound/pci/hda/hda_beep.h sound/hda/common/hda_beep.h
sound/pci/hda/hda_bind.c sound/hda/common/bind.c
sound/pci/hda/hda_codec.c sound/hda/common/codec.c
+1 -1
sound/pci/hda/hda_controller.c sound/hda/common/controller.c
··· 29 29 #include "hda_local.h" 30 30 31 31 #define CREATE_TRACE_POINTS 32 - #include "hda_controller_trace.h" 32 + #include "controller_trace.h" 33 33 34 34 /* DSP lock helpers */ 35 35 #define dsp_lock(dev) snd_hdac_dsp_lock(azx_stream(dev))
sound/pci/hda/hda_controller.h sound/hda/common/hda_controller.h
+1 -1
sound/pci/hda/hda_controller_trace.h sound/hda/common/controller_trace.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 2 #undef TRACE_SYSTEM 3 3 #define TRACE_SYSTEM hda_controller 4 - #define TRACE_INCLUDE_FILE hda_controller_trace 4 + #define TRACE_INCLUDE_FILE controller_trace 5 5 6 6 #if !defined(_TRACE_HDA_CONTROLLER_H) || defined(TRACE_HEADER_MULTI_READ) 7 7 #define _TRACE_HDA_CONTROLLER_H
sound/pci/hda/hda_hwdep.c sound/hda/common/hwdep.c
sound/pci/hda/hda_jack.c sound/hda/common/jack.c
sound/pci/hda/hda_jack.h sound/hda/common/hda_jack.h
sound/pci/hda/hda_local.h sound/hda/common/hda_local.h
sound/pci/hda/hda_proc.c sound/hda/common/proc.c
sound/pci/hda/hda_sysfs.c sound/hda/common/sysfs.c